Errors & handling

Errors use standard HTTP status codes with a consistent JSON body:

{ "error": "invalid_input", "detail": "start_urls is required", "actor": "website-content-crawler" }

Status codes

CodeMeaningWhat to do
400Bad/invalid inputCheck the actor's input schema (GET /v1/actors/{name}).
401Missing/invalid API keySend a valid X-API-Key.
403Key lacks access (tier/feature)Upgrade or enable the feature.
404Unknown actor or routeCheck the actor name.
422Input failed validationFix the field named in detail.
429Rate limitedBack off; honor the Retry-After header.
500Server errorRetry with backoff; if it persists, contact support.
502/504Upstream/source timeoutThe target site/API was slow — retry.

Handling pattern

r = requests.post(url, headers=headers, json=payload)
if r.status_code == 429:
    time.sleep(int(r.headers.get("Retry-After", 2)))
    r = requests.post(url, headers=headers, json=payload)
r.raise_for_status()
items = r.json()["items"]

A PARTIAL status means some sources failed but you still got usable items — always check status.