next-game-solutions / geckor

An R client for the public CoinGecko API
https://next-game-solutions.github.io/geckor/
Other
26 stars 9 forks source link

Adjust tests and examples to the current API rate limit #45

Closed next-game-solutions closed 1 year ago

next-game-solutions commented 1 year ago

Problem: The number of calls to the free version of the CoinGecko API has recently been significantly reduced: from ca. 50 calls/min to only 10-30 calls/min. This causes tests and examples in the documentation to fail (at build time) with the HTTP status of 429. Another reason why tests started failing on CRAN is because CRAN changed their policy towards the \donttest command in documentation - by default, examples that are wrapped in \donttest are in fact tested.

Solution: Use the @examplesIf in documentation (instead of the standard @examples), in combination with a non-public function that checks if the API rate is exceeded. Also, update the documentation accordingly (i.e. warn the users about the very limited number of calls they can now make with the free version of the API).