Skip to main content
This page covers how errors are shaped and lists every code the API can return, with the endpoints that return it. Use it to decide what to branch on and what to retry.

The error envelope

Every error is JSON with one error object:
Error responses carry Content-Type: application/json; charset=utf-8 and Cache-Control: no-store. Errors after authentication also carry the rate-limit headers; 401 responses carry WWW-Authenticate: Bearer realm="routeur". Successful responses look different: results are wrapped in data, with graph_run on graph-derived responses and next_cursor or next_offset on paginated ones. See Conventions.

Every code

Only GET is served. Other methods on api.routeur.app are refused before they reach the API, with a non-JSON 403 body.

By endpoint

Every authenticated endpoint can return 401, 429 rate_limited, 429 daily_quota_exceeded, 504 timeout and 500 internal. The table lists what each group adds.

Observed examples

An MCP tool call for a missing market:

Handling errors

  • Branch on error.code, never on the message.
  • Treat 400 and 404 as bugs in the request or ids that no longer exist; do not retry them unchanged.
  • On 429, wait Retry-After seconds. On 503 and 500, wait a few seconds and retry once.
  • 504 timeout means the query was too wide for 15 seconds: narrow the window or the limit.
  • A market or event that returns 404 today can appear after the next hourly graph run, which reads the latest complete crawls.