Skip to content

Fetch cryptodata into google-sheets for free from either Coingecko or Coinpaprika. Enjoy!

License

Notifications You must be signed in to change notification settings

Pedrojok01/Import-CryptoData-into-GoogleSheet

Repository files navigation

Import CryptoData into GoogleSheet

Contributors Forks Stargazers Issues MIT License LinkedIn



Looking for an easy way to import crypto data into your google sheet?

Fetch cryptodata direclty into your Google sheets from either Coingecko or Coinpaprika APIs for free. Enjoy!


Table of contents


Update March 2023:

  • Both script have been cleaned, refactored and optimized. The performance should be better now.
  • I highly recommend using the coinpaprika script, as the free CoinGecko API is too crowded and is getting hard to refresh, unless you only need some of the big coins.

General info?

In order to go soft on those 2 great and free API, the script fetch all data at once in a dedicated tab in your spreadsheet.
You can then simply import any data you need into your coinfolio/project by using this function: CRYPTODATA("symbol"; "data").


Which one do I need?

The CoinGecko API import the first 750 coins by marketcap. However, prices are only quoted in USD (all coins within the first 750, but less data).
The CoinPaprika APi import all coins listed on coinpaprika.com, and prices are quoted in USD, BTC, or ETH. However, I found out that many coins were missing from their great API (more data, but some coins missing).

Notes:
1/ As of now, you can only use one script at a time. So depending on what you need, you can either pick the Coingecko.gs or Coinpaprika.gs.
2/ The performance isn't great and it takes a little time to refresh, but it's free to use and it goes soft on both API (which hopefully will stay free a bit longer).


Setup

  • Open your crypto spreadsheet, and create an additional empty tab named data;
  • Go to the menu Add-ons > Script Apps;
  • Paste the content of the file scriptCoinGecko.gs or scriptCoinPaprika.gs into the editor, then save the file;
  • Go back to your spreadsheet and refresh the page;
  • A new menu item called CoinGecko or CoinPaprika depending on the one you chose should appear. Click on it, then click on Update;
  • All the data will be imported into your data tab. From now on, you can import any data with this simple: =CRYPTODATA("coin_sympol", "data_needed")

❗ Do not use the data sheet, it's used by the script ❗


Additional explanations

For the coingecko script:

=CRYPTODATA("btc", "current_price") => Will get btc price quoted in usd;
Feel free to explore the data tab to find the data you need. Just copy the column title and paste it in the formula above.

For the coinpaprika script:

Get data for a specific coin :

=CRYPTODATA("ETH"; "btc_price") => Will get eth price quoted in btc;

Get historical data for a specific coin :

=CRYPTODATAHISTORY("<coin>"; "<date>"; "<type of data>"; "<quote>") with params being :

  • coin : a single coin ticket like "ETH" or "BTC" or "XMR"
  • date : something like "2018-02-20"
  • type of data : can be "price", "volume_24h" or "market_cap"
  • quote : optional, defaults to usd, but can be set to "usd" or "btc"

Get global data :

=CRYPTODATAGLOBAL("bitcoin_dominance_percentage")


Update data

  • Click on the menu item, then on Update to refresh the data;
  • Then, you need to refresh your spreadsheet. One simple way is to add a new line at the top of your sheet, and to delete it right away. This small change will refresh all data automatically.

Any issues, improvements, forks are welcomed. It is certainly not optimized, but it's working :)


If you like it, a donation is always welcome!

btc_qrcode

BTC: bc1pgud5lk850jrk7ty3kyzazntwdnnl6xrnm2wm5trdz7myfkhccglskqmgdk

Releases

No releases published

Packages

No packages published