Endpoints#

POST /render#

Render HTML or a URL to an image.

Request Body#

ParameterTypeRequiredDescription
htmlstringYes*HTML content to render (max 500KB)
urlstringYes*URL to screenshot (max 2048 chars)
cssstringNoCSS styles to inject (max 200KB)
selectorstringNoCSS selector to capture specific element
widthnumberNoViewport width in pixels (1-4096, default: 1200)
heightnumberNoViewport height in pixels (1-4096, default: 800)
formatstringNo"png", "jpeg", or "webp" (default: "png")
qualitynumberNoImage quality 0-100 (for jpeg/webp)
deviceScaleFactornumberNoDevice scale factor 0.5-4 (default: 1)
fullPagebooleanNoCapture full scrollable page
backgroundstringNo"transparent" or "white" (default: "white")
googleFontsstring[]NoGoogle Fonts to load (max 20)
timeoutMsnumberNoRender timeout 100-60000ms (default: 5000)
responseFormatstringNo"url" or "base64" (default: "url")
cachebooleanNoEnable duplicate detection cache (default: true)

| templateId | string | Yes* | Render a saved template by ID | | variables | object | No | Key-value pairs for template placeholders |

*Exactly one of html, url, or templateId is required.

URL Screenshots#

Capture a screenshot of any public URL:

{
  "url": "https://example.com",
  "width": 1280,
  "height": 720
}

DOM Selector Targeting#

Screenshot a specific element using a CSS selector:

{
  "html": "<div id='card'>...</div>",
  "selector": "#card"
}

The selector can be used with both HTML and URL modes.

Base64 Response#

Get the image data directly in the response instead of a URL:

{
  "html": "<h1>Hello</h1>",
  "responseFormat": "base64"
}

Response:

{
  "id": "abc123",
  "base64": "iVBORw0KGgo...",
  "mimeType": "image/png"
}

Template Rendering#

Render a saved template with dynamic variables:

{
  "templateId": "your_template_id",
  "variables": {
    "title": "My Blog Post",
    "author": "Jane Smith",
    "date": "Jan 2026"
  }
}

Templates use {{variableName}} placeholders in HTML/CSS that get replaced with the provided values. Create and manage templates in the dashboard.

Duplicate Detection#

By default, identical render requests return cached results. This saves compute and provides faster responses. Disable with cache: false if you need fresh renders.

When a cached result is returned, the response includes cached: true:

{
  "id": "abc123",
  "url": "https://...",
  "imageKey": "abc123.png",
  "cached": true
}

GET /images/:id#

Retrieve a stored image by ID.

Images are cached for 24 hours. After rendering, you'll receive an image ID that can be used to fetch the image without re-rendering.