w3f / staking-rewards-collector

Apache License 2.0
78 stars 32 forks source link

Warning: Throttled request by CoinGecko API #9

Closed jonasW3F closed 3 years ago

jonasW3F commented 3 years ago

There is a persistent issue, where the request limit does not properly reset, even after pausing the loop for more than enough time. I reached out to CoinGecko and ask if anything can be done on our side. If you are requesting a lot of price data (e.g., from 2019 for Kusama until today), consider increasing the timeLimit significantly.

In my experience putting it to 60 seconds (i.e., making 50 requests per minute instead of 100) should be sufficient.

jonasW3F commented 3 years ago

I checked with the support from CoinGecko and contrary to what they claim on their page I was told that the actual limit is "60/minute". I fix it in v1.2 and hope that this fixes this issue for good.

keorn commented 3 years ago

No need to spam for each day, you can get prices for the whole year with a single call using this method: /coins/{id}/market_chart/range

jonasW3F commented 3 years ago

No need to spam for each day, you can get prices for the whole year with a single call using this method: /coins/{id}/market_chart/range

Hi keorn! Thanks for the suggestion, I was looking for such a call before but must have missed it! Once I have time, I'll add that.

jonasW3F commented 3 years ago

Thanks for the hint, Peter ! I updated the API-Call and the usage of the tool is now much more enjoyable and faster. It is currently on the "change-API-call" branch and after some testing, I'll merge it.