Closed shivaslifzz closed 3 years ago
@shivaslifzz
CoWIN's api rate limit is 100 per five minute for an IP. You need to ensure you don't pass more than that. Each district and each pin contribute to an API call.
Example: Lets say i am searching for 2 pincode. At refresh rate of 5sec, my total requests in 5 min would be 120. [ I will get blocked ] At refresh rate of 6sec, my total requests in 5 min would be 100. [ I may get blocked when there are OTP calls] At refresh rate of 7sec, my total requests in 5 min would be 85. [ GOOD ]
Formula: 5 x 60 x refresh rate / no of api calls
Calculate your API calls and you should be good. If you are using Pincode based search, use option 3 as it will save your calls.
Also, if you are cowin/umang/arogya setu is open in on same network (by you or your family on same or different device) that impacts this.
I will add a fix to show the error message.
@6mxo89sqh @bombardier-gif I guess issue is not with the no of API calls why because I ran the same code with two different refresh frequencies 30,13 seconds both of them are blocked after 10mins , I guess they might added the duration as well apart from the API calls please check
@shivaslifzz I will check. In mean time, can u check option 3 ( search by district n filter by pincode) if that is increasing the time from 10 minutes to something else?
@shivaslifzz Yup, you are correct. they are raising 429 after 10 minutes of usage. I have added code to forcefully expire the token in 10 minutes. Can you plz check?
@6mxo89sqh I am checking it now
@6mxo89sqh Bro now it's working fine
Thanks @shivaslifzz for confirming that it works for you now.
@bombardier-gif After every 10 mins the centers are not refreshed for next 5 mins or untill the new otp comes back
currently my refresh_frequency is 30 seconds