Envelope
Every error has the same JSON shape:error.codeis stable: use it in your code.error.messageis written for humans and can change.- Some codes add fields next to
code(see the table). billedis alwaysfalse: errors never use a request.- Some errors also carry
usageand theX-Quota-*headers (see Billing and quotas).
Error codes
upstream_status is the HTTP status the search service returned when it returned one (400 or above), otherwise null. On upstream_error, billed is false because the request is refunded.
Field errors
invalid_input lists one message per field. Unknown fields are listed too (up to 10), with the accepted field names:
Order of checks
A search is checked in this order, and the first failure is returned:- IP rate limit (
too_many_requests) - Key in the URL (
api_key_in_url) - Key (
missing_api_key,invalid_api_key), account (account_suspended), plan (plan_required) - Module slug (
unknown_module) format(unsupported_format)- Body size and JSON (
body_too_large,invalid_json) - Fields (
invalid_input) - Account limits (
rate_limited) - Module in plan (
module_locked), then daily quota (quota_exceeded) - The search itself (
upstream_error)
Other responses
- A method the endpoint does not support (for example
GET /api/v1/search/phonebookorPOST /api/v1/usage) returns405 Method Not Allowedwithout the JSON envelope. 204 No Contentis not an error: it is an empty result with?format=txt. See Raw files and text output.