Skip to Content
PredictorSDK

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"
}
  • code is the stable, machine-readable reason, such as invalid_identifier, market_not_found, ambiguous_identifier or rate_limited. Branch on it. message is for people and may change. The Error Handling guide lists every code.
  • param names the query or path parameter at fault. errors lists 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 error member is gone. Read code, or message for display. A 409 keeps candidates, and a 402 keeps action, required_tier and current_tier.
  • A repeated or empty parameter is a 400 on every route. GET /v1/markets?provider= returned the whole catalogue, and a repeated filter kept only its first value. The matching lookups event_id and source_id may still be repeated.
  • Identifier mistakes say what is wrong. A provider prefix that names no provider (polymarkt:3871438) is a 400 listing the providers, where it was probed as a slug and answered 404. A composite ID that contradicts ?platform= says so, and a key sent without the Bearer scheme 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.