Status Codes
Just Serp API uses both HTTP status codes and a business logic code in the JSON response to indicate the outcome of an API request.
Status Code Table
| Scenario | HTTP Status | Business Code | Credits Charged |
|---|---|---|---|
| Success | 200 | 200 | ✅ Yes |
| Invalid Parameters | 200 | 400 | ❌ No |
| Invalid API Key | 401 | 401 | ❌ No |
| Insufficient Credits | 200 | 402 | ❌ No |
| Resource Not Found | 200 | 404 | ❌ No |
| Rate Limit Exceeded | 200 | 429 | ❌ No |
| Internal Server Error | 500 | 500 | ❌ No |
Handling Errors
When an error occurs, the API returns a JSON object containing the business code and a message to help you diagnose the issue.
Error Response Example
json
{
"code": 401,
"message": "X-API-Key is missing. Please set X-API-Key header."
}We recommend implementing retry logic for 500 errors with exponential backoff.
