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

StatusCodeWhen
400missing_queryquery was empty or absent.
400unknown_formatformat is not one of the six.
400unknown_columncolumns names a field that does not exist.
400format_not_availablecsv, 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}.
400per_page_too_largeper_page above your plan's row limit. The limit is in the error.
400page_too_deeppage × per_page past your plan's row limit: a plan covers the first N rows of a query. The limit is in the error.
400invalid_jsonThe POST body is not valid JSON.
400missing_sourceCreating a cluster needs query or domains.
400ambiguous_sourceBoth query and domains were sent.
400missing_domainsdomains held no usable name.
400domains_not_foundNone of the names in domains is in the index; no cluster is created.
400invalid_operationoperation is not and, or or diff.
400invalid_clustersclusters must list two or more ids, exactly two for diff.
400missing_nameRenaming needs a non-empty name.
400missing_regexExtraction needs regex or presets.
400invalid_regexAn expression is not a PCRE in slashes or pipes, up to 200 characters, flags imsu.
400too_many_regexMore than ten expressions, presets included.
400unknown_presetA preset name that does not exist; the answer lists them.
401missing_keyNo Authorization: Bearer header.
401invalid_keyThe key does not name an account.
403plan_requiredThe account has no paid plan.
404unknown_endpointNo such path. The known ones are listed in the error.
404cluster_not_foundNo cluster with that id on this account.
405method_not_allowedUse GET, or POST a JSON body; changes to clusters take POST.
409cluster_limitThe account already keeps the most clusters it can, 100; delete some first.
429too_many_requestsArriving faster than ten requests per minute (API and MCP together).
429quota_exceededThe day's search allowance is spent.
429snippet_quota_exceededThe day's snippet allowance is spent. Searching without snippets still works.
429extract_quota_exceededThe day's extraction points are spent.
503unavailableSignatures are temporarily unavailable. Try again later.

What to do about each

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