StarkRender API
Convert HTML to images, screenshots, and PDFs — fast, headless, production-ready.
Overview
StarkRender is an HTTP API that renders HTML into pixel-perfect images (PNG or JPG) and PDFs. You can pass raw HTML, a public URL, or a saved template — and get back a hosted file URL in seconds.
| Endpoint | Description |
|---|---|
POST /v1/render | Render HTML or a saved template into PNG/JPG |
POST /v1/render/full | Premium Chromium render with external CSS injection (plans $49+) |
POST /v1/render/fast | Ultra-fast render (~50ms) — pure HTML/CSS only, no JS |
POST /v1/render/batch | Render up to 25 HTML templates in parallel in a single request |
POST /v1/screenshot | Open a public URL and capture a screenshot |
POST /v1/pdf | Convert HTML into a downloadable PDF |
POST /v1/template | Save a reusable HTML template with {{variables}} |
GET /v1/template/{id} | Retrieve a saved template |
DELETE /v1/template/{id} | Delete a saved template |
Authentication
All requests require an x-api-key header. Requests without a valid key return 401 Unauthorized.
x-api-key: YOUR_API_KEY
SDKs
Official SDKs wrap the REST API with typed methods — no manual fetch or requests needed.
Node.js
npm install starkrender
const StarkRender = require('starkrender'); const client = new StarkRender('YOUR_API_KEY'); const { url } = await client.render({ html: '<div style="background:red;width:800px;height:400px"></div>', width: 800, height: 400, }); console.log(url);
Python
pip install starkrender
from starkrender import StarkRender client = StarkRender("YOUR_API_KEY") result = client.render( html='<div style="background:red;width:800px;height:400px"></div>', width=800, height=400, ) print(result["url"])
Quick Start
Render your first image in under 60 seconds. Send an HTML fragment and get back a hosted image URL.
1. Make the request
curl -X POST https://api.starkrender.com/v1/render \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "html": "<div style=\"background:#0f172a;width:800px;height:400px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:40px;font-family:sans-serif\">Hello StarkRender</div>", "width": 800, "height": 400 }'
2. Get the image URL
{
"url": "https://api.starkrender.com/v1/image/uuid",
"id": "uuid"
}
Other language examples
// Node.js / browser fetch const res = await fetch('https://api.starkrender.com/v1/render', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ html: '<div style="...">Hello</div>', width: 1080, height: 1080, }), }); const { url } = await res.json();
import requests
response = requests.post(
"https://api.starkrender.com/v1/render",
headers={"x-api-key": "YOUR_API_KEY"},
json={
"html": "<div style='...'>Hello</div>",
"width": 1080,
"height": 1080,
},
)
url = response.json()["url"]
$ch = curl_init('https://api.starkrender.com/v1/render'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['x-api-key: YOUR_API_KEY', 'Content-Type: application/json'], CURLOPT_POSTFIELDS => json_encode(['html' => '...', 'width' => 1080, 'height' => 1080]), ]); $data = json_decode(curl_exec($ch), true); $url = $data['url'];
Base URL
https://api.starkrender.com
All endpoints accept Content-Type: application/json and return JSON. Generated files are hosted at https://api.starkrender.com/v1/image/{uuid} and are available for 30 days before automatic cleanup.
StarkRender