Errors
Failures return a non-2xx status and a consistent JSON body.
Error format
{
"error": {
"code": "insufficient_credits",
"message": "Not enough credits. This request costs 5."
},
"meta": { "request_id": "req_…", "credits_charged": 0 }
}Branch on error.code; the message is for humans and may change.
Error codes
| Status | Code | Meaning | Charged? |
|---|---|---|---|
| 400 | invalid_parameter | A parameter is missing, unknown or invalid. The message says which. | No |
| 401 | invalid_api_key | The key is missing, wrong or revoked. | No |
| 402 | insufficient_credits | Your balance is lower than the price of this request. | No |
| 404 | not_found | The endpoint or the requested profile or item does not exist. | No |
| 429 | rate_limited | Too many requests. Wait for Retry-After seconds. | No |
| 502 | upstream_error | The data source failed. Retry later. | No |
| 503 | unavailable | Temporarily unavailable or the source is not configured. | No |
Retrying safely
- Retry
429,502and503with exponential backoff. - Do not retry
400,401,402or404without changing something. - Requests are read-only, so retrying is always safe, and failed attempts cost nothing.