Errors
Every failure has the same shape and a stable code. Branch on the
code - the message is written for people and may be reworded.
{ "error": { "code": "invalid_key",
"message": "That API key does not exist: it is mistyped, was deleted in the profile or was revoked. Keys: https://publicwww.com/profile/api" } }
Some errors carry extra fields alongside those two: parameter for
the one that was wrong, retry_after for how long to wait,
limit and used for a spent quota, max for
the largest value allowed, resets_at for when extraction points return.
Every code
| Status | Code | When |
|---|---|---|
| 400 | missing_query | query was empty or absent. |
| 400 | unknown_format | format is not one of the six. |
| 400 | unknown_column | columns names a field that does not exist. |
| 400 | format_not_available | csv, tsv or txt where it does not fit. They fit search results; also csv on /v1/clusters/{id}/extract and txt on /v1/clusters/{id}. |
| 400 | per_page_too_large | per_page above your plan's row limit. The limit is in the error. |
| 400 | page_too_deep | page × per_page past your plan's row limit: a plan covers the first N rows of a query. The limit is in the error. |
| 400 | invalid_json | The POST body is not valid JSON. |
| 400 | missing_source | Creating a cluster needs query or domains. |
| 400 | ambiguous_source | Both query and domains were sent. |
| 400 | missing_domains | domains held no usable name. |
| 400 | domains_not_found | None of the names in domains is in the index; no cluster is created. |
| 400 | invalid_operation | operation is not and, or or diff. |
| 400 | invalid_clusters | clusters must list two or more ids, exactly two for diff. |
| 400 | missing_name | Renaming needs a non-empty name. |
| 400 | missing_regex | Extraction needs regex or presets. |
| 400 | invalid_regex | An expression is not a PCRE in slashes or pipes, up to 200 characters, flags imsu. |
| 400 | too_many_regex | More than ten expressions, presets included. |
| 400 | unknown_preset | A preset name that does not exist; the answer lists them. |
| 401 | missing_key | No Authorization: Bearer header. |
| 401 | invalid_key | The key does not name an account. |
| 403 | plan_required | The account has no paid plan. |
| 404 | unknown_endpoint | No such path. The known ones are listed in the error. |
| 404 | cluster_not_found | No cluster with that id on this account. |
| 405 | method_not_allowed | Use GET, or POST a JSON body; changes to clusters take POST. |
| 409 | cluster_limit | The account already keeps the most clusters it can, 100; delete some first. |
| 429 | too_many_requests | Arriving faster than ten requests per minute (API and MCP together). |
| 429 | quota_exceeded | The day's search allowance is spent. |
| 429 | snippet_quota_exceeded | The day's snippet allowance is spent. Searching without snippets still works. |
| 429 | extract_quota_exceeded | The day's extraction points are spent. |
| 503 | unavailable | Signatures are temporarily unavailable. Try again later. |
What to do about each
- 400 - your request is wrong and repeating it will not help. The
parameterfield says which one. - 401, 403 - your key or your plan. Not worth retrying until something changes.
- 429
too_many_requests- sleepretry_afterseconds and repeat. Nothing was consumed. - 429
quota_exceeded- the allowance returns at the next UTC midnight;retry_aftersays how far off that is. Retrying sooner will not help. - 5xx - ours. Retry with a widening delay.
Errors and formats
Errors come back as JSON, or as XML when format=xml was asked for.
The flat formats have no shape for an error, so a failed request that asked for
csv gets JSON - which means a client reading CSV should check the
status code rather than assume every 200-shaped body is rows.
Reading the codes without reading this page
GET / lists every code above, with its meaning, as JSON. It needs
no key, so a client can be built against the whole set without anyone opening a
browser.
curl https://api.publicwww.com/Next Clusters