Search API Connector Documentation
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 crypto data to your spreadsheet.
- Before You Begin
- Part 1: Get your CoinMarketCap API Key
- Part 2: Fetch Data from CoinMarketCap
- Part 3: Create a Custom Request
- Part 4: Handle Pagination
- Part 5: API Documentation
- Appendix: CoinMarketCap Crypto Portfolio Template
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Get Your CoinMarketCap API Key
- If you haven’t already, navigate to https://coinmarketcap.com/api/ and click Get Your API Key Now
- Fill out your details and click Create My Account
- 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.
Part 2: Fetch Data from CoinMarketCap
The easiest way to get started with the CoinMarketCap API is through API Connector’s built-in integration.
- Select CoinMarketCap from the drop-down list of applications
- Under Authorization, enter your API key.
- Choose an endpoint. We’ll start with
/v1/cryptocurrency/listings/latest, which is the endpoint for fetching the latest market data.
- In the parameters section, select auxiliary fields to retrieve. For now we can skip the other parameters as they’re optional.
- Choose a destination sheet, name your request, and hit Run to see the response data in your sheet.
Part 3: Create a Custom Request
Alternatively, you can run your own custom requests instead of using API Connector’s pre-built integration. When you create a custom request, you add your complete URL into the request URL field. You also need to add a Header, where Key =
X-CMC_PRO_API_KEY, and Value =
Part 4: Handle Pagination
- CoinMarketCap limits the number of records returned in each request. By default, only 100 records will be returned unless you include
limitparameters. 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.
- 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:
- Pagination type:
- Offset parameter:
- Limit parameter:
- Limit value:
- Run until: choose when to stop running the request
- Pagination type:
Part 5: API Documentation
Official API documentation: https://coinmarketcap.com/api/documentation/v1/
Appendix: CoinMarketCap Template
Here is the template link.