Import CoinGecko API Data to Sheets [2024] | API Connector (2024)

In this guide, we’ll walk through how to pull cryptocurrency market data from the CoinGecko API directly into Google Sheets, using the API Connector add-on for Sheets.

The cool thing about CoinGecko is that they provide a huge amount of well-organized crypto data, including some unique API endpoints like most-searched coins. This tutorial will show how to get an API key before fetching data.

Mixed Analytics users can currently get 20% off any CoinGecko API Plan by subscribing with the offer code MIXEDANALYTICS20.

Contents

  • Before You Begin
  • Part 1: Get Your CoinGecko API Key
  • Part 2: Pull CoinGecko API Data into Sheets
  • Part 3: Create a Custom Request
  • Part 4: Handle Pagination
  • Part 5: CoinGecko Limits
  • Part 6: API Documentation
  • Appendix: CoinGecko Template

Before You Begin

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

Part 1: Get Your CoinGecko API Key

  1. To get started, you'll need a CoinGecko account, so, if you haven't already, create an account and log in to coingecko.com.
    Import CoinGecko API Data to Sheets [2024] | API Connector (1)
  2. Once you're logged in, navigate to https://www.coingecko.com/en/api/pricing.
  3. To subscribe to a paid API plan, click one of the Upgrade buttons in the pricing table. Alternatively, get a free API key by clicking Create Demo Account underneath the pricing table.
    Import CoinGecko API Data to Sheets [2024] | API Connector (2)
  4. If you select a paid plan, you'll see the Billing Info form on the left (use the MIXEDANALYTICS20 offer code for 20% off any API plan). If you are creating a free demo account, you'll see the form on the right instead.
    Import CoinGecko API Data to Sheets [2024] | API Connector (3)
  5. Either way, once your account is set up, navigate to the Developer dashboard and click +Add New Key
    Import CoinGecko API Data to Sheets [2024] | API Connector (4)
  6. You'll be prompted to label your key and click Create
    Import CoinGecko API Data to Sheets [2024] | API Connector (5)
  7. Your API key will now be listed on the page. Copy this key and keep it safe as we'll use it shortly!
    Import CoinGecko API Data to Sheets [2024] | API Connector (6)

Part 2: Pull CoinGecko API Data into Sheets

The easiest way to get started with the CoinGecko API is through API Connector’s built-in integration.

  1. In Sheets, open API Connector and create a new request (Extensions > API Connector > Open > Create request)
  2. If you're using a free API key through a Demo Account, selectCoinGeckofrom the drop-down list of applications. If you are using a paid CoinGecko API plan, select CoinGecko Pro. The CoinGecko Pro application contains some unique endpoints that aren't accessible to free users.
    Import CoinGecko API Data to Sheets [2024] | API Connector (7)
  3. UnderAuthorization, enter your API key.
    Import CoinGecko API Data to Sheets [2024] | API Connector (8)
  4. Choose an endpoint. For example, select/coins/markets, which is the endpoint for fetching the latest market data.
    Import CoinGecko API Data to Sheets [2024] | API Connector (9)
  5. In the parameters section, select which "vs_currency" you'd like to use.
  6. Optionally select other parameters, e.g. select specific coin IDs or setper_page to 250 to get more than 100 records.
  7. Choose a destination sheet, name your request, and hitRunto see the response data in your sheet.
    Import CoinGecko API Data to Sheets [2024] | API Connector (10)
  8. Optionally open the field editor to filter out any unnecessary fields from your report.

Part 3: Create a Custom Request

Alternatively, you can run your own custom requests instead of using API Connector’s pre-built integration, using any of the API URLs shown in the APIdocumentation. Here's an example request setup:

  1. Open up Google Sheets and clickExtensions > API Connector > Open > Create request.
  2. In the request form enter the following. If you're using CoinGecko's paid API, change the base URL to https://pro-api.coingecko.com/api/v3/, and the header key to x-cg-pro-api-key.
    • Application:Custom
    • Method:GET
    • Request URL:https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd
    • Headers:
      • x-cg-demo-api-key: your_key
  3. Create a new tab and clickSet currentto use that tab as your data destination.
  4. Name your request and clickRun. A moment later you’ll see a list of coins populate your sheet.
Import CoinGecko API Data to Sheets [2024] | API Connector (11)

Part 4: Handle Pagination

  1. For several endpoints, CoinGecko limits the number of records returned in each response. By default, only 100 records will be returned unless you set the per_page parameter to 250:
    Import CoinGecko API Data to Sheets [2024] | API Connector (12)
  2. If you need more than 250 records, you can loop through multiple pages automatically with page parameter pagination handling, like this:
    • Pagination type: page parameter
    • Page parameter: page
    • Run until: choose when to stop running the request
      Import CoinGecko API Data to Sheets [2024] | API Connector (13)

Part 5: CoinGecko Limits

Update: As of October 2023, CoinGecko now supports API keys. You can now get your own personal API key to avoid running into shared rate limits!

CoinGecko does allow access to their API without a key. However, if you run requests through Google Sheets without an API key, you'll probably come across error messages like these:

  • API server responded with an error (429), error code: 1015
  • API server responded with an error (403): error code: 1020

This is because CoinGecko applies rate limits, as shown in their terms & conditions.

When you run your requests through API Connector / Google Sheets, you’re more likely to hit these rate limits because all requests running through Google Sheets share the same pool of IP addresses from Google’s servers. Therefore, get a key first to avoid running into issues.

Part 6: API Documentation

Official API documentation: https://www.coingecko.com/en/api/documentation

Appendix: CoinGecko Template

In this template, everything is configured for you to simply type in whatever coins you’re interested in and get a dashboard like below:

Import CoinGecko API Data to Sheets [2024] | API Connector (14)

You can jump right to a copy of the template here. Happy data grabbing!

Import CoinGecko API Data to Sheets [2024] | API Connector (2024)
Top Articles
Latest Posts
Article information

Author: Duncan Muller

Last Updated:

Views: 5805

Rating: 4.9 / 5 (79 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Duncan Muller

Birthday: 1997-01-13

Address: Apt. 505 914 Phillip Crossroad, O'Konborough, NV 62411

Phone: +8555305800947

Job: Construction Agent

Hobby: Shopping, Table tennis, Snowboarding, Rafting, Motor sports, Homebrewing, Taxidermy

Introduction: My name is Duncan Muller, I am a enchanting, good, gentle, modern, tasty, nice, elegant person who loves writing and wants to share my knowledge and understanding with you.