Error Response Format
Error Codes Reference
Authentication Errors
| Code | HTTP Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid API key |
PAYMENT_REQUIRED | 402 | Insufficient credits |
Request Errors
| Code | HTTP Status | Description |
|---|---|---|
BAD_REQUEST | 400 | Invalid request parameters |
NOT_FOUND | 404 | Resource not found |
RATE_LIMITED | 429 | Too many requests |
Server Errors
| Code | HTTP Status | Description |
|---|---|---|
SERVICE_UNAVAILABLE | 503 | Temporary service outage (circuit breaker) |
EXTERNAL_API_ERROR | 502 | External platform API error |
INTERNAL_SERVER_ERROR | 500 | Unexpected server error |
Handling Common Errors
Invalid API Key
Invalid API Key
Limit Exceeds Maximum
Limit Exceeds Maximum
limit parameter. Maximum varies by endpoint (typically 100 for posts, 500 for comments).Service Temporarily Unavailable
Service Temporarily Unavailable
External API Error
External API Error
Error Handling Examples
Best Practices
Always check success
Don’t assume the request succeeded
Log error codes
Track which errors occur most frequently
Implement retry logic
For transient errors like SERVICE_UNAVAILABLE
Use exponential backoff
Start with 1s, then 2s, 4s, etc.