In this article:

Import CoinMarketCap API Data to Google Sheets (2024 Update)

May 8, 2024

In this article we will show how to import CoinMarketCap data to Google Sheets with the CoinMarketCap API. Simply follow the steps below.

How to Add CoinMarketCap API Data to Google Sheets

1. Get CoinMarketCap API Key

The CoinMarketCap API can be retrieved through the following link:

Click Get Your API Key Now.

Access main website for Coinmarketcap into google sheets

You will have an option to either sign up or log in to your existing CoinMarketCap account. Choose whichever is applicable to your case. If you don’t have an account yet, you can simply sign up, choosing the Basic Plan for starters.

Sign up to import coinmarketcap google sheets

After signing up, you can go to the login screen to access your account.

Log in to access data for coinmarketcap google sheets

The Developers screen will load after logging in.

Main page for accessing coinmarketcap api to google sheets

The API key generated for you for accessing CoinMarketCap data is prominently placed in the main page (but censored for security). 

google sheets coinmarketcap api, copy the key

Move your cursor to the box. A button labeled Copy Key will appear. Click it. You now have a copy of the API key.

2. Copy the CoinMarketCap Sample Spreadsheet

Next, we need to have a script added to our spreadsheet. Alternatively, you can copy the following spreadsheet. It already contains the script and has the sheet prepared:

You cannot edit the spreadsheet, but you can make a copy to modify. Click File, then select Make a copy.

Copy the spreadsheet to import coinmarketcap data into google sheets

A box labeled Copy document will be loaded. Set the name of the new sheet, then click Make a copy. This action will include the script attached to the sheet. 

Settings for Copying the spreadsheet to import coinmarketcap data into google sheets

3. Add the API Key to the Script

Your copy of the sheet will be loaded in a new tab. You can now add the API key to the script. 

Open the script by clicking Extensions, then selecting Apps Script.

Click extensions, select apps script to manually add api coinmarketcap to google sheets

A new tab will be loaded containing the script.

Script to import coinmarketcap data into google sheets

Go to line 12. Replace ‘YOUR_API_KEY_GOES_HERE’ with the API key you got from Step 1, also enclosed in single quotes.

Once done, click Save project.

Save project to import coinmarketcap information google sheets

4. Run the Script

To test the API key, run the script by clicking Run the selected function icon. It is just to the right of the Save button.

Run the script to import coinmarketcap data into google sheets

As it is the first time running the script, you need to authorize it to access your data. A pop-up box will appear asking your permission to access your data. Click Review permissions

coinmarketcap to google sheets, authorization required message

A new window will load, asking you to select the Google account that the script can access. Select the Google account you are currently using.

coinmarketcap to google sheets, select account to access

A webpage will appear reminding you that Google hasn’t verified the script. Click Advanced.

coinmarketcap to google sheets, google hasnt verified this app message

Additional information will appear at the bottom. Click Go to coins (unsafe).

coinmarketcap to google sheets, allow running the script by clicking Go to coins

The list of permissions needed by the script will be listed next. Click Allow.

coinmarketcap to google sheets, permissions needed listed

The window will close and the script will start executing. After some time it will be completed. The progress can be seen in the Execution log that will appear once the script starts running.

coinmarketcap into google sheets script, log showing execution completed

Once the Execution completed notice appears, go back to the sheet. The data is now loaded.

coinmarketcap into google sheets script, crypto data loaded

5. Add a Button 

It is quite burdensome if we have to open Apps Script every time we need updated values of the chosen cryptocurrencies. We can, instead, add a button that we can click anytime we want to refresh the data. 

To start, click Insert, then select Drawing.

Insert button to import coinmarketcap data into google sheets, click insert, select drawing

The Drawing box will appear. Click the Shapes icon, then select Shapes, then choose Rounded Rectangle. Check the image below to see where the shape is.

Insert button to import coinmarketcap data into google sheets, click shapes, select rounded rectangle

The cursor will change to a plus sign. That is the signal for you to draw the rounded rectangle in the canvas. Click and drag your cursor until you reach the ideal size of the button. Next, click the Text box icon. 

Insert button to import coinmarketcap data into google sheets, select text box

The cursor will also change shape; click and drag it until you reach the ideal size of the text. Type Access Prices or any other label you want to add to the button. 

Insert button to import coinmarketcap into google sheets, final button design

Once you are done, click Save and Close. The button will appear in the sheet. You can resize it and move it to another place in your sheet.

Insert button to import coinmarketcap into google sheets, button inserted to the sheet

6. Connect the Script to the Button

To connect the script to the button, hover your cursor to the button and then click the three dots found on its upper-right corner. A drop-down list will appear. Select Assign script.

import coinmarketcap data into google sheets through button, click upper right corner, assign script selected

A box labeled Assign script will appear. Type coin_price, then click OK.

Assign script to the button to import coinmarketcap data into google sheets

We can now run the script anytime we want and need!

google sheets coinmarketcap, crypto data imported from coinmarketcap


How to Add or Remove Crypto Coins in the List?

To add crypto coins to the list, just type the crypto symbol in Column B. For example, we will add BNB, XRP, and ADA. We simply type these symbols in Column B.

Afterwards, we click the button we made. The prices are now loaded to the sheet, along Column C.

To remove Crypto coins from the list, simply delete the symbol, then click the button again. 

If you enjoyed this article, you might also like our article on how to add crypto prices on Google Sheets or our article on how to import data from Yahoo finance to Google Sheets. 

If you want to learn how to attach Google Sheets to an email, we also suggest checking out our detailed guide. 

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.
Get your copy of our free Google Sheets automation guide!
  • 27 pages of Google Sheets tips and tricks to save time
  • Covers pivot tables and other advanced topics
  • 100% free

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->