What is throttling?
Throttling is the process if regulating the number of requests that are sent to a web service. This ensures the web service is not overwhelmed by the amount of requests that come in, which could result in the service going down - never a good thing.
Why should you care about this?
Understanding throttling is important if you want to connect to Skubana’s API and develop apps that help power your business. You and your developers need to be aware of just how much requests can be made to the API to avoid getting throttled.
Let’s get technical!
First off, familiarize yourself with the following:
- Request - any call you make to the API to either fetch or update data.
- Maximum Request quota - The number of requests that you can submit at one time without throttling. The request quota decreases with each request you submit, and increases at the restore rate.
- Restore rate (also called the recovery rate) - The rate at which your request quota increases over time, up to the maximum request quota.
- Hourly request quota - The maximum number of requests you can submit per hour.
Imagine the following use case:
Your shiny new app connects to the Skubana API to request inventory updates. The GET Inventory endpoint has a restore rate of 5 / 1000ms and an hourly request quota of 360. This means your app can make 5 requests initially, then a wait time of 1 second is required before you can send a new request, you can then make a total of 360 requests within the hour before you get throttled. This limit resets on the next hour.