Batch Render
Render up to 25 HTML templates in a single request — all processed in parallel.
POST/v1/render/batch
Parameters
| Name | Type | Description |
|---|---|---|
| requests * | Array | Array of render objects. Each item accepts the same parameters as POST /v1/render. Maximum 25 items. |
All
N renders are deducted from your monthly limit upfront. If you don't have enough remaining renders, the entire request returns 429 before any rendering starts.Response
Returns a results array in the same order as the input. Each item is either a success or an error — one failure does not cancel the rest.
JSON
{
"results": [
{ "url": "https://api.starkrender.com/v1/image/uuid-1", "id": "uuid-1" },
{ "url": "https://api.starkrender.com/v1/image/uuid-2", "id": "uuid-2" },
{ "error": "html or template_id is required", "statusCode": 400 }
]
}
Examples
Batch of 3 renders
cURL
curl -X POST https://api.starkrender.com/v1/render/batch \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "requests": [ { "html": "<div style=\"background:red;width:200px;height:200px\"></div>", "width": 200, "height": 200 }, { "html": "<div style=\"background:blue;width:200px;height:200px\"></div>", "width": 200, "height": 200 }, { "html": "<div style=\"background:green;width:200px;height:200px\"></div>", "width": 200, "height": 200 } ] }'
Batch with a saved template + variables
JSON Body
{
"requests": [
{
"template_id": "86c4dab7-...",
"variables": { "headline": "Markets hit all-time high", "source": "Reuters" },
"width": 1080, "height": 1080
},
{
"template_id": "86c4dab7-...",
"variables": { "headline": "Oil prices drop 5%", "source": "Bloomberg" },
"width": 1080, "height": 1080
}
]
}
Limits
- Maximum 25 requests per batch call.
- All renders run in parallel — total response time ≈ the slowest single render.
- Each item in the batch supports all parameters from POST /v1/render (
selector,device_scale,transparent,image_url, etc.). - Individual failures return an
errorobject in the results array — the HTTP status of the batch response is always200when the batch itself was accepted.
StarkRender