Rate Limiting


The Crisalix API limits apps to a certain number of calls before resetting:

Customers exceeding either of those limits will receive error responses with a 429 response code.


How can I tell if I’m being rate limited?

The returned HTTP headers of any API request show your current rate limit status:

HTTP/1.1 200 OK X-RateLimit-Limit: 30000 X-RateLimit-Remaining: 29850 X-RateLimit-Reset: 1504742400

X-RateLimit-Limit The maximum number of requests you're permitted to make per hour.
X-RateLimit-Remaining The number of requests remaining in the current rate limit window.
X-RateLimit-Reset The time at which the current rate limit window resets in UTC epoch seconds.

If you need the time in a different format, any modern programming language can get the job done. For example, if you open up the console on your web browser, you can easily get the reset time as a JavaScript Date object.

new Date(1504742400 * 1000) => Thu Sep 07 2017 02:00:00 GMT+0200 (CEST)


How can I avoid getting rate limited?

Optimize your API responses:

Unoptimized API responses have very low rate limits. To increase this limit, make sure you are using our json filter.

Caching:

Store API responses locally, especially if you expect a lot of traffic. In general, don’t call the API on every page load. Instead, call the API independently and load from cache on each page load.

Scraping:

Don’t make a bunch of calls all at the same time. Spread them out over a longer period so it doesn’t look like you’re scraping.