Screenshot Capture
Capture any webpage as a PNG or JPEG image with customizable viewport settings.
GET
/v1/screenshotRenders 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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | Yes | - | The URL of the webpage to capture. |
| format | string | No | png | Output format: png or jpeg. |
| width | integer | No | 1280 | Viewport width in pixels (320-3840). |
| height | integer | No | 720 | Viewport height in pixels (240-2160). |
| full_page | boolean | No | false | Capture the full scrollable page. |
| quality | integer | No | 80 | JPEG quality (1-100). Ignored for PNG. |
| delay | integer | No | 0 | Wait 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.pngResponse
Returns the screenshot as binary image data with the appropriate Content-Type header (image/png or image/jpeg).
Error Codes
| Status | Error | Description |
|---|---|---|
| 400 | invalid_url | The URL is missing, malformed, or uses an unsupported protocol. |
| 400 | invalid_dimensions | Width or height is outside the allowed range. |
| 401 | unauthorized | Missing or invalid API key. |
| 408 | timeout | The page did not load within 30 seconds. |
| 429 | rate_limit_exceeded | Too many requests. |