Skip to main content

Envelope

Every error has the same JSON shape:
  • error.code is stable: use it in your code.
  • error.message is written for humans and can change.
  • Some codes add fields next to code (see the table).
  • billed is always false: errors never use a request.
  • Some errors also carry usage and the X-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:
  1. IP rate limit (too_many_requests)
  2. Key in the URL (api_key_in_url)
  3. Key (missing_api_key, invalid_api_key), account (account_suspended), plan (plan_required)
  4. Module slug (unknown_module)
  5. format (unsupported_format)
  6. Body size and JSON (body_too_large, invalid_json)
  7. Fields (invalid_input)
  8. Account limits (rate_limited)
  9. Module in plan (module_locked), then daily quota (quota_exceeded)
  10. The search itself (upstream_error)

Other responses

  • A method the endpoint does not support (for example GET /api/v1/search/phonebook or POST /api/v1/usage) returns 405 Method Not Allowed without the JSON envelope.
  • 204 No Content is not an error: it is an empty result with ?format=txt. See Raw files and text output.