Search API Connector Documentation

Print

Import CoinMarketCap Data to Google Sheets

In this guide, we’ll walk through how to pull cryptocurrency data from the CoinMarketCap API directly into Google Sheets, using the API Connector add-on for Sheets. We’ll first get an API key from CoinMarketCap, and then set up a request to pull in cryptocurrency exchange rate details to your spreadsheet.

Feel free to also check out our YouTube tutorial here.

Contents

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Get Your CoinMarketCap API Key

  1. If you haven’t already, navigate to https://coinmarketcap.com/api/ and click Get Your API Key Now
    coinmarketcap-img1
  2. Fill out your details and click Create My Account
    coinmarketcap-img2
  3. A moment later you’ll receive an email. Click on the email to verify your account, and you’ll be redirected into your new CoinMarketCap dashboard. Congrats! You now have access to the CoinMarketCap API. Hover over the API Key box in the top left and copy the key to your clipboard.
    coinmarketcap-img3

Part 2: Create Your API Request URL

We’ll follow the CoinMarketCap documentation to access the latest crypto quotes.

  • API root: https://pro-api.coinmarketcap.com
  • Endpoint: /v1/cryptocurrency/listings/latest

Putting it together, we get the full API Request URL:

https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest

Part 3: Pull CoinMarketCap API Data into Google Sheets

Now let’s get that data into Sheets.

  1. Open up Google Sheets and click Add-ons > API Connector > Open.
  2. In the Create tab, enter the API URL we just created.
    coinmarketcap-img4  
  3. Leave authentication set to None. Under Headers enter two sets of key-value pairs like this:
    X-CMC_PRO_API_KEYYOUR_API_KEY
    Acceptapplication/json
    Replace YOUR_API_KEY with the value provided above in part 1 step 3.

    coinmarketcap-img5

  4. Create a new tab and click ‘Set current’ to use that tab as your data destination.
  5. Name your request and click Run. A moment later you’ll see the latest market data for all active cryptocurrencies in your Google Sheet:
    coinmarketcap-img6

Part 4: More Example API URLs

You can experiment with endpoints and query strings as described in the documentation to see other types of cryptocurrency data, but if you just want to jump in and get a feel for it, play around with the URLs you enter in the API URL path field. Try the following (one at a time).

  • latest global cryptocurrency market metrics
    https://pro-api.coinmarketcap.com/v1/global-metrics/quotes/latest
  • all active cryptocurrencies with latest market data, sorted by 24 hr volume
    https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?sort=volume_24h
  • metadata (logo, description, official website URL, social links, etc) for BTC and ETH
    https://pro-api.coinmarketcap.com/v1/cryptocurrency/info?symbol=BTC,ETH
  • latest quotes for BTC and ETH, converted to euros
    https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC,ETH&convert=EUR
    Due to the structure of the underlying JSON, by default the above request will return all selected symbols in a single row. To get each coin in its own row instead, add the following JMESPath: data.values(@)
    coinmarketcap-img11
  • Fundamental Crypto Asset Scores (FCAS) for measuring cryptocurrency project health
    https://pro-api.coinmarketcap.com/v1/partners/flipside-crypto/fcas/listings/latest

Note that the free version of CoinMarketCap limits the number of accessible endpoints and number of call credits. Check their pricing page for details.

Part 5: Handle Pagination

  1. CoinMarketCap limits the number of records returned in each request. By default, only 100 records will be returned unless you use the ‘start’ and ‘limit’ parameters as described in their documentation. The documentation says you can specify a limit of up to 5000, but in my own tests large limits seemed to produce an error, so I used 1000 in the examples below. YMMV.
    coinmarketcap-img7
  2. With API Connector you can either run these paginated request URLs manually or loop through them automatically with offset-limit pagination handling (paid feature), like this:
    • API URL: enter your request URL, making sure to include limit=1000
    • Pagination type: offset-limit
    • Offset parameter: start
    • Limit parameter: limit
    • Limit value: 1000
    • Number of pages: enter the number of pages you’d like to fetch
      coinmarketcap-img8

Appendix [PRO]: CoinMarketCap Template

In this template, everything is configured for you to simply add your API key along with whatever currencies you’re interested in and get a dashboard like below:
coinmarketcap-img10

Please note that the request template uses a JMESPath query to reformat the API data, so this report requires a pro account with API Connector (if you’ve just installed API Connector, you’ll have a free trial). Here is the link.

Appendix [FREE]: CoinMarketCap Template

If you are using the free version of API Connector, you can use this template instead. Instead of JMESPath, it uses some Google Sheets functions like TRANSPOSE to restructure the data.

It is exactly the same as the report shown above, but because the horizontal data consumes so many columns, it is limited to 10 coins instead of 100.

Previous Import Coinmap Data to Google Sheets
Next Import Constant Contact Data to Google Sheets

139 thoughts on “Import CoinMarketCap Data to Google Sheets”

  1. When I load the data into google sheets it only loads 100 coins. is there a way to export all coins in order to filter on market cap, circulating supply, volume?

    Reply
    • Good question! You can add the parameter limit=5000 to get 5000 rows of data. If that’s still not enough, you can combine it with the start parameter.
      I’ll update the article to reflect this.

      Reply
  2. Thakns so muc! I successfully did it. However, there are many critical coins that are not being reported. For example; Aion, WAX and Peerplays are all not there, even after I had imported over 1000 coins.

    Woat could be the issue?

    Reply
    • I just tested a request to https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=5000 and found all 3 of those coins on the list. Which URL are you using?

      Reply
  3. Hello Ana,
    I am using the API based on your useful Article put here.
    When I run the request the timestamp shown is 2020-08-29T06:34:36.879Z .But the Actual time I run the API was 1:38 PM JST.Due to this current Price is not shown(The Binance Exchane price was 17 USDT but my Google sheet is showing 15 USDT).Could you help to fix this issue?

    Reply
    • The endpoint returns 3 different timestamps: 1) Timestamp (ISO 8601) of the last time this cryptocurrency’s market data was updated, 2) Timestamp (ISO 8601) of when the conversion currency’s current value was referenced, and 3) Current timestamp (ISO 8601) on the server. Are all of them looking off? In my own tests the timestamps don’t differ from API Connector’s own timestamps by more than about 30 seconds. Can you please add a timestamp (located at Output Options > Add timestamp) and compare the API Connector timestamp to the server timestamp?
      Keep in mind that the API Connector timestamp will reflect the time zone of your sheet, which can be viewed by clicking File > Spreadsheet settings.

      Reply
      • Hello Ana,
        I had selected “Append” in the Output mode and due to that nothing gets updated(Date,Price),Once I changed to “Overwrite” then everything gets updated properly.
        But I have some formulas put in the Page 1(limit 5000) and these formuals are lost when I select Overwrite.Could you let me know how to fix the update issue by having Append option as I don’t want to loose my Customer formulas added in page1.

      • Hi Ragu, append mode should return all data except the headers from the first row, to avoid repeating headers within the sheet. Are you seeing something different?

        Since overwrite mode overwrites everything in the sheet, I suggest using a formula like =query({Sheet1!A1:Z10000}) to pull all your data into a second sheet. Then you can apply your formulas to that second sheet, and won’t lose your formulas when the data refreshes.

  4. Hi!

    I’m trying to load all of the metadata for all of the coins and im having problems with setting correct request.
    https://pro-api.coinmarketcap.com/v1/cryptocurrency/info?id=300
    returns meta on 1 coin only.
    How do I return URLS only for all of the crypto currencies ?
    Thanks

    Reply
      • Hello Ana

        How can I build an endpoint to call, for example the BTC and ETH, symbols and logos at the same time?

        I made this but I get errors:

        api.coinmarketcap.com/v1/cryptocurrency/info?symbols="BTC,ETH"?logo="BTC,ETH"

        It is based on what I’ve seen here: https://imgur.com/a/jMws1fV

      • That looks fine to me, I think you just need to remove the quotation marks, e.g. https://pro-api.coinmarketcap.com/v1/cryptocurrency/info?symbol=BTC,ETH. Also it should be ?symbol=, not ?symbols=.

      • Yes, Ana, it works well! Thanks a lot

        (BTW I made a mistake with “symbols” parameter because it’s singular, not plural as I wrote earlier”)

        My last question is how to get the logo of each one of these cryptos. Should I need to create a new endpoint and run it from another spreadsheet or can I run it in the same one?

        I have this URL but due to 8 calls limits of the free API plan I’m not able to test today:

        https://pro-api.coinmarketcap.com/v1/cryptocurrency/info?symbol=BTC,ETH?logo=BTC,ETH

        But I’m not sure, since “logo” belongs to the “aux” parameter https://imgur.com/a/jMws1fV

      • You don’t need to do anything extra, as logo is already included as one of the fields from your original request URL. You should see links to the logos returned in the fields data » BTC » logo and data » BTC » logo.
        Also, if you want to actually see the images in your sheet, you can add a cell containing the IMAGE() function, e.g. =IMAGE(M2), and it will automatically display the image from the link.

  5. Hi Ana and thanks a lot for your article!
    What if I just want USD price, 24h % and 7jd % for a list of coins defined by their ID (because symbol is sometimes the same for 2 coins)?

    Reply
    • Hey David, you’d make a request like https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?id=1,1027,825, where you include whatever IDs you need in the id parameter. Btw, I recommend using compact report style (under Output Options) to make the output easier to read.

      Reply
      • Thanks, it works fine but how can i filter columns?
        I just need coin symbol, USD price, 24h % and 7d %
        I think it’s in JMESpath but i don’t know the syntax…

      • Hi there, you can try this: data.*[].{symbol:symbol,quote:quote}. For more info, please check my JMESPath guide.

        Alternatively, you can just query the columns you want into a new sheet using Sheets functions. For example a function like this would get columns A, C, and E:
        =QUERY(Data!A:Z, “select A, C, E”)

        Or, easiest of all, you can just hide the columns you don’t want to see. Hope that helps!

  6. Hi Ana,

    your article helped me a lot. Thank you.
    I want to create a spreadsheet where i have the overview on my coins and their current values.
    Therefore i need to build connections from the prices of the coins to other fields.
    What about if the rank of the coins change, will the connection be wrong or invalid afterwards?
    What is the best way to connect the fields?
    sorry my technical english isn’t so good…

    Reply
    • Hey Florian! If I understand correctly, you have a list of coins in one sheet, and want to keep all the data lined up?
      If so, you can just use Google Sheets functions for this, for example put all your coins in one column and then use VLOOKUP to pull associated data into associated columns. There are lots of tutorials online about how to use VLOOKUP, here’s one: https://exceljet.net/excel-functions/excel-vlookup-function. With VLOOKUP, it doesn’t matter if your coin data changes position, since you’ll be matching on the coin name or ID.
      Let me know if that answers your question, if not, feel free to message back with more detail about what you’re looking for.

      Reply
  7. Hi Ana,

    one more question. My data does not update. What do i have to configure for automatic updates?
    Unfortunately I don’t understand your quote:
    “If you’re looking for a more dynamic, ticker-like experience in Sheets, check out the API Connector custom function IMPORTAPI() for faster refresh rates.”

    Thanks for your help 🙂

    Reply
  8. Hello Ana, thank you for the wonderful detailed article! I was able to set this up in my spreadsheet in no time at all. 🙂

    Right now all price quotes are in USD. Is there a way to modify the request URL so it displays prices in BTC? Thank you very much!

    Reply
    • Thank you for the nice comment, I’m glad the article was useful!
      CoinMarketCap’s documentation says that you can convert currency in the quote object from USD to BTC by adding ?convert=BTC to the end of your URL. Can you please try that and see how it goes?

      Reply
  9. Hello! so i have done everything perfectly but i wanna add an extra something. I want to add convert for the usd prices that i receive from coinmarketcap via that method. Then i want a real time converter to change the prices to euro as well.

    Is that possible via coinmarkecap’s api? and if yes what’s the exact code i should type in the app?

    Reply
    • CoinMarketCap lets you convert currencies by adding the convert parameter to the end of your API request URL, e.g. https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?convert=EUR.

      Sheets itself also has currency conversion functions, e.g. you can enter a function like =GOOGLEFINANCE("CURRENCY:USDEUR") directly into your cell to see a conversion rate.

      Reply
      • ahhh thanks a lot, i made a little bit of digging myself and found the googlefinance method!

        I will need your help on another one though, it’s the last thing missing to completely set up my excel. So i have one sheet in which all the data for the top 500 coins come and another one in which i have my portfolio

        On each of the coins that i am interested in in the price cell i have an =”name of the other sheet”AG2 for example and ofc when i click refresh the price change. Here is the problem though. The coin ranking is constantly change so basically except the top 2 coins all the other prices change as well and i have to manually change it each time.

        The “best” thing i thought was to take the api for only certain coins but still i would have that problem in a smaller scale and if i wanna add new coins then here we go again.

        Do you have a suggestion? btw sorry for the trouble

  10. Hello, I’m trying to retrieve a quote for The Graph which has symbol GRT from Coinmarketcap. However, when I request that token, I get a quote for Global Rental Token which apparently has the same symbol. Is there a way to specify exactly which token I desire? Thank you.

    Reply
    • I see, in that case I think you need to use the slug instead of the symbol. So instead of https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=GRT you can use https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?slug=the-graph.

      Reply
  11. Hi – I notice that the API sheet no longer format’s the data sheet.. which in turn means there is no summary.. I followed the article above. But it does not work. Last week it worked. Something changed?
    Thanks for the great work!

    Reply
    • Hi Adrian, are you referring to the template in this article? That template uses a JMESPath query, so you need pro access to API Connector for it to work (you would have had pro access when you first installed it, as part of the free trial). Sorry for the inconvenience and let me know if I’ve misunderstood your issue.

      Reply
  12. Hi

    I have been using this call:
    https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC,ETH&convert=GBP

    ……succesfully for a few days.

    As of yesterday two things have changed:

    1) the data is being offset by 6 cols containing
    “2021-02-02T10:39:57.450Z 0 15 1 ”

    2) The data used to come on a row for each currency named e.g. BTC, ETH but now it comes in one long string

    Has something changed ?

    Reply
    • Hey there, if you check the list of example API URLs in the article, I mentioned that the /quotes/latest endpoint always returns data in a long row unless you use a JMESPath query. JMESPath is a pro feature, so if JMESPath was working before, and now it’s not, the most likely reason is that you installed the add-on within the past week. When you install the add-on, you receive a free trial that activates all features. Sorry for the inconvenience, but I hope that clarifies.

      Reply
  13. Hello,

    I have this working and whilst the first use is great, any subsequent uses the data changes row / column each time. Which makes it impossible to do anything further with this data and link to other sheets etc.

    Is there any way in which it can just ‘update’ the fields as per the original? Thanks

    Reply
    • Hey Stuart, API Connector returns the data in the order it comes back from the API. If the problem is with columns shifting, please check this article for some suggestions on how to handle these cases where the API doesn’t keep the data order consistent (check the section called “Columns Shifting”). If the problem is with rows shifting, then you can choose from many different Sheets functions to handle this. The most popular is VLOOKUP, which lets you look for a value in a sheet rather than relying on a fixed position. Basically it’s very common for source data to shift around (for any type of data set, not just this one), so you generally need to build a summary sheet that looks up the data it needs rather than relying on data always being in exactly the same cell.

      Reply
    • By default you need to click Run for these requests to refresh, but API Connector provides two methods to refresh automatically: scheduling and the IMPORTAPI function. Neither method is exactly realtime though (scheduling is limited to 1x an hour, and importapi to once every couple minutes).

      Reply
  14. Hello, first of all, congratulations on your website.
    to get the quotations of cryptocurrencies in euros? would the following formula be correct? https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?start=1&limit=1000&EUR=CONVERT&CMC_PRO_API_KEY= (MI API)

    Reply
    • Please enter it like this: https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=1000&convert=EUR&CMC_PRO_API_KEY=yourapikey
      Alternately you can run it like shown in the article, with the API key entered into the Headers section.

      Reply
  15. Looks like an API change that has pushed all crypto into a single line on the template sheet and broken the sheet.

    I have tried to work it out but no luck.

    Any thoughts, advise?

    Thanks

    Reply
  16. I’m getting the following error when I try this:

    { “status”: { “timestamp”: “2021-03-03T14:06:52.064Z”, “error_code”: 1002, “error_message”: “API key missing.”, “elapsed”: 0, “credit_count”: 0 } }

    Reply
    • Please make sure you’ve included your API key in the headers section, with Key = X-CMC_PRO_API_KEY, Value = your API key

      Reply
  17. Not working as of March 8th 2021, the data populated on “Data” sheet somehow is being populated horizontally rather than vertically (it was working before on March 7th and before).

    Reply
    • Hi Dylan, sorry, the report template uses a JMESPath query to reformat the data, so you need pro access to API Connector for it to work. If JMESPath was working before, and now it’s not, the most likely reason is that you recently installed the add-on. When you install the add-on, you receive a free trial that activates all features.

      If you’re using the free version of API Connector, I suggest trying a different crypto API that sends back the data in a more friendly way, for example you can find a very similar template for CoinGecko here: https://mixedanalytics.com/knowledge-base/import-coingecko-data-to-google-sheets/

      Alternately you can pull the data you want to a second sheet and structure it however you want using Sheets functions like HLOOKUP, FILTER, and QUERY.

      Reply
  18. Hi,
    Great work! Can you please tell me why it does not recognize and fetch data for all these coins? I have put all these into Inputs tab. I “refresh all now” but on Summary tab all those below are empty from columns C to N. Thanks
    LTO
    DATA
    AMKR
    NULS
    CELR
    CTXC
    ONE
    MLT
    WIN
    DUSK
    BLZ
    AION
    CTSI
    COTI
    WRX
    GXC
    NKN
    ARPA
    DOCK
    STPT
    COS
    KEY
    MITH
    PERL
    MDT
    GTO
    MBL
    CHR
    TCT
    DREP
    TROY
    OGN
    AKRO
    BEAM
    FIO
    IRIS
    JST
    NBS
    OXT
    REEF
    RIF
    SKL

    Reply
    • I tried your set of symbols and saw the following error returned in the status bar: “Invalid value for “symbol”: “MLT”).
      So it looks like MLT isn’t a valid symbol. Please change it to AMLT and your request should work.

      Reply
      • Not totally sure what you’re referring to, which endpoint are you using? I see info for, say, Enjin Coin with a URL like https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=ENJ

  19. Hello,
    I built a spreadsheet to keep track of my investment vs return for crypto. The problem I’m having is that every time the data updates, the crypto is rearranged and pulling the wrong prices into the main sheet. Is there a way for me to link each “current price” where all that is pulled is the current price of that specific crypto without tons of extra columns of info? I’ve tried following various tutorials but they’re not working.

    Reply
    • Hey Amanda, I would just pull the data into a ‘raw data’ sheet, then use Google Sheets’ VLOOKUP or MATCH functions for this, that way it doesn’t matter if the source rows get rearranged (the source rows will always get rearranged since sort order changes between pulls). Or if you meant you want fewer columns returned, you can use the “aux” parameter described in their documentation to cut out response properties you don’t need. For example, https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?id=1&aux=max_supply would send a response without data tags.

      Reply
  20. Hello,

    is it possible te replace the list of symbols

    https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=CHSB,XRP,BTC

    with a reference cell that would contain all the symbols ?
    What is the good syntax ?

    thank you !

    Reply
      • Hi, I tried you URL as above and the result is displayed horizontally. (only 1 row, all tickers & their values displayed horizontally in many many columns)
        How do I fix this? Thank you.

      • Hi I think this is the issue mentioned in the article under the header “latest quotes for BTC and ETH, converted to euros”. Please check that section for how to resolve it with JMESPath, or use a different endpoint.

  21. How do I pull all the information for coins in DeFi because using

    https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?tag=defi

    Only pulls the first hundred.
    I paid but I’m still a little confused.
    Thank you.

    Reply
    • Hi there, by default CoinMarketCap limits data to 100 rows. Just add &limit=1000 to the end of your URL to get more.
      If you still need more records after that, you can apply pagination handling. Check the section above called “Handle Pagination” for information on how to set that up, or feel free to respond if you’d like further clarification.

      Reply
    • Hey Guillermo, sorry, I’m not really sure what your question means, but it looks like people might be discussing it here? So maybe you can check or post in there for more info.

      Reply
  22. Hello! Is it possible to just pull a list of specific coins? I’m trying to track the prices against my purchases but the way the API organizes by CMC rank messes with how my table links to different cells… I.e, if a coin changes rank, my price tracker will link to the wrong coin. Does that make sense?

    Reply
    • Hey there, yeah, there’s an example in the article of pulling in specific coins. But it sounds like your table is linking to specific cells, right? When you make a spreadsheet you usually don’t want to reference cells directly, since it’s pretty normal for source data to move around. You can use a Sheets function like VLOOKUP so the data stays in place regardless of its exact location in the list. With VLOOKUP you set the name of the coin as your lookup value, then set your sheets to read from that, rather than having them look for a fixed cell location. Hope that helps point you in the right direction!

      Reply
  23. Hello Ana,
    Congratulations on your work.
    I am working on excel, everything is working fine when I send the following requests
    https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=600&convert_id=2790
    and
    https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=600&convert_id=2781

    but I would like a return with 2 currencies usd “id 2781” and eur “id 2790”
    I have tried the following queries which do not work.
    https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=600&convert_id=2781,2790
    https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?id=1,2,3&convert_id=2781,2790

    Thank you
    Sergio from France

    Reply
    • Hey Sergio, what does the error message say? I tried it in my own account and it says “Your plan is limited to 1 convert options” so it looks like you need to be on a paid plan for this request to work.

      Reply
      • Thanks Ana for your quick response.
        I have an HTTP 400 Bad Request in my dashboard.
        and in excel i have the same.
        DataSource.Error: Web.Contents failed to get content from “https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?id=9180&convert_id=2781,2790” (400): Bad Request
        Details:
        DataSourceKind = Web
        DataSourcePath = https: //pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest
        Url = https: //pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest? Id = 9180 & convert_id = 2781,2790

      • Yep, the “Your plan is limited” error is an HTTP 400 error. I’m not familiar with using Excel to connect to APIs so I can’t comment on that, but I suspect it’s the same issue.

  24. Hello Ana,

    I don’t know why, but for some reason in the Summary Tab the columns percent_change_7d (0 value), percent_change_24h (0 value), last_updated and market_cap remain empty while all the other columns get regular values. It should do the vlookup, but somehow it is not successful. I tried it with the template sheet out of the box.
    Anyone else got this problem?

    Thank you for your great work!
    Phil

    Reply
    • Hey Phil, thanks for the message! I see the problem, if coins have a lot of tags, it’s possible they may produce too many columns and go outside the bounds of the VLOOKUP. To fix, go to the Summary tab cell B9. You’ll see a formula like this:
      =arrayformula(if($B$9:$B<>"",iferror(vlookup($B9:$B,Data!$D:$AZ,match(E$7,Data!$1:$1,0)-3,false),""),""))

      Change the AZ to ZZ, like this:
      =arrayformula(if($B$9:$B<>"",iferror(vlookup($B9:$B,Data!$D:$ZZ,match(E$7,Data!$1:$1,0)-3,false),""),""))

      Then copy it all the way across the row and the data should populate correctly. I’ve updated the template as well.

      Reply
      • Hey Ana,
        yep, this was exactly what caused the problem!
        Thank you so much for your quick and helpful response!
        All the best for you and your assets! 🙂
        Cheers!
        Phil

  25. I just want to show only the price of the currency in USDT without any other information in one sell lets choose ETH for example

    Reply
    • By default API Connector will return whatever the API sends back. You can check their documentation to confirm, but I don’t think CoinMarketCap has any endpoint that returns only the price of the currency without any other information. So I think you have the following options:

      1. make a second sheet that pulls in just the data your want from your source data sheet (use VLOOKUP or QUERY functions)
      2. use a different crypto API that DOES provide this info, e.g. https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd
      3. set up a JMESPath expression to filter for just the fields you want when you run your request
      Reply
  26. Hello Ana,

    First of all, thank you very much for the tutorial as it has helped me to understand the CoinmarketCap API.

    I was writing to you in case you can guide me to capture the different markets for one or more currencies. For example, for BTC with USDT

    # 1 – BTC – Binance – BTCUSDT – 39,000
    # 2 – BTC – Huobi – BTCUSDT – 38950

    Is it possible with the API?

    Reply
    • Hey Van! I don’t think anything has changed, I just tested that URL and it worked fine for me. Also, their API documentation says 400 (Bad Request) = “The server could not process the request, likely due to an invalid argument” which implies a misconfigured URL, but I don’t see any problem here. Can you please confirm that this is the URL producing the error? Are you running any other requests in your sheet?

      Reply
      • I just tried it again in a new worksheet and I get the same errors.

        Details: “Web.Contents failed to get contents from ‘https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=ADA,AGI,ALGO,ANKR,ATOM,BAND,BAT,BNB,’ (400): Bad Request

        Seems odd to me it was working fine and now it doesn’t.

      • That doesn’t look like an API Connector error message… I guess you’re running this in Power BI? Anyway I tried your URL in API Connector and got the following error message: "error_code":400,"error_message":"Invalid value for "symbol": "AGI""
        So it looks like AGI is no longer valid. Just remove that symbol from your list and it should work, please try and let me know how it goes.

  27. Thank you so much for checking and your reply. I tried it again this morning and still failing with that error. I don’t have any other script running. It was working before but not sure why it does not work now. Here’s a copy of the whole string.

    DataSource.Error: Web.Contents failed to get contents from ‘https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=ADA,AGI,ALGO,ANKR,ATOM,BAND,BAT,BNB,BRD,BTC,CEL,CSC,DAI,DOT,DSLA,ENJ,ETH,FLR,Gzil,HBAR,HOT,ICX,LINK,MATIC,NPXS,OCE,ONE,PAC,POLX,QNT,RSR,SNX,STMX,TFUEL,THETA,UBX,VET,VTHO,WAN,XDC,XLM,XRP,XTZ,ZIL’ (400): Bad Request
    Details:
    DataSourceKind=Web
    DataSourcePath=https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest
    Url=https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=ADA,AGI,ALGO,ANKR,ATOM,BAND,BAT,BNB,BRD,BTC,CEL,CSC,DAI,DOT,DSLA,ENJ,ETH,FLR,Gzil,HBAR,HOT,ICX,LINK,MATIC,NPXS,OCE,ONE,PAC,POLX,QNT,RSR,SNX,STMX,TFUEL,THETA,UBX,VET,VTHO,WAN,XDC,XLM,XRP,XTZ,ZIL

    Reply
  28. Thank you so much Ana, that worked. There was an update on AGI to AGIX. You ROCK!!! I appreciate your time and expertise in this matter. Have an awesome week.

    Reply
  29. It doesn’t work. Sorry I wasted an hour on it. Starting with “step 3 – there IS NO API key value provided ANYWHERE.

    Reply
    • Sure, you could use an endpoint like this: https://pro-api.coinmarketcap.com/v1/tools/price-conversion?amount=1&symbol=BTC&convert=USD. That will give you the current price of BTC in USD (you can substitute those symbols for other currencies if you like).
      CoinMarketCap sends back some additional metadata fields in the response, so if you ONLY want to see the price, you could do an HLOOKUP on that field from another tab, like =hlookup("quote.USD.price",'Sheet1'!A1:K2,2,false). Or, if you wanted to do it all in one go, you could add a JMESPath filter to your request like data.{quote:quote}

      As for auto-updating the price, you can check out scheduling.

      Reply
  30. If i am using Symbol to pull lets say prices for 100 coins. All of a sudden 1 coin came up with a wrong / duplicate symbol, hence pulling in the wrong price. Can i update the URL to use symbols for 99 coins and ID for the 1 coin? OR would i have to change the entire URL and update all 100 coins to ID instead of symbol (which is what I am trying to avoid)? When i tried to put symbol and id in the same URL, it gave an error.

    Reply
    • Their documentation says “Alternatively pass one or more comma-separated cryptocurrency symbols” so unfortunately I think it’s just one or the other, you can’t mix and match.

      Reply
  31. Hi,

    I try to get data for symbol DXT (Dexit finance), but it always displays DXT (data wallet) – which is also the correct symbol. What can I do to get dexit finance values imported?

    Reply
    • Since the symbol isn’t unique, you should use the ID instead. You can get the ID with a request URL like this:
      https://pro-api.coinmarketcap.com/v1/cryptocurrency/map?symbol=DXT
      Once you have it, you use it in requests like this:
      https://pro-api.coinmarketcap.com/v1/tools/price-conversion?amount=1&id=11661&convert=USD

      Reply
  32. Hello.

    I was using the API Connector with JMESPath enabled and everething sounds good.

    But now, I am receiving the response from coinmarketcap in just one line and the option for JMESPath dont give me the control to change it. Like If the JMESPath was disable.

    Are there any change on the API code ?

    Tks

    Reply
  33. Hi! I’m wondering how to differentiate between coins with the same ticker symbol (e.g. there are 2+ different MIST coins).

    Right now I’m running this query: https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=MIST&convert=USD, but it’s pulling the wrong MIST.

    TYSM for your help!

    Reply
  34. I did this and it is working! thank you!
    but the time stamp of the data is always old not the actual time I make the request. Is there a solution for this?

    Reply
    • Do you mean the timestamp sent back from CoinMarketCap, or the timestamp set by API Connector (info)? The timestamp from API Connector should match the time you made the request, if not please double-check your sheet locale.

      Reply
  35. Hey Ana,

    Have been using the paid version. I need get the market close prices on a particular date for multiple tokens from Coinmarketcap. Is there a specific query for that. Need this urgently.

    Reply
    • Hey Eugene, I checked CoinMarketCap’s documentation and it looks like you can get this from a URL like https://pro-api.coinmarketcap.com/v1/cryptocurrency/ohlcv/historical?time_period=daily&symbol=BTC,ETH&time_start=2020-11-29&time_end=2020-11-30

      Please check the documentation link as it describes their requirements for access (you’ll need a paid CMC plan).

      Reply
  36. How can we find out the ID for a particular coin? Is it listed on coinmarketcap.com somewhere? Like if I wanted to find the ID of a random coin like “SHIB” for instance.

    Reply
    • And some of the coins I’m trying to find the ID for aren’t in the top 5000. So putting https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=5000 as the API url doesn’t work.

      Like this coin for instance: “https://coinmarketcap.com/currencies/metawars/”

      Reply
    • You can do a request to https://pro-api.coinmarketcap.com/v1/cryptocurrency/map?symbol=SHIB,WARS,BTC. As long as you have the symbols, you can list them out to get the IDs.

      Reply
  37. Hi! Is there a way that I can use a symbol + id request? I’m currently working with lots of symbols, but there is only one that have multiple coins on the same symbol. The way I could correct that is by using the id search instead but that would make me change all symbols to ids. So every time I need to add a coin, I need to look for it’s symbol?…

    Example:
    https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC,ETH,SOL,FTM,RAY,SRM,SHIB,RUNE,ATOM,BNB,USDT,CRP

    In this case, I need CRP for CropperFinance, not Crypton.

    Reply

Leave a Comment

Table of Contents