Import CoinMarketCap Data to Google Sheets

CoinMarketCap is a cryptocurrency tracking platform. 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. 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.

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

We can now enter all our values into API Connector and import CoinMarketCap API data into Google Sheets.

    1. Open up Google Sheets and click Add-ons > API Connector > Create New API Request.
    2. In the Create Request interface, enter the Request URL we just created
      coinmarketcap-img4

       

    3. 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 step 3.
      coinmarketcap-img5

    4. Create a new tab. You can call it whatever you like, but here we’ll call it ‘CoinMarketCap_Latest’. While still in that tab, click ‘Set’ to use that tab as your data destination.
    5. Name your request. Again we’ll call it ‘CoinMarketCap_Latest’
    6. Click Run and a moment later you’ll see the latest market data for all active cryptocurrencies in your Google Sheet:
      coinmarketcap-img6

 

 

PART 4: HANDLE PAGINATION


Note that 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.
coinmarketcap-img7

To retrieve paginated records, add these ‘start’ and ‘limit’ parameters like this:

page 1: https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=5000
page 2: https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?start=5001&limit=5000

With API Connector, you can either set these up as separate requests or loop through them automatically with pagination (paid feature) for added efficiency, like this:
coinmarketcap-img8

 

PART 5: COINMARKETCAP API + GOOGLE SHEETS NOTES

 

  1. Experiment with endpoints and query strings as described in the documentation to see other types of cryptocurrency data. For example, this URL will retrieve the latest global cryptocurrency market metrics:
    https://pro-api.coinmarketcap.com/v1/global-metrics/quotes/latest
  2. The free version of CoinMarketCap limits the number of accessible endpoints and number of call credits. Check the pricing page for details.
  3. 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.

7 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

Leave a Comment