Get an API Key Demo

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.

EndpointDescription
POST /v1/renderRender HTML or a saved template into PNG/JPG
POST /v1/render/fullPremium Chromium render with external CSS injection (plans $49+)
POST /v1/render/fastUltra-fast render (~50ms) — pure HTML/CSS only, no JS
POST /v1/render/batchRender up to 25 HTML templates in parallel in a single request
POST /v1/screenshotOpen a public URL and capture a screenshot
POST /v1/pdfConvert HTML into a downloadable PDF
POST /v1/templateSave 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.

HTTP Header
x-api-key: YOUR_API_KEY
ℹ️
Get your API key in the dashboard under API Keys.

SDKs

Official SDKs wrap the REST API with typed methods — no manual fetch or requests needed.

Node.js

npm
npm install starkrender
JavaScript
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
pip install starkrender
Python
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
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

JSON Response
{
  "url": "https://api.starkrender.com/v1/image/uuid",
  "id":  "uuid"
}

Other language examples

JavaScript
// 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();
Python
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"]
PHP
$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

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.

On This Page
Overview Authentication SDKs Quick Start Base URL