D
D
Dmitry2021-12-15 03:42:09
Cryptocurrency
Dmitry, 2021-12-15 03:42:09

How to get the token exchange rate at the current moment in a Google spreadsheet?

How to get the exchange rate of a particular crypto coin or token in a cell in a Google spreadsheet at the current moment (with the possibility of updating at the entrance or on request?
Better using the CoinGecko or CoinMarketCape sites, if possible.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
idShura, 2021-12-15
@dimboltom

1. Understand the API
https://www.coingecko.com/en/api/documentation
Example:
Get a list of coins and find the id of the necessary cryptocurrencies
https://api.coingecko.com/api/v3/coins/list

[
    {
        "id": "01coin",
        "name": "01coin",
        "symbol": "zoc"
    },
    {
        "id": "bitcoin",
        "name": "Bitcoin",
        "symbol": "btc"
    }
]

An example of getting the Bitcoin exchange rate in rub and usd
https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=rub%2Cusd

2. Install ImportJSON in google sheets
ImportJSON
3. Import data
=ImportJSON("https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=rub%2Cusd"; "/bitcoin/usd";)

61b97696dea36789907526.png
Google sheets example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question