What is API rate limiting and what are the benefits and impacts? Follow
An API, or application programming interface, is a way to send data or functionality back and forth between systems. Most users do not interact with APIs but benefit from data flow automation.
Companies like Splash use APIs to manage functionality such as RSVP of events, guests accessing events, etc. APIs also support integrations and send Splash data to other sources of truth, such as marketing automation platforms. APIs help to ensure that data arrives where it needs to on time and helps to avoid manual data manipulation and human errors.
For example, an API is like cars getting information from one place to another and riding along a highway or an API gateway. Only so much traffic can flow seamlessly at a given time. Too much traffic can slow down the system or never enter the highway at all, which is why it’s important to limit the rate and which data can flow between systems.
Rate limiting is a way to prevent excessive calls to the Splash API. It limits the number of HTTP requests that can be made in a given period of seconds, minutes, hours, days, and months.
For example: if the rate limit enforced by Splash API is 10 calls/second, the 11th call in the same second will be returned as a 429 error from Splash.
How does rate limiting work?
Splash will continue to limit all the concurrent traffic across our platform. If an API user is trying to send data at increased rates or there is too much traffic on the site, Splash will limit the API requests we can process.
For customers who are rate limited, you will receive a status of 429, and Splash will not process the initial request. As part of the 429 error, various pieces of information will be returned, such as:
API Response headers:
X-RateLimit-Limit-Second: 5
X-RateLimit-Remaining-Second: 4
X-RateLimit-Limit-Minute: 10
X-RateLimit-Remaining-Minute: 9
When a limit is reached, our API gateway will return an 429 status code, with the following JSON body:
{ "message": "API rate limit exceeded" }
Notes:
|
Why is rate limiting beneficial to you as a customer?
Utilizing rate limiting prevents customers from overloading Splash's resources which can cause the platform to underperform or fail. As a customer, you will experience increased platform stability and performance.
What do I need to know?
To prepare for API rate limiting, there are a couple of things you can do:
- Initiate retry logic to send the failed API calls back to Splash. The client code can listen to the API response code; if it’s a 429, it can retry the same request after X seconds.
- Consider using the value of X-RateLimit-Limit-{Second|Minute} from the API response header to determine when to retry the request.
- Implement rate limiting on your end to control the rate at which requests are sent to Splash.
For more information on the Splash API and current rate limits, please see the Splash API documentation.
Comments
0 comments
Please sign in to leave a comment.