Errors
What each error means and when to retry.
All errors use the same JSON format:
{
"status": "Unprocessable Entity",
"errors": ["invalid tab, must be one of gainers, losers, fifty-two-week-high, fifty-two-week-low"]
}statusis the HTTP status text.errorsis a list of messages explaining what went wrong. Messages are usually strings. A few validation errors (for examplepage=0on news) return an object instead:
{
"status": "Unprocessable Entity",
"errors": [{ "field": "marketNewsQuery.Page", "tag": "min", "value": "1" }]
}Status codes
| Status | Meaning | What to do | Retry? |
|---|---|---|---|
200 | Success | Read data | – |
400 | Invalid request, for example an exchange other than NSE/BSE or a missing required parameter | Fix the request | No |
401 | Missing, invalid or revoked API key | Check your Authorization header and key | No |
403 | IP address not approved, or account disabled | Ask Finkhoz to approve your IP | No |
404 | Unknown endpoint, an unknown or private basket or trade idea, or no report for a basket | Check the path and ID | No |
422 | A parameter value is not allowed, for example an unknown tab or size above 100 | Use an allowed value (see the API reference) | No |
429 | Rate limit exceeded | Wait Retry-After seconds | Yes, after waiting |
502 | The data service is temporarily unavailable | Retry later | Yes, with backoff |
504 | The data service took too long to respond | Retry later | Yes, with backoff |
Retry with backoff means waiting longer after each failed attempt, for example 1, 2, then 4 seconds, and giving up after a few tries.
Empty results are not errors
If a stock token is unknown, analytics endpoints return 200 with an empty list:
{ "status": "success", "data": [] }Check that data is not empty before reading from it.
News endpoints are slightly different: an empty page leaves out data completely, so treat a
missing data as an empty list.
Getting help
When contacting Finkhoz about an error, include:
- the endpoint and parameters you called,
- the time of the request (with time zone),
- the full error response.
Never include your API key in support requests.