How to deal with rate limit of API calls


#1

Hi, I am just getting started with bolt. In my application I have to read the status of the GPIO-Input pin for every one second and if there is any change in status I have to say glow an LED.

I am using python to program for the same and everything worked well until I came to know about the API rate limit. My program stopped working and I got the following mail.

Hi,

Unfortunately, we have to rate limit your API access due to a large number of requests received from your account.

You have crossed the allowed threshold of 200 hits in last 6 minute(s).

API requests for your account will be enabled in next: 6 Hours:0 Minutes:0 Seconds

Now how am I suppose to deal with it? Is there another way to check the status of the Input pin without using the API call using python script? Please guide me on this.

Thanks.


#2

Hi @mailtoaswinth,

Please go through the following docs page to know how the Bolt Cloud decides whether your API has to be rate limited or not.

You can then decide on a polling frequency which would not get rate limited by the system.

I would suggest using the API call once every 2 seconds. This speed is neither too slow for your purpose, nor is it so fast that the Bolt Cloud will limit the calls.

Also, with this rate, of polling you will still have the ability to use the API calls for other non-polling related requirements.