Best Crypto APIs for Developers & Traders

Struggling to find a reliable provider for cryptocurrency data? These API providers will have you swimming in data in no time!
cryptocurrency apis banner alpharithms

Cryptocurrency is a volatile asset class that has sparked quantitative analysts to develop entirely new approaches in developing predictive models. The key ingredient to such models is data—lots of data. Historical cryptocurrency pricing data is available from many providers via API.

Introduction

These API services, ranging from free pricing for hobbyists to more expensive enterprise plans, provide a range of invaluable data for statistical modeling. Additionally, metrics such as total issued coins, max supply, and market capitalization can help draw valuable insight. In this article, we’ll discuss several cryptocurrency API providers and what one can expect from each.

CoinGecko

coingecko banner alpharithms

The CoinGecko API provides a broad source of cryptocurrency data for an incredible number of coins. CoinGecko tracks more than 10,000 coins (ever-growing) and provides data for each as part of their free API.

In addition to price, the CoinGecko API provides total supply, circulating supply, max supply, market capitalization, and many other useful metrics. The price data available is limited to 7d sparkline data consisting of 168 data points (hourly prices) as well as minute resolution data (for a single day at a time.)

  • Resolution: Daily
  • Range: 7-day hourly sparkline, 7 Years historical
  • Pricing: Free & Premium

Pros

The CoinGecko API provides more data than any other cryptocurrency API on the market today. They provide info on token contracts, segment by category, ecosystem, and exchanges, and even carry data for derivatives products. The CoinGecko API also provides APIs for proprietary data such as CoinGecko trending coins and status updates.

Cons

One downside with historical data is that anything below daily OHLC requires multiple calls, with resolution below hourly requiring a call-per-daily period with custom aggregation. In other words, to get 15minute resolution data on a daily scale one must make a call-per-day, combine data across the desired interval, then aggregate to the desired sub-daily interval (e.g. 15-minute.)

Pricing Model

CoinGecko data plans are tiered mostly with respect to API call volume with free plans allowing 50 calls per minute via shared infrastructure and pro plans offering 500 calls per minute with a 5MM calls-per-month cap. Custom plans are available starting at $10k/yr. for those with higher capacity data needs.

Note: Use this CoinGecko coupon code during checkout to get $500 off annual premium plans: CGALPHARITHMS.

Example

CoinGecko offers API clients in Python, C++, JavaScript, and even as an Excel plugin (CryptoSheets). For those that prefer to develop their own clients via raw requests, the HTTPS endpoints offer easily-configurable access. For example, one can make a request to the markets API endpoint as such:

import requests

# Define HTTP parameters
params = {
    "vs_currency": "usd",
    "order": "market_cap_desc",
    "per_page": "250",
    "page": "1",
    "sparkline": "true",
    "price_change_percentage": "1h,24h,7d,14d,30d,200d,1y",
}

# Construct the HTTP request using
# the requests library
data = requests.get(
    url="https://api.coingecko.com/api/v3/coins/markets",
    params=params,
)

# View the output
>>> data.json()

After making the HTTP call outlined here, one will be presented a list of dict objects representing various market data for the top 250 coins (by market cap). An example of a single item in this output (Ethereum) is shown below:

{
        "id": "ethereum",
        "symbol": "eth",
        "name": "Ethereum",
        "image": "https://assets.coingecko.com/coins/images/279/large/ethereum.png?1595348880",
        "current_price": 3869.11,
        "market_cap": 459428507981,
        "market_cap_rank": 2,
        "fully_diluted_valuation": null,
        "total_volume": 21885105369,
        "high_24h": 4062.33,
        "low_24h": 3713.35,
        "price_change_24h": -193.223247261156,
        "price_change_percentage_24h": -4.75646,
        "market_cap_change_24h": -22703178606.165955,
        "market_cap_change_percentage_24h": -4.70892,
        "circulating_supply": 118779134.1865,
        "total_supply": null,
        "max_supply": null,
        "ath": 4878.26,
        "ath_change_percentage": -20.71098,
        "ath_date": "2021-11-10T14:24:19.604Z",
        "atl": 0.432979,
        "atl_change_percentage": 893228.83811,
        "atl_date": "2015-10-20T00:00:00.000Z",
        "roi": {
            "times": 109.69576295481274,
            "currency": "btc",
            "percentage": 10969.576295481274
        },
        "last_updated": "2021-12-17T18:25:21.588Z",
        "sparkline_in_7d": {
            "price": [3956.6717756294065, ... , ]
}

Note: The price data in the sparkline_in_7d entry contains 168 values representing hourly pricing quotes over a 7-day period. Those values have been truncated here for brevity.

Overall Impression

Overall, the CoinGecko API is the best choice for most hobbyists or amateur quants. The number of coins is unbeatable, the free API is good, and the amount of non-price-related data is incredible. Even better, the free CoinGecko API doesn’t even require one to register an account—it’s public!

CoinMarketCap

coinmarketcap banner alpharithms

CoinMarketCap is one of the more popular pricing history providers in the crypto industry. They have over 15,000 listed assets and offer a wide range of data for each. CoinMarketCap API plans range from Free plans affording 11 endpoints and 10,000 calls per month, to Enterprise plans starting at $699 per month and up offering custom call limits and more than 29 endpoints.

  • Resolution: Hourly (Standard Plan+)
  • Range: No historical on Free plan, back to 2013 on premium
  • Pricing: Free & Premium

Pros

The CoinMarketCap API provides a huge amount of data including current, historical, and qualitative endpoints such as trending assets, top gainers and losers, and “metadata” with links to an assets website, social media, contract address(es), and more. The documentation for this API is robust and reflective of the many endpoints and customizable parameters available.

Cons

The majority of CoinMarketCap API endpoints are reserved for premium plans. The Basic Plan is limited to a “map” of all coins, basic info, latest quotes, and global market macro data. Additionally, the CoinMarketCap API requires free accounts to register for an API key for access. CoinMarketCap’s API does offer OHLCV data but only on the Startup plans, priced at $79/mo.

Pricing Model

CoinMarketCap’s API offers plans divided as Free, Hobbyist ($29/mo.), Startup ($79/mo.), Standard ($299/mo.), Professional ($699/mo.), and Custom Enterprise plans. The Free plan affords users a measly 10,000 API credits, capped at 300 per day and historical data is stringently delegated such that the Standard plan offers 3 months, the Professional 12, and only with Enterprise plans can users access the full 6 years’ worth of available Historical data.

Example Code

The CoinMarketCap API does not offer any language-specific libraries officially. The API documentation outlines HTTP request formats for each endpoint and provides a sandbox environment for developers. Using the /cryptocurrency/listings/latest endpoint, one can get information for the top 100 assets by market cap as such:

import requests

# Add API Key in header as described
# in API best practices section
headers = {
    'X-CMC_PRO_API_KEY': YOUR_KEY_GOES_HERE,
    'accepts': 'application/json'
}

# Define the HTTP endpoint
url = "https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest"

# Construct & Make HTTP Request via the 
# requests library
data = requests.get(url=url, headers=headers)

# view results as dict object
>>> data.json()

After making the HTTP call outlined here, one will be presented a dictionary object with data stored at the key data containing a list of dict objects representing various market data for the top 100 coins (by market cap). An example of a single item in this output (Ethereum) is shown below:

{
    'id': 1027,
    'name': 'Ethereum',
    'symbol': 'ETH',
    'slug': 'ethereum',
    'num_market_pairs': 4553,
    'date_added': '2015-08-07T00:00:00.000Z',
    'tags': ['mineable', 'pow', 'smart-contracts', 'ethereum-ecosystem', 'binance-smart-chain', 'coinbase-ventures-portfolio', 'three-arrows-capital-portfolio', 'polychain-capital-portfolio', 'binance-labs-portfolio', 'blockchain-capital-portfolio', 'boostvc-portfolio', 'cms-holdings-portfolio', 'dcg-portfolio', 'dragonfly-capital-portfolio', 'electric-capital-portfolio', 'fabric-ventures-portfolio', 'framework-ventures-portfolio', 'hashkey-capital-portfolio', 'kenetic-capital-portfolio', 'huobi-capital-portfolio', 'alameda-research-portfolio', 'a16z-portfolio', '1confirmation-portfolio', 'winklevoss-capital-portfolio', 'usv-portfolio', 'placeholder-ventures-portfolio', 'pantera-capital-portfolio', 'multicoin-capital-portfolio', 'paradigm-portfolio'],
    'max_supply': None,
    'circulating_supply': 118795047.9365,
    'total_supply': 118795047.9365,
    'platform': None,
    'cmc_rank': 2,
    'last_updated': '2021-12-18T22:48:02.000Z',
    'quote': {
        'USD': {
            'price': 3984.863692255339,
            'volume_24h': 19951363575.439213,
            'volume_change_24h': -13.4215,
            'percent_change_1h': 0.59303309,
            'percent_change_24h': 2.80733662,
            'percent_change_7d': -1.46572232,
            'percent_change_30d': 0.03394643,
            'percent_change_60d': 3.18988266,
            'percent_change_90d': 20.99578926,
            'market_cap': 473382073341.8914,
            'market_cap_dominance': 21.4172,
            'fully_diluted_market_cap': 473382073341.89,
            'last_updated': '2021-12-18T22:48:02.000Z'
        }
    }
}

Note: This API call will only work if an API Key (provided after signing up for a free account) is supplied in the HTTP header. Also, note a large percentage of the data here is in the tags section; many of which are part of CoinMarketCap’s VC portfolio associations.

Overall Impression

CoinMarketCap is a strong competitor in the field of cryptocurrency price data providers. They have built an empire as both a data platform and as an industry news source—largely by leveraging the ocean of data in meaningful ways. Their API services offer robust data and come with a  wide range of features.

However, their pricing model is very biased towards power users able to spend upwards of $699/mo., still limiting even those plans to 12 months’ historical pricing data. Overall, CoinMarketCap’s API is a hard sell compared to other options on the market.

Note

This article is a work in progress and additional API providers are intended to be added as our team familiarizes themselves with them. If you would like to see a particular API service covered here feel free to reach out and submit a request.

Review

The API providers here are but a handful of the many options available on the market today. Crypto API services range from simple spot-quote OHLC data to more robust analytical data and contract address analytics. Before making a choice for an API it’s recommended one read through the documentation to get a feel for what data is available, potential rate-limiting issues, and the price for your intended consumption of data.

Some of these APIs offer officially-supported, language-specific libraries to help developers get started fast. Others provide only HTTP endpoints from which developers are expected to build their own request protocols and error handling systems. Both have pros and cons, but knowing when such pre-built solutions are available can help get projects bootstrapped a bit faster.

Zαck West
Full-Stack Software Engineer with 10+ years of experience. Expertise in developing distributed systems, implementing object-oriented models with a focus on semantic clarity, driving development with TDD, enhancing interfaces through thoughtful visual design, and developing deep learning agents.