Error Codes
Reference for all API error codes and how to handle them.
Error Response Format
All errors follow a consistent JSON format:
json
{
"success": false,
"error": {
"code": "INVALID_SYMBOL",
"message": "The symbol XYZ/ABC is not supported",
"status": 400
}
}
HTTP Status Codes
| Status | Meaning | Description |
|---|---|---|
200 |
OK | Request successful |
400 |
Bad Request | Invalid parameters or malformed request |
401 |
Unauthorized | Missing or invalid API credentials |
403 |
Forbidden | API key lacks permission for this resource |
404 |
Not Found | Resource not found |
429 |
Too Many Requests | Rate limit exceeded |
500 |
Internal Error | Server error - contact support |
503 |
Service Unavailable | API temporarily unavailable |
Error Codes Reference
Authentication Errors
MISSING_API_KEY |
401 |
X-API-Key header is missing |
MISSING_API_SECRET |
401 |
X-API-Secret header is missing |
INVALID_API_KEY |
401 |
API key is invalid or not found |
INVALID_API_SECRET |
401 |
API secret does not match |
API_KEY_DISABLED |
403 |
API key has been disabled |
API_KEY_EXPIRED |
403 |
API key has expired |
IP_NOT_ALLOWED |
403 |
Request IP not in whitelist |
Request Errors
INVALID_SYMBOL |
400 |
The requested symbol is not supported |
INVALID_TIMEFRAME |
400 |
Invalid timeframe parameter |
INVALID_DATE_RANGE |
400 |
Invalid from/to date range |
MISSING_PARAMETER |
400 |
Required parameter is missing |
INVALID_PARAMETER |
400 |
Parameter value is invalid |
Plan & Limit Errors
RATE_LIMIT_EXCEEDED |
429 |
API rate limit exceeded |
DAILY_LIMIT_EXCEEDED |
429 |
Daily API call limit exceeded |
PLAN_LIMIT_EXCEEDED |
403 |
Feature not available on your plan |
WEBSOCKET_NOT_ALLOWED |
403 |
WebSocket access requires paid plan |
HISTORICAL_NOT_ALLOWED |
403 |
Historical data requires paid plan |
Server Errors
INTERNAL_ERROR |
500 |
An unexpected error occurred |
SERVICE_UNAVAILABLE |
503 |
Service temporarily unavailable |
UPSTREAM_ERROR |
502 |
Error from upstream data provider |
Handling Errors
javascript
async function fetchQuote(symbol) {
try {
const response = await fetch(`https://api.pulse-markets.com/v1/quotes/${symbol}`, {
headers: {
'X-API-Key': API_KEY,
'X-API-Secret': API_SECRET
}
});
const data = await response.json();
if (!data.success) {
switch (data.error.code) {
case 'RATE_LIMIT_EXCEEDED':
// Wait and retry
await sleep(1000);
return fetchQuote(symbol);
case 'INVALID_SYMBOL':
console.error('Symbol not supported:', symbol);
break;
default:
console.error('API Error:', data.error.message);
}
return null;
}
return data.data;
} catch (err) {
console.error('Network error:', err);
return null;
}
}