API limits
API call limit
There are limits to the number of API calls that your application can make against a particular Hike store.
5 calls per second
100 calls per minute
2,000 calls per hour
10,000 calls per day
All four apply at once, and a call has to fit within every one of them.
How calls are counted
- Per store and user. Limits are counted against the store and the user your access token acts on behalf of, not against your IP address. Two stores using your app each have their own allowance.
- Fixed windows. Each window starts with the first call made in it and lasts its full length: a second, a minute, an hour or a day. It does not slide forward with each call.
- Refused calls still count. A call that is turned away still uses up the longer windows. Continuing to send requests after a refusal spends your hourly and daily allowance without doing any work.
When you exceed a limit
You will receive an HTTP 429 (Too Many Requests) response.
The Retry-After header tells you how many seconds to wait before the window that refused you resets:
HTTP/1.1 429 Too Many Requests
Retry-After: 37
Content-Type: application/json
The response body names the limit you reached:
{
"result": null,
"targetUrl": null,
"success": false,
"error": {
"code": 429,
"message": "Rate limit exceeded: this integration may make at most 100 per minute. Retry in 37 seconds.",
"details": null,
"validationErrors": null
},
"unAuthorizedRequest": false,
"__abp": true
}
When more than one limit is exceeded at the same time, the message names the shortest one.
If you encounter a limit, do not continue to make requests. Wait at least the number of seconds in
Retry-After, then resume. The most common limit to reach is the per-second one, which a job looping
through a catalogue as fast as it can will hit long before the others.
Staying within the limits
- Space requests out. Queue calls and send them steadily rather than in parallel bursts.
- Ask for larger pages. One call with a larger
page_sizecosts a fraction of several calls with a small one. See Pagination. - Sync only what changed. Most list endpoints accept
Sync_From, so a scheduled job can read the records changed since its last run instead of the whole catalogue.
Request size limit
A single POST to any of the Hike APIs has a size limit of 4MB. There is no limit to the number of elements within a request, provided the overall request size does not exceed 4MB. However, to ensure you receive a timely response from our APIs, we recommend you look to batch elements in bundles of up to 50.