Errors
Rejected requests return JSON problem details (application/problem+json).
{ "type": "https://api.cotes.ai/problems/unauthorized", "title": "Unauthorized", "status": 401, "detail": "Missing or invalid API key."}type is a stable https://api.cotes.ai/problems/{slug} URI — match on it rather than on detail.
Common status codes
Section titled “Common status codes”| Status | type slug |
When |
|---|---|---|
401 |
unauthorized |
Missing or invalid API key |
404 |
not-found |
Unknown ticker, or no live contest for the series |
422 |
— | Missing or empty series — see below |
429 |
rate-limited |
Throttled — see Rate limits |
5xx |
— | Transient server error — retry with backoff |
Malformed requests
Section titled “Malformed requests”A missing or empty series, and any unknown path, are rejected before the API’s own error handling and come back as plain application/json in the framework’s shape — no type, no title:
{ "detail": [{ "type": "missing", "loc": ["query", "series"], "msg": "Field required" }] }Branch on the status code and the Content-Type rather than assuming every failure carries a type.
Successful responses are application/json. See the API reference for per-operation responses.