/v1/screenshot endpoint
Full-page or above-the-fold PNG/JPEG via headless Chromium.
Language:
POST
/v1/screenshot
10 creditsRenders the page in headless Chromium at 1280px viewport width and captures a screenshot. Returns a CDN-hosted image URL valid for 24 hours.
Request body
| field | type | req | description |
|---|---|---|---|
url | string | yes | Full URL to screenshot. Must include protocol (https://). |
options.fullPage | boolean | no | Capture the full scrollable page. Default: false (viewport only). |
options.format | string | no | "png" or "jpeg". Default: "png". |
options.width | number | no | Viewport width in px. Default: 1280. Max: 1920. |
options.timeout | number | no | Timeout in ms. Default: 30000. Max: 60000. |
Example
curl -X POST https://contextforai.ashutoshswamy.in/v1/screenshot \
-H "Authorization: Bearer cfai_your_key_here" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'Response
200 OK
{
"url": "https://example.com",
"imageUrl": "https://contextforai.ashutoshswamy.in/screenshots/abc123.png",
"dimensions": { "width": 1280, "height": 800 },
"format": "png",
"fullPage": false,
"expiresAt": "2026-07-02T10:00:00Z",
"extractedAt": "2026-07-01T10:00:00Z"
}