/v1/screenshot endpoint

Full-page or above-the-fold PNG/JPEG via headless Chromium.

Language:
POST

/v1/screenshot

10 credits

Renders 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

fieldtypereqdescription
urlstringyesFull URL to screenshot. Must include protocol (https://).
options.fullPagebooleannoCapture the full scrollable page. Default: false (viewport only).
options.formatstringno"png" or "jpeg". Default: "png".
options.widthnumbernoViewport width in px. Default: 1280. Max: 1920.
options.timeoutnumbernoTimeout 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"
}
← Full API reference: authentication, errors, rate limits, billing