Limits, errors and versions
Call limit
Section titled “Call limit”Each access key can make 60 calls a minute. Every answer says where you stand:
| Header | What it says |
|---|---|
RateLimit-Limit |
The limit per minute: 60. |
RateLimit-Remaining |
The calls you have left in this minute. |
RateLimit-Reset |
In how many seconds the next minute starts. |
Past the limit the API answers 429 with the code rate_limited and the Retry-After header: the seconds to wait before trying again. To know when a search finishes, use a webhook instead of asking often.
Apart from that, starting searches has the usual limits: your plan’s, your tokens and the key’s token cap per call.
Errors
Section titled “Errors”An error answers with its HTTP status and this body:
{ "error": { "code": "not_ready", "message": "This search has no report yet (status: running)." } }Branch on code: it is stable and does not change. message is for people, is in English and may change. invalid_request also carries issues, naming the field that failed.
| Code | HTTP | What it means |
|---|---|---|
invalid_request | 400 | A parameter or a field is missing or not valid; issues names it. |
unauthorized | 401 | No access key, or one that is unknown or revoked. |
insufficient_tokens | 402 | The account does not have the tokens this needs. |
plan_limit | 403 | The account's plan does not include this (the API itself is part of Agency and above). |
forbidden | 403 | The access key may not do |
this | 403 | it is read-only, or the amount is above its token cap per call. |
not_found | 404 | No such thing in the access key's account. |
not_ready | 409 | The search has not finished yet. |
rate_limited | 429 | More than 60 requests in a minute with one access key; Retry-After says when to try again. |
internal | 500 | Something went wrong on our side. |
unavailable | 503 | Searches are closed, or a platform is paused by Sentir right now. |
An id of another account answers not_found, the same as one that does not exist.
Versions
Section titled “Versions”- The version is in the address:
/api/v1. - Inside a version things are only added: new routes, new fields in answers, new optional fields in what you send. Your code should ignore fields it does not know.
- A breaking change comes only in a new version (
/api/v2). - A version is announced as deprecated six months before it stops working, in the Changelog and by email to the accounts that use it.