POST/api/snapshot3 credits

Get HTML + screenshot in a single call.

Request body

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

Options

OptionTypeDescription
fullPagebooleanFull-page screenshot. Default: true.
widthnumberViewport width. Default: 1440.
heightnumberViewport height. Default: 900.
waitForSelectorstringWait for a CSS selector.
waitUntilstring"networkidle0", "networkidle2", "load", "domcontentloaded". Default: "networkidle0".

Example request

curl -X POST https://crawlapi.dev/api/snapshot \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"url":"https://example.com"}'

Example response

{
"success": true,
"data": {
"url": "https://example.com",
"screenshot": {
"url": "https://cdn.crawlapi.dev/screenshots/abc123.png",
"size": "145.2 KB"
},
"html": "<!doctype html>...",
"htmlLength": 1256,
"meta": {
"title": "Example Domain",
"description": null
}
},
"credits_used": 3,
"credits_remaining": 497
}

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