Patent ID: 8681630

Claim:
A computer-implemented method for rate limiting application programming interface (API) requests, comprising: (a) receiving, at an API server, an API request from a developer application; (b) determining a number of tokens needed to process the API request based on a first rate configured in predefined policy data for the developer application and a first replenish rate of a first token bucket to rate limit API requests from the developer application, the number of tokens inversely corresponding to the first rate configured in the predefined policy data; in response to receipt of the API request: (c) reducing a number of tokens in the first token bucket for the developer application by the number of tokens needed to process the API request determined in (b); and (d) if the number of tokens in the first token bucket for the developer application exceeds the number of tokens needed to process the API request determined in (b), processing the API request to return a response to the API request to the developer application, whereby the developer application is rate limited according to the first rate configured in the predefined policy data by determining a number of tokens needed to process the API request, wherein the first rate configured in the predefined policy data specifies a number of API requests allowed from the developer application for a first time period, and the first token bucket tracks the API requests from the developer application in the first time period; and (e) repeating steps (b)-(c) for a rate configured in the predefined policy data that specifies a number of API requests allowed from the developer application for a second time period different from the first time period, and for a second token bucket that tracks the API requests from the developer application in the second time period.