Error Handling
The API uses standard HTTP status codes and returns detailed error information in the response body.
Error Response Format
All errors follow this consistent format:
{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error description"
}
}Error Codes
| HTTP Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing API key |
| 403 | FORBIDDEN | API key does not have permission for this action |
| 404 | NOT_FOUND | Resource not found |
| 400 | BAD_REQUEST | Invalid request parameters |
| 429 | RATE_LIMITED | Rate limit exceeded |
| 500 | INTERNAL_ERROR | Internal server error |
401 Unauthorized
Missing or invalid API key. Make sure you're including the key in the Authorization header.
Example
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}400 Bad Request
Invalid request parameters. Check the parameter types and values.
Example
{
"error": {
"code": "BAD_REQUEST",
"message": "Invalid platform 'tiktok'. Valid platforms: x, reddit, github, requesthunt"
}
}429 Rate Limited
You've exceeded your rate limit. Wait for the reset time or upgrade your plan.
Example
{
"error": {
"code": "RATE_LIMITED",
"message": "Realtime rate limit exceeded (500/month). Resets on 2025-01-01."
}
}500 Internal Error
Something went wrong on our end. If this persists, please contact support.
Example
{
"error": {
"code": "INTERNAL_ERROR",
"message": "Failed to fetch requests"
}
}Handling Errors
Best practices for handling API errors:
- Always check the HTTP status code first
- Parse the
error.codefield for programmatic handling - Display
error.messageto users for context - Implement exponential backoff for 429 errors
- Log 500 errors and report if persistent