Appearance
Errors & Rate Limits
Error format
json
{ "detail": "Human-readable error message" }Validation errors (422) return a structured array:
json
{
"detail": [
{
"loc": ["query", "window_hours"],
"msg": "value is not a valid integer",
"type": "type_error.integer"
}
]
}HTTP status codes
| Code | Name | When |
|---|---|---|
200 | OK | Successful response |
400 | Bad Request | Unknown product_key or invalid parameter |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | Valid key, method not permitted |
422 | Unprocessable Entity | Query parameter type or range violation |
429 | Too Many Requests | Rate limited |
500 | Internal Server Error | Oracle computation failure |
502 | Bad Gateway | Upstream data source error |
503 | Service Unavailable | Database unreachable |
Rate limits
Developer pricing routes share a rate-limit bucket. Limits are enforced per IP.
Handling 429s
Use exponential backoff:
python
import time
import httpx
def fetch_with_retry(url: str, headers: dict, max_retries: int = 5) -> dict:
delay = 1.0
for attempt in range(max_retries):
r = httpx.get(url, headers=headers)
if r.status_code == 429:
time.sleep(delay)
delay *= 2
continue
r.raise_for_status()
return r.json()
raise RuntimeError("max retries exceeded")Common issues
401 - missing API key
bash
curl https://api.coda-tech.net/api/v1/developer/pricing/some-product-key
# returns 401Add -H "X-API-Key: your_key" to the request.
400 - unknown product key
Product keys follow the pattern {game}-{set_code}-{card-name-slug}. Verify the key exists in the catalog before retrying.
422 - parameter out of range
Keep window_hours between 1 and 72, and outlier_stddevs between 1 and 10.
503 - database unreachable
Transient issue. Retry with backoff. If it persists, contact andrew@coda-tech.co.
