Errors
ChartInspect API status codes, common error fields, and safe retry behavior.
REST failures return JSON with an error message. Most also include success: false and may add structured context such as validChains, availableMetrics, currentTier, sourceStatus, or upgradeUrl. Do not require every endpoint to return an identical error object.
#Status Codes
| Status | Meaning | Retry? |
|---|---|---|
400 | A parameter is malformed, out of range, or unsupported | Fix the request |
401 | The API key is missing, invalid, or expired | Fix or rotate credentials |
403 | The key is valid but lacks the required tier, permission, field, endpoint, or IP grant | Change access policy |
404 | The endpoint, metric, resolution, or requested data window does not exist | Change the request |
409 | A chart exists but has no certified public data contract | Use a catalog-listed dataset |
429 | An hourly or daily quota was exceeded | Retry after reset |
500 | An unexpected server error occurred | Retry with backoff |
502 | A required upstream data source failed or returned invalid data | Retry with backoff |
#Example
json
{
"success": false,
"error": "Resolution \"min10\" not available for metric \"example\".",
"requestedResolution": "min10",
"availableResolutions": ["day1"]
}#Handling Errors
javascript
const response = await fetch(url, { headers: { "x-api-key": apiKey } });
const contentType = response.headers.get("content-type") || "";
const body = contentType.includes("application/json")
? await response.json()
: await response.text();
if (response.status === 429 || response.status >= 500) {
// Retry later with exponential backoff and jitter.
} else if (!response.ok) {
// Log the status and structured error, then fix credentials or parameters.
}Use exact IDs returned by discovery, validate date strings as YYYY-MM-DD, and check the resolution matrix before requesting sub-day data.
Was this page helpful?