Too many requests
In short:
I am wondering what is your policy regarding Too Many Requests ?
- Is there a maximum
Too Many Requestsallowed per hour/day/week? - Do you ban IP if you detect
Too Many Requests? If yes, for how long?
The long story
I am using the BME680 sensor from Bosch with their library . This sensor/library only allows measurement every 3 seconds or every 5 min. 5 min is too long for my needs so I am left with the 3 seconds intervals.
Each time I retrieve a measurement, I send the data to my box on opensensemap but at this frequency, I get many (many) 429 Too Many Requests.
I don't mind if not all my measurement are saved on opensensemap. If I get 80% it's fine. But I do not want to get banned (even temporarily) from opensensemap if you detect too many Too Many Requests.
I am sending the data as JSON-Array on ingress.opensensemap.org/boxes/:senseBoxId/data (so I've already bundled all the values of a measurement like temperature, pression, humidity... in one request)
Hi @MagTun
to start, the way you're sending (JSON-Array) is the right way!
The current limit is 15 requests in a 15 minutes window.
If you could change your code to collect measurements and send multiple measurement cycles at once. This would require you to collect the measurement timestamps on your device. Just include these timestamps with the field createdAt in your requests
The current limit is 15 requests in a 15 minutes window!? How is it possible that I was able to get this (the measurement were sent separately)?

Hi @MagTun
the current limit is 15 requests in one minute.
Ok that makes sense! So that's one every 4 seconds. I just found a way to delay my request so I am not anymore tied to the BME680 timing. Just to satisfy my curiosity : if I make a mistake and send a request every 1 or 2 seconds, do you ban the IP? if yes, for how long?
Thanks for clarification @mpfeil :) Maybe you could fill us in on how long the IP is being blocked?
The IP will not be blocked. But all excessive requests will be blocked. Might change this in the future if people abuse this.
We usually send one request per minute but nevertheless sometimes get 429 Too Many Requests. This happens after 502 Bad Gateway or ConnectionRefused, probably because our server tries to resend what it couldn't be send before.
This happens every few days or so. E.g. today 3:22 (Vienna) there was a connection refused and then plenty of 429 Too Many Requests.
Is it possible that there are server issues on your end sometimes refusing a few API requests? (The 429 Too Many Requests is probably only a side-effect, due to retries.)
Issue on our side is https://github.com/ElektraInitiative/opensesame/issues/116