POST/api/screenshot2 credits

Take a full-page PNG screenshot. Uploaded to CDN.

Request body

FieldTypeDescription
urlstringRequired. The URL to process.
optionsobjectOptional configuration (see below).

Options

OptionTypeDescription
fullPagebooleanCapture full scrollable page. Default: true.
widthnumberViewport width in px. Default: 1440.
heightnumberViewport height in px. Default: 900.
omitBackgroundbooleanTransparent background. Default: false.
waitForSelectorstringWait for a CSS selector before capturing.
delaynumberExtra delay in ms (max 5000) before capture.
waitUntilstring"networkidle0", "networkidle2", "load", "domcontentloaded". Default: "networkidle0".

Example request

curl -X POST https://crawlapi.dev/api/screenshot \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"url":"https://example.com","options":{"fullPage":true,"width":1280}}'

Example response

{
"success": true,
"data": {
"url": "https://cdn.crawlapi.dev/screenshots/abc123.png",
"sourceUrl": "https://example.com",
"width": 1280,
"height": 900,
"fullPage": true,
"size": "145.2 KB"
},
"credits_used": 2,
"credits_remaining": 498
}

Error codes

StatusMeaning
400Missing or invalid URL / bad options
401Missing or invalid API key
403Insufficient credits
405Wrong HTTP method (use POST)
429Rate limit exceeded (60/min)
500Server error