CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (2024)

What is the CoinMarketCap API?

The CoinMarketCap API is a method to retrieve cryptocurrency data such as price, volume, market cap, and exchange data from CoinMarketCap using code.

We will demonstrate this in this article using Python.

CoinMarketCap is one of the most popular websites used for tracking various cryptocurrencies and obtaining data about them.

Link: https://coinmarketcap.com

Is the CoinMarketCap API free?

The website of the CMC is free to use and the payment is necessary if you want more API functions.

CoinMarketCap API offers a free plan among the other 4 available ones. With the free plan you have access to the 9 market data endpoints:

  • Crypto referential and info logo and logo assets
  • Latest Global Market cap, volume and stats
  • Latest crypto rankings and market quotes
  • Latest crypto and flat currency conversions
  • Partner data access

The STARTUP plan which is 79$ per month, gives you access to 14 market endpoints like historical data and OHLCV. On the other hand the STANDARD and PROFESSIONAL plans give you access to 22 market endpoints.

The number of free CMC API call credits per month is 10k and, with the other paid packages, it can even go up to 3 million or more.

In my opinion, the free plan is at a huge disadvantage compared to the premium plans and there are other websites similar to CMC that give you free access to the endpoints that CMC doesn’t give you. For example, check out our CoinGecko article:

You can see the other available plans from the picture below:

CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (1)

How to get started with CoinMarketCap API?

In order to get started with the CoinMarketCap API you’ll need to obtain your API key from the following link:

https://coinmarketcap.com/api/

Click on the “GET YOUR API KEY NOW” button and fill up the sign-up information. After you input the relevant data, go over to your email to confirm it. After that, you’ll be taken to the following screen:

CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (2)

As you can see you can easily disable and generate new API keys.

For this tutorial we’ll be using Python, so let’s go over and install the CoinMarketCap library with the following command:

pip install python-coinmarketcap
CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (3)

Have in mind that for most of the next chapters we’ll be using the Jupyter Notebook.

How to obtain metadata using CoinMarketCap API?

The CMC metadata endpoint returns all the static data that is available for the specified cryptocurrency. The information obtained contains the following: logo, description, website URL, various social links and other.

In order to obtain crypto metadata, we’ll need to import the CMC library and set the client up.

import coinmarketcapapicmc = coinmarketcapapi.CoinMarketCapAPI(‘YOUR API KEY’)

Now, let’s make a call that will provide is with the overall data for the Bitcoin cryptocurrency.

data = cmc.cryptocurrency_info(symbol='BTC')data
CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (4)

How to get the ID Map data with CoinMarketCap API?

The CMC ID Map endpoint obtains a mapping of all currencies with their unique ID’s. Each currency obtained by this endpoint will return standard identifiers as name, symbol and token address.

This endpoint will return crpytocurrencies that have actively tracked markets on supported exchanges by default. The data obtained will also provide the first and last historical data timestamps.

In order to obtain this endpoint, after validating your API Key, do the following:

data_id_map = cmc.cryptocurrency_map()
CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (5)

You may want to make the data more readable by putting it into a pandas data frame. For this, you need to do the following:

import pandas as pdpd = pd.DataFrame(data_id_map.data, columns =['name','symbol'])pd.set_index('symbol',inplace=True)print(pd)
CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (6)

How to get Fiat data using CoinMarketCap API?

According to Investopedia, Fiat money is a government-issued currency that is not backed by a physical commodity, such as gold or silver, but rather by the government that issued it.

Firstly, let’s import the relevant library, authenticate the API Key and call our endpoint:

from coinmarketcapapi import CoinMarketCapAPIcmc = CoinMarketCapAPI('b44c1fd8-1c05-45b9-8df7-380a409f9b69')fiat = cmc.fiat_map()
CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (7)

How to use the CoinMarketCap API price conversion tool?

The CMC price conversion tool endpoint allows us to convert a specified amount of one cryptocurrency or fiat currency into other currencies by utilizing the latest market rate for each of them.

In this example we’ll convert the BTC currency to USD with a specified amount (20).

Let’s import the relevant library, authenticate the API Key, and call our endpoint:

from coinmarketcapapi import CoinMarketCapAPIcmc = CoinMarketCapAPI('b44c1fd8-1c05-45b9-8df7-380a409f9b69')tool=cmc.tools_priceconversion(amount=20, symbol='BTC',convert='USD')tool
CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (8)

How to use partners endpoints in CoinMarketCap API?

The CMC partners endpoints provides us with the FCAS latest listings and quotes.

FCAS stands for The Fundamental Crypto Asset Score, which is a comparative metric used to determine the fundamental health of the crypto project.

In CMC the FCAS endpoint returns a paginated list of FCAS scores for all cryptocurrencies. Let’s import he relevant library, authenticate the API Key and call our endpoints

from coinmarketcapapi import CoinMarketCapAPIcmc = CoinMarketCapAPI('b44c1fd8-1c05-45b9-8df7-380a409f9b69')FCAS_listing = cmc.partners_flipsidecrypto_fcas_listings_latest()FCAS_quote = cmc.partners_flipsidecrypto_fcas_quotes_latest(symbol='LTC')
CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (9)

How to use CoinMarketCap API in Google Sheets?

CMC can be easily integrated into Google Sheets. Let us go over the steps together and pull some data into our Google Sheets.

The first thing we need to do is to navigate ourselves to the “Script Editor” menu that is located on the main tool ribbon.

CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (10)

After that, we will start the building process of our script. Firstly, we will make a variable that will pull the data onto a specified sheet.

 var sh1 =SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1');

For this example, we will want the latest quotes for the Etherium cryptocurrency that is converted to USD. Let’s code our request:

var requestOptions = { method: ‘GET’, uri: ‘https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest’, qs: { start: 1, limit: 4000, convert: ‘USD’ }, headers: { ‘X-CMC_PRO_API_KEY’ : ‘YOUR API KEY HERE’ }, json: true, gzip: true};

The next step is to create a variable that will access the URL for our API request:

var url=https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=ETH;

The next thing we need to specify is a function that will obtain all the data from the JSON file. So let us create a result variable:

var result= UrlFetchApp.fetch(url, requestOptions);

As the data wouldn’t be useful in the JSON modality we will want to convert it to a string. That being said, out next step is to create a function that will put it into a txt format:

var txt= result.getContentText();

As we need to make the data readable, we will parse the data into different Javascript objects. Let us create another variable that does that:

var d=JSON.parse(txt); sh1.getRange(1, 2).setValue(d.data.ETH.quote.USD.price)}
CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (11)

We’re ready! Let’s save the function and click “Run”. After that, be sure to authorize the function.

CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (12)

After you run the function you should see the data in your second column. I’ll write the word Etherium next to it.

CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (13)

More about CoinMarketCap

CoinMarketCap (CMC) was founded in 2013, and one of the primary tasks that it has set for itself is to add transparency and accountability when it comes to cryptocurrencies and aggregation of the Market data.

Moreover, they offer a holistic approach to data aggregation and state that it is better to overprovide data than to censor or police the information.

Binance, a leading cryptocurrency exchange, has acquired CMC in April of 2020 for $400 million dollars.

Lately, CMC is looking to expand its horizons by adding educational content that could inspire and educate a whole new generation of crypto traders. They decided to call this expansion “CMC Alexandria” which is a reference to the ancient Library of Alexandria.

CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (14)

When it comes to cryptocurrencies, CMC tracks over 7 thousand of them. On the other hand, the number of markets the CMC tracks is over 33 thousand.

CMC also provides three ways of ratings for exchanges:

  • Top 100 By Adjusted Volume – provides volumes of spot trading platforms
  • Top 100 By Reported Volume – provides volumes of all spot trading platforms, no matter what trading models they use
  • By Liquidity – shows all trading platforms by liquidity

CMC has a listings criteria as they deem the quality of their data of utmost importance. They state 3 main principles of data admissibility and they are the following:

  1. Credibility: Is the requester able to substantiate his/her case with supporting evidence?
  2. Verification: Are we able to verify the information from credible and independently verifiable sources?
  3. Methodology: Is this request in accordance with our methodology?

You can read more about the said criteria on the following link:

https://support.coinmarketcap.com/hc/en-us/articles/360043659351-Listings-Criteria

As the CMC provides us with the minute updates of all market data it provides, all data is run through several cleaning and verification algorithms.

One raises a question in what way do these algorithms work and how are the following metrics calculated:

  • Price
  • Volume
  • Market Capitalization
  • Liquidity Score
  • Web Traffic Factor
  • Supply and more.

Good news that the CMC shares the methodology behind the mentioned metrics which can be read on the following link:

https://support.coinmarketcap.com/hc/en-us/sections/360008888252-Metric-Methodologies

The CMC API is a powerful tool that is built on a high-performance RESTful JSON endpoints.

CMC even excludes markets with no fees as there could be malicious activities going behind them. For example, a trader or bot can trade back and forth with himself and make a lot of illusory volume. This volume could deceive others.

We should also have in mind that the CMC doesn’t offer a way to purchase a cryptocurrency. Their main role is to only provide data on it.

CMC offers us a mobile app that is available for iOS & Android. With it, we can track crypto and exchange ranking data, build our portfolio and watchlist, obtain crypto price alerts, get cryptocurrency and blockchain news, and get global stats that are ready for conversion.

CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (15)

CMC also has a blockchain explorer which you can check out on the following link:

https://blockchain.coinmarketcap.com/?utm_source=coinmarketcap&utm_content=footer

CoinMarketCap API - An Introductory Guide - AlgoTrading101 Blog (2024)

FAQs

How to use the CoinMarketCap API? ›

How to Use the CoinMarketCap API
  1. Sign Up and Get Your API Key. Go to the CoinMarketCap website. Register and log in to your account. ...
  2. Making API Requests. The CoinMarketCap API supports multiple endpoints for accessing different types of data. Below are some basic examples using Python and the requests library.
Aug 2, 2024

How often does CoinMarketCap update? ›

Every 1 minute

How to use CoinMarketCap API in Postman? ›

Quick Start Guide
  1. Sign up for a free Developer Portal account. ...
  2. Copy your API Key. ...
  3. Make a test call using your key. ...
  4. Postman Collection To help with development, we provide a fully featured postman collection that you can import and use immediately! ...
  5. Implement your application.

What is the introduction of CoinMarketCap? ›

Coinmarketcap is a website that provides information and data such as prices, trade volumes, market capitalization on cryptocurrencies. It was founded in 2013 in New York City by Brandon Chez.

How to activate CoinMarketCap? ›

How to Register for a CoinMarketCap Account
  1. Navigate to the CoinMarketCap website: https://coinmarketcap.com/
  2. In the upper-right hand corner on our website, click the blue "SIGN UP" button to register for an account. ...
  3. Complete the CAPTCHA image verification.
  4. Then click "VERIFY" button to get the verification code.
Apr 26, 2024

How trustworthy is CoinMarketCap? ›

Yes, CoinMarketCap is a legitimate website and widely recognized as a reliable source for cryptocurrency market data. It provides comprehensive information on prices, market caps, volume, and historical data for thousands of cryptocurrencies, including Bitcoin and Ethereum.

Is coinranking API free? ›

Free and paid subscriptions

Use our free API subscription a try-out project and our paid ones if you need more api calls and in-depth crypto price data.

What is the code 429 in CoinMarketCap? ›

A: This is the number of HTTP calls that can be made simultaneously or within the same minute with your API Key before receiving an HTTP 429 "Too Many Requests" API throttling error. This limit increases with the usage tier and resets every 60 seconds.

How do I connect Excel to CoinMarketCap API? ›

Connecting Excel to the Coinmarketcap API

From the data ribbon, select From Web which can be found in the Get and Transform group of commands. This will open a From Web setup box. In the HTTP request header parameters(optional) second box enter your API Key and press OK.

What is an API in crypto? ›

An API, or Application Programming Interface, is a set of rules and protocols that allow different software applications to communicate with each other. In the context of cryptocurrencies and blockchain technology, APIs are pivotal for enabling various types of interactions between applications and blockchain networks.

How to use coin API? ›

Getting started​
  1. Obtain an API key from CoinAPI.
  2. Choose a symbol to pull data for. You can find a list of symbols here.
  3. Choose a time interval to pull data for. You can find a list of intervals here.

Who runs CoinMarketCap? ›

Coinmarketcap was founded in 2013 by Brandon Chez. In 2020, CMC was acquired by Binance but runs independently. CMC launched an educational rewards program in 2020, and a educational portal called CMC Alexandria in 2021.

Is CoinMarketCap a US company? ›

CoinMarketCap is a U.S. company registered in the United States of America. CoinMarketCap has been the premier price-tracking website for cryptocurrencies.

How old is CoinMarketCap? ›

Since its inception in 2013, the website has grown to become the world's leading cryptocurrency information authority and one of the most visited websites of all time.

How to use CoinMarketCap API with Google Sheets? ›

  1. Step 1.) Install and open the Apipheny add-on for Google Sheets. ...
  2. Step 2.) Sign up for a CoinMarketCap developer account and get your API key. ...
  3. Step 3.) Choose a CoinMarketCap API URL endpoint. ...
  4. Step 4.) Enter your CoinMarketCap API request into Apipheny. ...
  5. Step 5.) Run the API endpoint request.

How do I use API token calls? ›

How API Tokens Work
  1. A user or application trying to connect with the API provides the token to the API server to authenticate their identity and access.
  2. The server reviews the token. If the token is valid, the API server grants the requested level of access.

How do I connect CoinMarketCap API to excel? ›

Connecting Excel to the Coinmarketcap API
  1. From the data ribbon, select From Web which can be found in the Get and Transform group of commands. ...
  2. Select Advanced.
  3. Enter the API URL endpoint to the first URL parts box.

Top Articles
Straw Bridges
FPL | Business | Payment Extension
Mickey Moniak Walk Up Song
Drury Inn & Suites Bowling Green
Camera instructions (NEW)
13 Easy Ways to Get Level 99 in Every Skill on RuneScape (F2P)
Chelsea player who left on a free is now worth more than Palmer & Caicedo
Wausau Marketplace
Www Craigslist Louisville
Kris Carolla Obituary
Directions To Lubbock
Optum Medicare Support
Encore Atlanta Cheer Competition
Citymd West 146Th Urgent Care - Nyc Photos
What Time Chase Close Saturday
10 Best Places to Go and Things to Know for a Trip to the Hickory M...
Eka Vore Portal
2016 Ford Fusion Belt Diagram
Dr. med. Uta Krieg-Oehme - Lesen Sie Erfahrungsberichte und vereinbaren Sie einen Termin
Grayling Purnell Net Worth
Hollywood Bowl Section H
Richland Ecampus
Ice Dodo Unblocked 76
Best Sports Bars In Schaumburg Il
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
55Th And Kedzie Elite Staffing
Star Wars Armada Wikia
Weather October 15
Will there be a The Tower season 4? Latest news and speculation
Skepticalpickle Leak
Possum Exam Fallout 76
5 Star Rated Nail Salons Near Me
Purdue Timeforge
UPC Code Lookup: Free UPC Code Lookup With Major Retailers
Gwen Stacy Rule 4
What Time Does Walmart Auto Center Open
B.k. Miller Chitterlings
Tenant Vs. Occupant: Is There Really A Difference Between Them?
Andhra Jyothi Telugu News Paper
Msnl Seeds
Mandy Rose - WWE News, Rumors, & Updates
Casamba Mobile Login
Giovanna Ewbank Nua
Busted Newspaper Mcpherson Kansas
Comanche Or Crow Crossword Clue
✨ Flysheet for Alpha Wall Tent, Guy Ropes, D-Ring, Metal Runner & Stakes Included for Hunting, Family Camping & Outdoor Activities (12'x14', PE) — 🛍️ The Retail Market
Hawkview Retreat Pa Cost
Gary Vandenheuvel Net Worth
Kate Spade Outlet Altoona
Minterns German Shepherds
Horseneck Beach State Reservation Water Temperature
Phunextra
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 5817

Rating: 4 / 5 (61 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.