Error Handling

Web Data

The 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 statusMeaningReturned by
200Synchronous 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
201Webhook subscription was created.Create webhook
202Async extraction, batch, or crawl job was accepted, or a running job cancellation was accepted.Extract (async), create batch, create crawl, cancel batch, cancel crawl
204Webhook subscription was deleted.Delete webhook
400Invalid request.Extract, map
401API key is missing or invalid.All authenticated endpoints
402Billing 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
403The 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)
404Job, webhook, or other requested resource was not found.Get job, get batch/crawl status, cancel batch/crawl, webhook get/update/delete/deliveries
408Map request timed out during URL discovery.Map
409Batch or crawl job cannot be cancelled in its current state.Cancel batch, cancel crawl
422Validation error or extraction failed.Extract (body validation and extraction errors), create batch, create crawl, create/update webhook
429Request throttled or work concurrency limit reached.Extract, create batch, create crawl, map
500Internal server error.Extract, map, webhook create/get/update/delete/list/deliveries
502Billing service returned an upstream error. Retryable depends on the billing error.Extract, map, create crawl
503Service or billing service temporarily unavailable.Extract, map, create batch, create crawl
504Synchronous 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:

Statusdetails.reasonWhat to do
402INSUFFICIENT_FUNDSTop up your balance.
402SUBSCRIPTION_INACTIVERenew your subscription.
402API_TOKEN_SPEND_CAP_REACHEDThis API key reached its spend cap. Wait for the cap to reset, or raise it.
403API_TOKEN_SCOPE_MISSINGThis API key is not allowed to make this request. Use a key with the right permissions.
403ACCOUNT_RESTRICTEDThe 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_LIMITED
  • WORK_CONCURRENCY_LIMITED
  • WORK_CONCURRENCY_LEASE_EXPIRED
  • TEMPORARY_BLOCK
  • NETWORK_ERROR
  • CAPTCHA_CHALLENGE
  • PERMANENT_BLOCK
  • INVALID_URL
  • INVALID_WAIT_FOR_SELECTOR
  • WAIT_FOR_SELECTOR_TIMEOUT
  • UNPROCESSABLE_CONTENT
  • AUTH_REQUIRED
  • TIMEOUT
  • CANCELLED
  • PAYMENT_REQUIRED
  • INTERNAL_ERROR
  • PROXY_ERROR
  • TARGET_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

CodeMeaning
UNPROCESSABLE_CONTENTThe 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_CHALLENGEReserved. Challenge pages currently come back as UNPROCESSABLE_CONTENT.
TIMEOUTA 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.
CANCELLEDThe 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?

On this page