POST
/api/v1/screenshotCapture HTML as an image
Render a raw HTML string as an image. No public URL needed. Useful for generating OG images, cards, and reports.
Set source=html and pass your HTML in the html parameter. Use POST to avoid query-string length limits. The browser renders the HTML at the given viewport and returns the image.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
source | string | required | Must be html. |
html | string | required | Raw HTML content to render (max 500 000 chars). |
viewport_width | integer | optional | Viewport width in pixels. Default: 1280. |
Code Examples
curl -X POST "https://screenshotcore.com/api/v1/screenshot" \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"source":"html","html":"<h1 style=\"font-family:sans-serif;padding:40px\">Hello World</h1>","viewport_width":800}' \
-o html-shot.pngResponse
(Raw PNG bytes, Content-Type: image/png)