Import CoinGecko Cryptocurrency Data into Google Sheets


With over 4,800 cryptocurrencies and over 330 exchanges tracked, CoinGecko has one of the most comprehensive cryptocurrency databases in the world. We have received several requests for our data to be made available on Google Sheets.

This is a simple 3 step guide to get your portfolio the most updated price, market capitalization, trading volume and all the other information that you will need in your spreadsheet.

Step 1: Add an ImportJSON script to your Google Sheets

In your Google Sheets, go to the tools section and select “<> Script editor”. Once the script editor is open, replace all the existing code with the following code:

* Imports JSON data to your spreadsheet
* @param url URL of your JSON data as string
* @param xpath simplified xpath as string
* @customfunction
function IMPORTJSON(url,xpath){

// /rates/EUR
var res = UrlFetchApp.fetch(url);
var content = res.getContentText();
var json = JSON.parse(content);

var patharray = xpath.split(".");

for(var i=0;i<patharray.length;i++){
json = json[patharray[i]];


if(typeof(json) === "undefined"){
return "Node Not Available";
} else if(typeof(json) === "object"){
var tempArr = [];

for(var obj in json){
return tempArr;
} else if(typeof(json) !== "object") {
return json;
return "Error getting data"; 

Save the code and rename it as “ImportJSON”. Close the script editor and return to your spreadsheet.

Step 2: Find the API endpoint you need

CoinGecko offers a comprehensive set of crypto data in our CoinGecko API. For this exercise, we will be using the /coins/list endpoint to identify the api ID of the specific coins and /coins/markets endpoint to obtain the market data.

To obtain the price of Bitcoin, the /coins/markets endpoint would be:

Step 3: Import data using ImportJSON formula and CoinGecko API

The ImportJSON formula:

=ImportJSON (“[API URL]”,”[JsonPath]”

If you are unfamiliar with JsonPath implementation, you can refer to JsonPath’s github which includes comprehensive explanation on JsonPath. Combining the ImportJSON formula and CoinGecko API, you will get the desired data. Below are examples of the formula to obtain Bitcoin data.

Bitcoin price:


Bitcoin market capitalization:


Bitcoin 24 hours volume:


Bitcoin All Time High price:


Bitcoin circulating supply:


Bitcoin historical price on 30th May 2019, 00:00 UTC:


Bitcoin historical market capitalization on 30th May 2019, 00:00 UTC:


Bitcoin historical 24 hours volume on 30th May 2019, 00:00 UTC:


Using the ImportJSON formula and CoinGecko API, you can easily obtain all the information that you need for your cryptocurrency watchlist or portfolio tracking in Google Sheets. There are other CoinGecko API endpoints available as well which you are free to experiment with.

Here is a sample of our completed Google Sheets for the most popular cryptocurrencies. Feel free to make a copy and modify it for your own use!

Updated 17 August 2020: Some of you prefer seeing your favorite coins in a different manner. We have added a new template to our Google Sheets template. Here is a preview which you can make a copy and edit further.

Additionally, we frequently get questions about the API ID for many tokens. You may refer to this Google Sheets to see the API ID associated with each token listed on CoinGecko, sorted in alphabetically order.

If you would like to import data into Microsoft Excel, Cryptosheets may be a tool that you may use to query CoinGecko’s data.

Share on twitter
Share on telegram
Share on facebook
Share on linkedin
Share on email

96 thoughts on “Import CoinGecko Cryptocurrency Data into Google Sheets”

    1. I have tried this


      But, the response was:
      Error getting data

  1. Hello,
    I was wonder if I could do this in a more efficient way. For example If I’m tracking 100 coins then when I load my spreadsheet I’m doing 100 API calls. Is there a way to do one API call that will go into a tab and I can reference that info for the rest of the spreadsheet info. I’m only pulling the price of the coins.

        1. Yes, you need to pull from the coins/markets api. so for btc and eth you would enter:

          You can enter as many currencies as you want. Then when you import its only 1 call. The easiest way is to use the tools here to look up the correct names of the coins in the database and enter them:
          Use the get coins and search for the correct name to enter in the markets call. some names are old or different from what you would expect

        2. Did someone find a solution. I am also having the same issue. It keeps making several hundreds of calls and many of them fail to load data in the end. I want to be able to make one call download all the data and play with it. Will just keep downloading fresh data at defined intervals

  2. Thanks for sharing this article! Article is nice. very informative.

    If you want to hire top rated Crypto Developers for Develope ICO development, STO development, IEO development, real estate tokenization, art tokenization, stable coin development, crowd funding platform, local Bitcoin clone, crypto payment development. We are a team of professional blockchain developers.


  3. Putin’s Personal Trader Exposes How To Turn $10 To $100K
    Renegade Russian Analyst Reveals How To Turn $10 To $100K
    Have you seen this viral video?
    The Cryptocurrency Institute have released a video show casing the methods a Putin’s Cryptocurrency Traders uses to generate 10,000% ROI!
    [Click here to watch this before it’s taken down]
    This is shocking.
    I didn’t believe this myself until I saw it.
    See for yourself.
    It will blow you away.

  4. What happened to the CoinGecko Google Sheets Add-On? I was using it happily for many months, and today it just vanished without trace from my cryptotracking G-Sheet, and there’s no sign of it in the G-Suite Marketplace. Made it super-easy to include price data, without having to include an ImportJSON script!

    1. Same here. I was using this function: =COINGECKO(“BTC/USD”)
      It’s been working for many months and I now get a message saying that this is an unknown function.
      CoinGecko, can you tell us what’s going on?

  5. Gecko team, are you going to fix the add-on?
    Regarding the Jason script, how often the price will refresh – =importJSON(“”,”0.current_price”)?

    1. im also trying to find a way to make it refresh from itself but its not working, if u find the answer please let met know

    2. I got this reply from the support team.

      “The API price is updated on average is 2 minutes. As for google sheet, you’ll need to update it manually or create a script to update it automatically.”

      And currently there’s no reference script for us to write the automatic price update.

  6. I don’t think the CoinGecko Google Sheets Add-On was made by the CoinGecko team — it appears to be a completely separate project:

    A real shame, as it made it super-easy to use the CoinGecko API!

    My guess is that it stopped working due to the CoinGecko API being changed, since the sample Google Sheet linked to in this article also doesn’t work any more, either (prices are from 2019).

  7. Ignore my comment above — seems like the Coingecko Add-On *was* an official Coingecko preoduct after all.

    Which makes it’s disappearance from the Google Marketplace even more mysterious!

    Anyone know how to edit the script in the sample GSheet refresh the values? They’re stuck at 25 September 2019!

  8. How do you get the script to refresh? The data doesn’t change unless I open the script editor and click ‘save’… I have a button with assigned script to run the function IMPORTJSON and although it appears to run the script, the data doesn’t update. Can anyone help?

  9. Same problem here. I was using the Coingecko ADD-ON in my Google Sheet, but it’s not working anymore. Can’t find the add-on anywhere.

    Now my whole Google Sheet is not able to display prices. The function =COINGECKO(“BTC/USD”) was really useful, but now it’s missing.

    If anyone knows an alternative, please let us know.

  10. Great, I was able to import the current price of the coin I’m interested in.

    But now I noticed that the price doesn’t update. I’ve tried waiting, refreshing the web page, and completely closing out of the page and reloading. The only way I can get it to update is to redo the formula in the cell(ie copy/paste) This is kind of redundant and the whole reason I wanted the data pulled from the site in the first place. So that I didn’t have to do any more copy and pasting.

    Am I missing something?

    1. If you’re using the Cryptosheets add-on in Google or Excel try these:

      Just BTC dominance:
      (Excel) =CS.QUERYA(“CoinGecko”,”Global”,”_path”,”data.market_cap_percentage”,”_fields”,”btc”)
      (Googlesheets) =CSQUERYA(“CoinGecko”,”Global”,”_path”,”data.market_cap_percentage”,”_fields”,”btc”)

      >> List of Top 10 Market Cap w/ Dominance (%) for Each
      (Excel) =TRANSPOSE(CS.QUERYA(“CoinGecko”,”Global”,”_path”,”data.market_cap_percentage”))
      (Googlesheets) =TRANSPOSE(CSQUERYA(“CoinGecko”,”Global”,”_path”,”data.market_cap_percentage”))

  11. why do some coins you get “error getting data”, and others don’t? I know some don’t have a data on the website, like M Cap, but still happens to some that do?

  12. I’m running the script to run the function IMPORTJSON: what name do I use to retrieve the price for Bitcoin SV? I’ve tried:
    Bitcoin SV

  13. If anyone is having trouble refreshing their rates in Google Sheets you can add an additional parameter that references any cell and that cell can be used to trigger a query of the API.

    Ex. =importJSON(“”,”0.current_price”,A1)

    Now all you need to do is update the A1 cell (any value should work) and it will trigger any API calls that include this cell as an additional parameter.

  14. What is happening with this GoCrypto (GOC)? I invested in it through Hotbit. The same day hotbit is not showing it, the value is going up. What should I do? Now is showing:

    1 GOC/ETH $0.02093902 1.97% $38 $82 $30
    0.38% about 1 hour ago
    2 TokensNet TokensNet GOC/ETH $0.01942893 – – – $7,698
    96.54% Recently –
    3 GOC/BCH $0.02075875 1.5% $609 $94
    2.88% Recently


  15. Is there a way to reference the ID from a specific cell? For example the formula: =importJSON(“”,”0.current_price”)

    The above references the actual ID in the formula itself (“bitcoin”) where as I want the formula to reference a specific cell where the ID is i.e A1 for example. And then drag that down for 100 coins so I can get the price for 100 coins/IDs by having the formula reference A1,A2,A3,A4 etc. rather than having to manually type in the ID “bitcoin”, “ethereum”, “polkadot” into the formula each time?

    1. If you use the Cryptosheets add-on for Googlesheets, these formulas should work and give you exactly what you’re looking for:

      =CSQUERYA(“CoinGecko”,”Simple Price”,”ids”,”bitcoin”,”vs_currencies”,”usd”)

      =CSQUERYA(“CoinGecko”,”Simple Price”,”ids”,A1,”vs_currencies”,A2)
      *where A1 = bitcoin and A2 = usd

    2. Nick, did you find a solution to your questions.

      I’ve been trying for the last couple of hours w/o any solution in sight.

      My approach: I’ve created the whole input for importjson in a cell. However when I do importjson(D2). Assume D2 has necessary string to fetch data for bitcoin, it doesn’t work.

      An online search tells me indirect function could be of help, but still, I’m not able to make it work.

      did anyone make it work?

  16. Hi CoinGecko Spreadsheet Users!

    I have some great news for all of you and some simple, free solutions to try right now that can resolve basically every recent question/comment on this blog post!

    We have been working with the CoinGecko team to fully integrate the entire Coingecko API into the Cryptosheets Excel & Googlesheets add-ons (see below for instructions to get your exclusive CoinGecko user discount!)

    – All CoinGecko API endpoints are fully integrated, parameterized and searchable inside Excel & Googlesheets using the Cryptosheets add-on
    – Send data directly to your sheets through the side panel query builder and API console
    – Pull data into any cells in your sheets using simple, familiar formulas then refresh them live or at any interval you want
    – Try pre configured sample queries/formulas and explore dedicated support resources, tutorials, videos & quick start templates for every single endpoint

    TIP: just copy + paste the formulas into your spreadsheet… it’s that easy

    >> Googlesheets
    =CSQUERYA(“CoinGecko”,”Coins Markets”,”vs_currency”,”usd”)
    =CSQUERYA(“CoinGecko”,”Coins Markets”,”vs_currency”,”usd”,”_fields”,”symbol,total_supply,current_price,market_cap”)
    =CSQUERYA(“CoinGecko”,”Simple Price”,”ids”,”bitcoin”,”vs_currencies”,”usd”)
    =CSQUERYA(“CoinGecko”,”Simple Price”,”ids”,A1,”vs_currencies”,A2) –> where A1 = bitcoin and A2 = usd

    =CSQUERYA(“CoinGecko”,”Coins Market Chart”,”vs_currency”,”usd”,”days”,”14″,”id”,”bitcoin”)

    >> Microsoft Excel
    =CS.QUERYA(“CoinGecko”,”Coins Markets”,”vs_currency”,”usd”)
    =CS.QUERYA(“CoinGecko”,”Coins Markets”,”vs_currency”,”usd”,”_fields”,”symbol,total_supply,current_price,market_cap”)
    =CS.QUERYA(“CoinGecko”,”Simple Price”,”ids”,”bitcoin”,”vs_currencies”,”usd”)
    =CS.QUERYA(“CoinGecko”,”Simple Price”,”ids”,A1,”vs_currencies”,A2) –> where A1 = bitcoin and A2 = usd

    =CS.QUERYA(“CoinGecko”,”Coins Market Chart”,”vs_currency”,”usd”,”days”,”14″,”id”,”bitcoin”)

    Cryptosheets WebApp:
    Cryptosheets Docs Portal:


    Help Center:
    YouTube: (Cryptosheets/CoinGecko playlist) :

    1. Check the settings > candy > rewards section in your CoinGecko user profile/settings

    2. MAKE SURE to visit the CoinGecko/Cryptosheets referral page:
    – Enter your email to automatically get a 25% discount if/whenever you upgrade to a paid Cryptosheets subscription!

    3. Install the Microsoft & Google approved add-ons directly from the add-on stores:
    – Googlesheets:
    – Excel:

    4. Explore the Cryptosheets platform and use/access CoinGecko data for free –> starting RIGHT NOW!

  17. Hi is there a way to download a time series into google sheet?
    Tried this:


    and all i got is a series of running numbers. any experts?

  18. This is so painful. I just want to code the API myself without depending on any third party add on’s. Why can’t I download all the symbol data in one shot and then use json to parse and read values. IT IS SO INEFFICIENT TO USE URL FOR EACH VALUE MAKING THOUSANDS TO INDIVIDUAL CALLS.

      1. Hi unlikely, what would be the xpath to use with this url? Im trying to get a list of the top 500 cryptocurrencies by marketcap and i have the url already but what xpath do i need to finish the importJSON formula?
        Thanks so much!

  19. Thanks, man.
    Not sure why with importjson I get the message – error getting data.

    Is it happening with others? Any workaround?


  20. Thanks for article. I try to get historical data for many coins and in some cells get “Error getting data”. How can I get historical data without errors?

  21. Hi,
    (and thank you for this great job!)

    I would like to know how the changes concerning the token list are going:
    the procedure does not look automated in case of swap/modif/etc…

    I take the example of the Aave-end today : on CoinGecko, there is the [new] Aave “symb:AAVE” and the [old] Aave “symb:LEND”
    when we use the old ‘ethlend’ ID it redirects us to the [old] and I didn’t see any trace of the new ID in the list for the API.

    Beyond this example (even if I’m very interested in the new Aave ID 😉 ), I’d like to know how the list of this API is updated, because we all know that in the world of cryptos this kind of case is more than frequent…

    Thank you for enlightening me,

  22. Why when i try this it doesn’t work i get a “error getting data” ?


  23. how is =importjson(“”,”0.current_price”)
    the Synthetix price? I can’t find all the price URLs meaning for OMG for example or verge, I have BTC and ETH working just fine. the other ones get an error. I initially thought that SNX would be something like =importjson(“”,”0.current_price”)

  24. Hi…How can we extract data from JSON for a certain time range, like from 1 Dec 2020 to 20 Dec 2020. Kindly help. Thnx.

  25. Any idea how to get this ETH/USD price…
    …to be replaced with the ETH/BTC price? Thx.

  26. Finding “Error getting data” for stats after coming back to the spreadsheet. Worked fine earlier today.

    Anyone find a way to debug? Is this a server issue?

    I’ve used both:
    =importJSON(“” & lower(A2),”0.current_price”)

    Both return the error, as does a random selection of other coins.

    Thanks for anyone who can help!

  27. Hi!

    I have a question. If I want to be able to type in a Coin Symbol (for example BTC) into a cell, and then have another cell return the price for that entry – I understand that I would use:


    BUT I want to be able to type in a NEW COIN and have that cell auto update with the price of the NEW COIN I typed in.

    How would I do this?

    I need to somehow reference the cell where I’m typing in a ticker with the formula for price. I can’t find out how to do that in the formula.


  28. If you are struggling with multiple imports, and some of your data are randomly giving you “error getting data”, it is because there are to many of them in the same time.

    You can correct that by adding delay (500ms) before retry when getting an error.

    In the IMPORTJSON file, just replace this :

    return “Error getting data”;

    By this :

    setTimeout(IMPORTJSON, 500);

    Oh yeah ! Works like a charm now !

      1. what a legend this works thank you so much i was going mad wondering why I was getting errors. This one worked for me instead of the 1st suggestion

  29. Maybe it’s the German setup of my PC, but the examples didn’t work for me. Only when I exchanged the comma for a semicolon did the script work!
    =ImportJSON(“”, “0.current_price”)

    =ImportJSON(“”; “0.current_price”)

  30. Does anyone have a tutorial or step by step broken down example of how to build an excel sheet from scratch using this API method? Sorry, do not have experience with inputting code or where

Leave a Comment

Your email address will not be published. Required fields are marked *