Error Handling
Web DataThe Scraper API returns standard HTTP status codes and JSON error bodies. Handle both validation errors and extraction errors in your client, because a request can fail before extraction starts or after the API tries to process the target page.
HTTP Status Codes
| HTTP status | Meaning | Returned by |
|---|---|---|
200 | Synchronous extraction, map request, job lookup, statistics request, webhook lookup, or health check succeeded. | Extract (sync), map, get job, get batch/crawl status, list jobs, statistics, webhook get/list, health |
201 | Webhook subscription was created. | Create webhook |
202 | Async extraction, batch, or crawl job was accepted, or a running job cancellation was accepted. | Extract (async), create batch, create crawl, cancel batch, cancel crawl |
204 | Webhook subscription was deleted. | Delete webhook |
400 | Invalid request. | Extract, map |
401 | API key is missing or invalid. | All authenticated endpoints |
402 | Billing refused the request: no balance, no active subscription, or the API key's spend cap is reached. See Billing Refusals. | Extract, map, search, create batch, create crawl |
403 | The target is on Geonode's compliance blocklist: nothing was sent to it and nothing is charged. Or billing does not allow this API key; see Billing Refusals. | Extract, map (blocklist); any authenticated endpoint (billing) |
404 | Job, webhook, or other requested resource was not found. | Get job, get batch/crawl status, cancel batch/crawl, webhook get/update/delete/deliveries |
408 | Map request timed out during URL discovery. | Map |
409 | Batch or crawl job cannot be cancelled in its current state. | Cancel batch, cancel crawl |
422 | Validation error or extraction failed. | Extract (body validation and extraction errors), create batch, create crawl, create/update webhook |
429 | Request throttled or work concurrency limit reached. | Extract, create batch, create crawl, map |
500 | Internal server error. | Extract, map, webhook create/get/update/delete/list/deliveries |
502 | Billing service returned an upstream error. Retryable depends on the billing error. | Extract, map, create crawl |
503 | Service or billing service temporarily unavailable. | Extract, map, create batch, create crawl |
504 | Synchronous extraction ran out of time: the request's timeout or the 140-second limit. Not charged. Retryable. | Extract (sync) |
Billing Refusals
When billing refuses a request, the API answers 402 or 403, and details.reason says why:
| Status | details.reason | What to do |
|---|---|---|
402 | INSUFFICIENT_FUNDS | Top up your balance. |
402 | SUBSCRIPTION_INACTIVE | Renew your subscription. |
402 | API_TOKEN_SPEND_CAP_REACHED | This API key reached its spend cap. Wait for the cap to reset, or raise it. |
403 | API_TOKEN_SCOPE_MISSING | This API key is not allowed to make this request. Use a key with the right permissions. |
403 | ACCOUNT_RESTRICTED | The account is restricted. Contact support. |
{
"code": "PAYMENT_REQUIRED",
"message": "This API key has reached its spend cap",
"correlation_id": "3f2b8c1e-5d4a-4e7b-9c61-2a8f0d7e4b19",
"retryable": false,
"details": {
"reason": "API_TOKEN_SPEND_CAP_REACHED"
}
}details can carry more fields from billing, such as when a limit resets. If details is empty, message says why.
Retrying does not help: the answer stays the same until the account changes. If billing refuses while a batch or crawl is running, the job stops.
Validation Error
Validation errors can return a detail array. This usually means the request body does not match the expected schema, such as an invalid URL or unsupported value.
{
"detail": [
{
"type": "value_error",
"loc": ["body", "url"],
"msg": "Value error, URL must contain a valid hostname.",
"input": "not-a-url"
}
]
}Extraction Error
Extraction failures return an error object and tokens_charged.
{
"error": {
"code": "UNPROCESSABLE_CONTENT",
"message": "The target page could not be extracted.",
"retryable": false,
"details": null
},
"tokens_charged": 0
}The response field is currently named tokens_charged in the API schema. In Scraper API docs and billing language, treat this value as the number of requests charged.
Extraction Error Codes
Extraction error codes include:
RATE_LIMITEDWORK_CONCURRENCY_LIMITEDWORK_CONCURRENCY_LEASE_EXPIREDTEMPORARY_BLOCKNETWORK_ERRORCAPTCHA_CHALLENGEPERMANENT_BLOCKINVALID_URLINVALID_WAIT_FOR_SELECTORWAIT_FOR_SELECTOR_TIMEOUTUNPROCESSABLE_CONTENTAUTH_REQUIREDTIMEOUTCANCELLEDPAYMENT_REQUIREDINTERNAL_ERRORPROXY_ERRORTARGET_BLOCKED
Use the retryable field to decide whether a retry may help. For retryable failures, use exponential backoff and avoid retrying in a tight loop.
What Some Codes Mean
| Code | Meaning |
|---|---|
UNPROCESSABLE_CONTENT | The site answered, but not with the page content. Usually this is a Cloudflare or similar challenge that could not be passed, and the message names the detected challenge. It is also returned for an empty page, a file download, or a target that cannot be served at all (then retryable is false). |
CAPTCHA_CHALLENGE | Reserved. Challenge pages currently come back as UNPROCESSABLE_CONTENT. |
TIMEOUT | A sync request ran out of time: its timeout or the 140-second limit. Returned with 504 and not charged. For slow pages, use async mode. |
CANCELLED | The client disconnected before a sync request finished. Not charged. |
Check tokens_charged in the error response to see what was charged.
The OpenAPI schema includes 429 responses, but no public numeric rate limit is specified in the current contract. If you receive 429, slow down the client and retry after a delay.
Was this page helpful?