renderpix API
Convert HTML/CSS to pixel-perfect images with a single API call. Base URL: https://renderpix.dev
Authentication
All requests require an API key via X-API-Key header:
curl -H "X-API-Key: rpx_your_key" https://renderpix.dev/v1/render
Get your key from the Dashboard. Also accepted as ?api_key=rpx_... query param.
Quick start
curl -X POST https://renderpix.dev/v1/render \
-H "X-API-Key: rpx_your_key" \
-H "Content-Type: application/json" \
-d '{"html":"<h1 style=\"color:red\">Hello</h1>"}' \
-o hello.pngPOST/v1/render
Convert HTML/CSS to an image.
Request body (JSON)
| Parameter | Type | Default | Description |
|---|---|---|---|
html required | string | — | HTML/CSS to render |
width | integer | 1280 | Viewport width (1-3840) |
height | integer | 720 | Viewport height (1-2160) |
format | string | png | png, jpeg, or webp |
quality | integer | 90 | Quality for JPEG/WebP (1-100) |
scale | number | 1 | Device scale for Retina (0.5-3) |
vars | object | — | Key-value pairs to replace {{key}} placeholders in HTML |
waitUntil | string | load | Page ready signal: load, domcontentloaded, or networkidle |
callback_url | string | — | HTTPS URL to POST result to asynchronously (Pro+) |
selector | string | — | CSS selector to capture element (Pro+) |
fullPage | boolean | false | Capture full scrollable page (Pro+) |
Response headers
| Header | Description |
|---|---|
X-Render-Time | Duration in ms |
X-Usage-Remaining | Remaining renders |
X-Usage-Limit | Monthly limit |
GET/v1/screenshot
Screenshot any public URL.
curl "https://renderpix.dev/v1/screenshot?url=https://stripe.com&api_key=rpx_your_key" -o stripe.png
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url required | string | — | URL to capture |
width | integer | 1280 | Viewport width |
height | integer | 720 | Viewport height |
format | string | png | png, jpeg, or webp |
quality | integer | 90 | Quality (JPEG/WebP) |
fullPage | boolean | false | Full page capture |
POST/v1/batch
Render multiple HTML items in a single API call. Each item is processed independently — a failed item doesn't affect others (partial failure support).
Plan limits: Free: not available · Starter: max 10 items · Pro: max 50 items · Scale: max 100 items
Request
POST /v1/batch
X-API-Key: rpx_your_key
Content-Type: application/json
{
"items": [
{
"html": "<div style='background:#1a1a2e;color:white;padding:40px;font-size:32px'>Slide 1</div>",
"width": 1080,
"height": 1350,
"format": "png",
"vars": { "title": "Slide 1" }
},
{
"html": "<div style='background:#16213e;color:white;padding:40px;font-size:32px'>Slide 2</div>",
"width": 1080,
"height": 1350,
"format": "jpeg",
"quality": 85
}
],
"callback_url": "https://your-app.com/webhook"
}
Response — success (HTTP 200)
{
"results": [
{
"index": 0,
"success": true,
"image": "data:image/png;base64,iVBORw0KGgo...",
"format": "png",
"width": 1080,
"height": 1350,
"duration_ms": 312
},
{
"index": 1,
"success": true,
"image": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
"format": "jpeg",
"width": 1080,
"height": 1350,
"duration_ms": 287
}
],
"total": 2,
"succeeded": 2,
"failed": 0
}
Response — partial failure (HTTP 207)
{
"results": [
{ "index": 0, "success": true, "image": "...", "duration_ms": 290 },
{ "index": 1, "success": false, "error": "Render timeout exceeded" }
],
"total": 2,
"succeeded": 1,
"failed": 1
}
Error codes
| Status | Description |
|---|---|
| 400 | items array empty or limit exceeded → {"error":"Batch limit exceeded. Your plan allows up to N items."} |
| 403 | Free plan → {"error":"Batch rendering is not available on the Free plan."} |
Template Variables
Inject dynamic content into HTML using {{key}} syntax. The vars object replaces each key-value pair in the HTML before rendering. Available on all plans.
Request example
POST /v1/render
X-API-Key: rpx_your_key
Content-Type: application/json
{
"html": "<div style='font-family:sans-serif;padding:40px;background:#0f172a;color:white'>
<h1 style='color:#22d3ee'>{{title}}</h1>
<p>{{description}}</p>
<span style='color:#a78bfa'>{{date}}</span>
</div>",
"width": 1200,
"height": 630,
"format": "png",
"vars": {
"title": "My Blog Post",
"description": "An introduction to HTML-to-image APIs",
"date": "June 2026"
}
}
Notes
| Behaviour | Detail |
|---|---|
| Undefined keys | Left as-is in output: {{undefined_key}} → {{undefined_key}} |
| Optional | vars is optional; omit it to render HTML as-is |
| Per-item in batch | In /v1/batch each item can carry its own vars object |
Async Rendering
Pass a callback_url to start a render asynchronously. The API immediately returns 202 Accepted; when the render completes, it POSTs the result to your URL. Available on Pro and Scale plans.
Request
POST /v1/render
X-API-Key: rpx_your_key
Content-Type: application/json
{
"html": "<div>...</div>",
"width": 1200,
"height": 630,
"format": "png",
"callback_url": "https://your-app.com/renderpix-webhook"
}
Immediate response (HTTP 202)
{
"status": "accepted",
"message": "Render started. Result will be posted to your callback_url."
}
Callback payload (POSTed to your webhook when render completes)
POST https://your-app.com/renderpix-webhook
Content-Type: application/json
X-RenderPix-Event: render.complete
{
"success": true,
"image": "data:image/png;base64,iVBORw0KGgo...",
"format": "png",
"width": 1200,
"height": 630,
"duration_ms": 834
}
Notes
| Behaviour | Detail |
|---|---|
| Method | Callback is a POST request with a 10-second timeout |
| Resilience | A failed callback does not cancel or retry the render |
| Plan requirement | Pro or Scale plan required; returns 403 on Free/Starter |
waitUntil Parameter
Controls when Playwright considers the page ready before capturing the screenshot. Default: load. Available on all plans.
Values
| Value | When to use |
|---|---|
load (default) | Fires after the window load event. Sufficient for most static HTML. |
domcontentloaded | Fires as soon as the DOM is parsed, without waiting for external resources. Fastest option. |
networkidle | Fires when network activity has been idle for 500 ms. Use for external fonts, CDN assets, or lazy-loaded content. |
Example
{
"html": "<link href='https://fonts.googleapis.com/...' rel='stylesheet'><div>...</div>",
"width": 1200,
"height": 630,
"waitUntil": "networkidle"
}
GET/v1/og-image
Generate a ready-to-use Open Graph image from text. No HTML required. Authentication is optional — unauthenticated requests include a watermark and are limited to 10 requests/minute; authenticated requests count against your plan.
curl "https://renderpix.dev/v1/og-image?title=Hello+World&domain=mysite.com&theme=dark&api_key=rpx_your_key" -o og.png
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
title required | string | — | Main heading text |
desc | string | — | Subtitle or description text |
domain | string | — | Domain label shown at the bottom (e.g. mysite.com) |
theme | string | dark | Color theme: dark or light |
Response is a 1200×630 PNG — the standard Open Graph image size.
Error codes
| Status | Error | Description |
|---|---|---|
| 401 | missing_api_key | No API key provided |
| 401 | invalid_api_key | Key not found |
| 429 | usage_limit_exceeded | Monthly limit reached |
| 429 | rate_limit | Too many requests |
| 500 | render_failed | Rendering error |
Rate limits & plan comparison
All plans: 100 requests/minute per API key.
| Feature | Free | Starter | Pro | Scale |
|---|---|---|---|---|
| Renders / month | 100 | 2,000 | 10,000 | 50,000 |
| Max resolution | 1280×720 | 1920×2160 | 3840×2160 | 3840×2160 |
| Max scale (DPR) | 1× | 2× | 3× | 3× |
fullPage | — | — | ✓ | ✓ |
selector (CSS crop) | — | — | ✓ | ✓ |
| Batch Rendering | — | ≤10 items | ≤50 items | ≤100 items |
| Async Callback | — | — | ✓ | ✓ |
| Template Variables | ✓ | ✓ | ✓ | ✓ |
| waitUntil | ✓ | ✓ | ✓ | ✓ |