Screenshot Capture

Capture any webpage as a PNG or JPEG image with customizable viewport settings.

GET/v1/screenshot

Renders a webpage in a headless browser and returns a screenshot. Supports custom viewport dimensions, full-page capture, and wait-until strategies for dynamic content.

Authentication

Requires x-api-key header.

Parameters

NameTypeRequiredDefaultDescription
urlstringYes-The URL of the webpage to capture.
formatstringNopngOutput format: png or jpeg.
widthintegerNo1280Viewport width in pixels (320-3840).
heightintegerNo720Viewport height in pixels (240-2160).
full_pagebooleanNofalseCapture the full scrollable page.
qualityintegerNo80JPEG quality (1-100). Ignored for PNG.
delayintegerNo0Wait N milliseconds after page load before capturing (0-10000).

Example Request

-blue-400 font-semibold">curl -X GET -emerald--amber-400">400">"https://api.aicores.io/v1/screenshot?url=https://example.com&width=-amber-400">1440&height=-amber-400">900&format=png" \
  -H -emerald--amber-400">400">"x-api-key: sk_live_your_key_here" \
  --output screenshot.png

Response

Returns the screenshot as binary image data with the appropriate Content-Type header (image/png or image/jpeg).

Error Codes

StatusErrorDescription
400invalid_urlThe URL is missing, malformed, or uses an unsupported protocol.
400invalid_dimensionsWidth or height is outside the allowed range.
401unauthorizedMissing or invalid API key.
408timeoutThe page did not load within 30 seconds.
429rate_limit_exceededToo many requests.