0

I am trying to get some data from coingecko. In the first request fetching list of 100 biggest currencies. In following requests I want to fetch some detailed info about the biggest currencies. Unfortunately already for the second request I am receiving the too many requests error. I am able to make another successful request after a few minutes but with this pace it would take hours to get info about all the big currencies. I am using rapidapi.com that is recommended by coingecko website.

I used a copy of the code from documentation e.g.:

import requests

url = "https://coingecko.p.rapidapi.com/coins/%7Bid%7D"

querystring = {"localization":"true","tickers":"true","market_data":"true","community_data":"true","developer_data":"true","sparkline":"false"}

headers = {
    'x-rapidapi-host': "coingecko.p.rapidapi.com",
    'x-rapidapi-key': "mykey"
    }

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)

Am I doing anything wrong? Thanks a lot in advance.

Emil Haas
  • 484
  • 3
  • 17

2 Answers2

2

The CoinGecko API is completely free on RapidAPI and has a rate limit of 50 calls/minute.

It should be working fine now. Give it another go. I have tested this API on RapidAPI, and I'm getting the expected response.

Pratham
  • 497
  • 3
  • 7
1

Actually I was just misled by rapidapi.com article. Actually it is better to go directly via coingecko api. You can find more info at https://www.coingecko.com/en/api/documentation

Emil Haas
  • 484
  • 3
  • 17