I am trying to get the most recently added coin added to Coingecko. Any ideas which API to use or how to achieve this.
Ideally I am trying to get this in near realtime.
Thanks
I am trying to get the most recently added coin added to Coingecko. Any ideas which API to use or how to achieve this.
Ideally I am trying to get this in near realtime.
Thanks
You can read the name of the latest coins directly from https://www.coingecko.com/en/coins/recently_added and then use CoinGecko API to search info by name.
In Python:
import requests
# get all coins listed on CoinGecko
coins = requests.get('https://api.coingecko.com/api/v3/coins/list').json()
# extract the name of the latest coins
r = requests.get('https://www.coingecko.com/it/monete/recently_added')
for line in r.text.splitlines():
if '<td class="py-0 coin-name" data-sort=' in line:
name = line[len('<td class="py-0 coin-name" data-sort=')+1:-2]
print(name)
# then search coin in the list retrieved above
for coin in coins:
if coin['name'] == name:
r = requests.get('https://api.coingecko.com/api/v3/coins/'+coin['id'])
print(r.json())
I don't think Coingecko provides a direct API to retrieve recently added coins. For your development purposes, you can definitely try web scraping.