Description Usage Arguments Details Value
A function that stores the number of requests made to the API within a given time period. If the limit is reached then the code will stall until requests are free to query the API again successfully. The API is constrained to 1000 request per hour (default), or x calls per t time. So this function is checked each time before an endpoint is hit and waits a given time if no requests are remaining.
1 | request_limit(KEYS, requestsAllowed = 1000, timePeriod = 60 * 60)
|
requestsAllowed |
An integer value that defines the number of requests that can be made in a given time period (Default = 1000). |
timePeriod |
An integer value in seconds that defines the time period where 'requestsAllowed' API calls are allowed (Default = 60 * 60). |
Redis Keys used;
[KEY] :: requestLimit
Nothing. Redis is updated with the correct requestLimit values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.