Getting started
Errors
Errors use normal HTTP status codes and a JSON body with a stable code and a readable message. Requests that fail never cost credits.
Error format
The body always has error.code, which your code can rely on, error.message, which you can show to people, and charged: false.
Error codes
| Status | Code | Meaning |
|---|---|---|
| 400 | missing_query | The q parameter is missing. |
| 400 | query_too_long | The q parameter is longer than 2,048 characters. |
| 400 | invalid_response_type | response_type is not json, html or both. |
| 400 | invalid_pingback_url | pingback_url is not a public http or https address. |
| 401 | missing_api_key | No API key was sent. |
| 401 | invalid_api_key | The API key is wrong or was replaced. |
| 403 | account_disabled | The account is disabled. Contact support. |
| 404 | task_not_found | No task with this id in your account, or it is older than 7 days. |
| 429 | concurrency_limit_reached | Too many requests at the same time for your plan. Retry after Retry-After seconds. |
| 429 | hourly_limit_reached | Too many requests in this hour on the Free plan. |
| 429 | quota_exceeded | Not enough credits left for this request. |
| 429 | spend_limit_reached | Usage charges reached the monthly spend limit you set. |
| 429 | queue_full | 10,000 of your async searches are already waiting or running. |
| 429 | too_many_attempts | Too many calls to a free endpoint in a short time. Wait a minute. |
| 502 | upstream_error | The search failed on our side. Retry in a moment. |
| 503 | upstream_unavailable | All search workers are busy. Retry in a few seconds. |
| 503 | api_paused | The API is paused for maintenance. Retry after Retry-After seconds. |
| 504 | upstream_timeout | The search took too long. Retry in a moment. |
When to retry
429withRetry-After: wait that many seconds, then send the request again.502,503and504: retry after a moment. Nothing was charged.400,401,403and404: fix the request first; sending it again gives the same answer.
Queued searches retry failed searches for you, up to 3 times (see Async tasks).