Every error has one shape with a stable code
Error responses on every route carry a machine-readable code, a message, the parameter at fault, and every problem in the request; repeated and empty parameters are rejected everywhere.
BreakingNew
An error used to be {"error": "...", "status_code": N}, and error held a short phrase on some routes (market not found), a Title-Case phrase on others (Invalid platform), and a full sentence on matching. A client could tell one cause from another only by matching prose. Every route now answers with one shape:
{
"code": "invalid_parameter",
"message": "invalid limit \"500\": limit must be <= 100",
"status_code": 400,
"param": "limit"
}codeis the stable, machine-readable reason, such asinvalid_identifier,market_not_found,ambiguous_identifierorrate_limited. Branch on it.messageis for people and may change. The Error Handling guide lists every code.paramnames the query or path parameter at fault.errorslists every problem when a request has several: a lookup batch with three bad identifiers now names all three, where it named only the first.- The
errormember is gone. Readcode, ormessagefor display. A409keepscandidates, and a402keepsaction,required_tierandcurrent_tier. - A repeated or empty parameter is a
400on every route.GET /v1/markets?provider=returned the whole catalogue, and a repeated filter kept only its first value. The matching lookupsevent_idandsource_idmay still be repeated. - Identifier mistakes say what is wrong. A provider prefix that names no provider (
polymarkt:3871438) is a400listing the providers, where it was probed as a slug and answered404. A composite ID that contradicts?platform=says so, and a key sent without theBearerscheme is told how to send it.
SDK 0.22.0 types the new body. Older SDKs still raise the typed error for each status, but the Python client fails to parse the new body, because it requires error, and raises a ParsingError that carries the status code and body instead.