Error Handling

Our API uses standard HTTP response codes to indicate the success or failure of requests. Here are the common error codes you might encounter and how to handle them.

HTTP Status Codes
200 OK

The request was successful.

400 Bad Request

The request was invalid or cannot be served.

401 Unauthorized

Authentication failed or was not provided.

403 Forbidden

The request is understood but has been refused or access is not allowed.

404 Not Found

The requested resource could not be found.

429 Too Many Requests

You have exceeded the rate limit.

500 Internal Server Error

Something went wrong on our end.

Error Response Format
All error responses follow this format:
{
  "error": "error_code",
  "message": "Human-readable error message",
  "details": {}
}
Common Error Codes

invalid_api_key: The API key provided is invalid.

missing_api_key: No API key was provided.

invalid_ip: The IP address provided is invalid.

invalid_domain: The domain provided is invalid.

rate_limit_exceeded: You have exceeded your rate limit.

quota_exceeded: You have exceeded your monthly quota.

server_error: An internal server error occurred.

Error Handling Best Practices

Check status codes: Always check the HTTP status code before processing the response.

Handle rate limits: Implement proper backoff and retry logic for 429 errors.

Log errors: Log detailed error information for debugging.

Graceful degradation: Have fallback mechanisms when the API is unavailable.