Error Handling
The API uses standard HTTP status codes and returns structured error responses.Error response format
Error codes
400 Bad Request
| Code | Description | Fix |
|---|---|---|
VALIDATION_ERROR | Invalid parameters | Check required params like coin |
401 Unauthorized
| Code | Description | Fix |
|---|---|---|
UNAUTHORIZED | Missing or invalid API key | Check your X-API-Key header |
403 Forbidden
| Code | Description | Fix |
|---|---|---|
TIER_ACCESS_DENIED | Feature requires higher plan | Upgrade at polyhistorical.com/pricing |
404 Not Found
| Code | Description | Fix |
|---|---|---|
RESOURCE_NOT_FOUND | Market not found | Verify the slug exists via list markets |
429 Too Many Requests
| Code | Description | Fix |
|---|---|---|
RATE_LIMIT_EXCEEDED | Daily limit exceeded | Wait for reset or upgrade plan |
Retry-After header (seconds until reset).
See Rate Limits for details.
500 Internal Server Error
| Code | Description | Fix |
|---|---|---|
INTERNAL_ERROR | Unexpected server error | Retry after a moment. If persistent, contact support. |
Best practices
Check status codes first
Use the HTTP status code to determine the error category before parsing the body.
Implement retries for 429 and 5xx
Use exponential backoff. Respect the
Retry-After header for 429 responses.