---
title: "CoinMarketCap API: crypto search, coin details as JSON"
description: "CoinMarketCap API for crypto search, coin details, OHLC history, listings, markets, exchanges and trending coins as JSON. 1 credit per successful call."
url: https://perceptlayer.com/apis/coinmarketcap
---

[APIs](https://perceptlayer.com/apis) / [Finance](https://perceptlayer.com/verticals/finance) / CoinMarketCap

1 credit per call 7 endpoints 6 datapoints 

# CoinMarketCap API

CoinMarketCap API for crypto search, coin details, OHLC history, listings, markets, exchanges and trending coins as JSON. 1 credit per successful call.

[Get a free API key](https://perceptlayer.com/signup) Run it below

CoinMarketCap

GET /v1/coinmarketcap/search?q=bitcoin 

```
{
  "success": true,
  "data": {
    "query": "bitcoin",
    "search": [
      {
        "id": 1,
        "name": "Bitcoin",
        "symbol": "BTC",
        "slug": "bitcoin",
        "rank": 1,
        "type": 1
      },
      {
        "id": 3717,
        "name": "Wrapped Bitcoin",
        "symbol": "WBTC",
        "slug": "wrapped-bitcoin",
        "rank": 7764,
        "type": 1,
        "contract_address": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
      },
      {
        "id": 1831,
        "name": "Bitcoin Cash",
        "symbol": "BCH",
        "slug": "bitcoin-cash",
        "rank": 20,
        "type": 1,
        "contract_address": "0x8fF795a6F4D97E7887C79beA79aba5cc76444aDf"
      }
    ],
    "pagination": {
      "page": 1,
      "per_page": 100,
      "total": 259,
      "total_pages": 3,
      "has_more": true
    }
  },
  "meta": {
    "endpoint_family": "search",
    "source": "coinmarketcap",
    "request_id": "req_e681b75b2c484e73adcdf6d32f62d194",
    "credits_charged": 1,
    "credits_remaining": 998
  }
}
```

200 OK JSON X-Credits-Used: 1

Recorded from our API and shortened.

Sample data

## What one call returns

A recorded run of `search`: the fields and shapes you will get, shortened to 3 items.

| # | id integer | name string | symbol string | slug string | rank integer | type integer |
| --- | --- | --- | --- | --- | --- | --- |
| 1 | 1 | Bitcoin | BTC | bitcoin | 1 | 1 |
| 2 | 3717 | Wrapped Bitcoin | WBTC | wrapped-bitcoin | 7764 | 1 |
| 3 | 1831 | Bitcoin Cash | BCH | bitcoin-cash | 20 | 1 |

Recorded from our API · 3 items shown · 6 datapoints per item GET /v1/coinmarketcap/search?q=bitcoin

6 datapoints

### Identity

-   id integer
-   name string
-   slug string
-   type integer

### Other

-   symbol string
-   rank integer

Playground

## Run this API

cURL shell 

```
curl "https://api.perceptlayer.com/v1/coinmarketcap/search?q=bitcoin" \
  -H "X-API-Key: $API_KEY"
```

CoinMarketCap · 7 endpoints

## Endpoints

Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.

| Endpoint | Required parameters | Returns | Cost |
| --- | --- | --- | --- |
| [GET `/v1/coinmarketcap/coin`](https://perceptlayer.com/apis/coinmarketcap/coin) | none +3 optional | `coin` | 1 credit |
| [GET `/v1/coinmarketcap/exchanges`](https://perceptlayer.com/apis/coinmarketcap/exchanges) | none +4 optional | `id` `name` `slug` `score` `volume_24h` `currency` +4 more | 1 credit |
| [GET `/v1/coinmarketcap/history`](https://perceptlayer.com/apis/coinmarketcap/history) | `id` +3 optional | `id` `range` `interval` `points` `currency` `history` | 1 credit |
| [GET `/v1/coinmarketcap/listings`](https://perceptlayer.com/apis/coinmarketcap/listings) | none +5 optional | `id` `name` `symbol` `slug` `rank` `market_pair_count` +13 more | 1 credit |
| [GET `/v1/coinmarketcap/markets`](https://perceptlayer.com/apis/coinmarketcap/markets) | `id` +5 optional | `id` `markets` `pagination` | 1 credit |
| [GET `/v1/coinmarketcap/search`](https://perceptlayer.com/apis/coinmarketcap/search) | `q` +2 optional | `id` `name` `symbol` `slug` `rank` `type` +1 more | 1 credit |
| [GET `/v1/coinmarketcap/trending`](https://perceptlayer.com/apis/coinmarketcap/trending) | none +4 optional | `id` `name` `symbol` `slug` `rank` `price` +7 more | 1 credit |

Overview

## About the CoinMarketCap API

## What you can get

The CoinMarketCap API returns CoinMarketCap crypto market data as JSON through 7 endpoints.

-   **Search:** `search` takes a `q`, with `page` and `per_page`.
-   **One coin:** `coin` takes an `id` or a `slug`, with `currency` ( `USD`).
-   **Price history:** `history` takes an `id`, with `range`, `interval` ( `daily` or `1h`) and `currency` ( `USD`).
-   **Listings:** `listings` takes `page`, `per_page`, `sort` ( `market_cap`, `volume_24h`, `percent_change_24h`, `price` or `circulating_supply`), `order` ( `desc` or `asc`) and `currency` ( `USD`, `EUR`, `GBP`, `BTC` or `ETH`).
-   **Markets:** `markets` takes an `id`, with `page`, `per_page`, `sort` ( `volume`), `category` and `currency`.
-   **Exchanges:** `exchanges` takes `page`, `per_page`, `sort` ( `volume` or `score`) and `order`.
-   **Trending:** `trending` takes `page`, `per_page`, `interval` ( `24h`) and `currency`.

The recorded `search` for "bitcoin" returns `query`, `search` and `pagination`. Each result has `id`, `name`, `symbol`, `slug`, `rank` and `type`, and `pagination` reports a `total` of 259 matches over 3 pages. The first result is Bitcoin with `id` 1 and `slug` `bitcoin`.

## How a call works

Search, then read the coin: `GET /v1/coinmarketcap/search?q=bitcoin`, with your key in the `X-API-Key` header, returns each coin's numeric `id`. Pass that to `coin`, `history` or `markets`, for example `GET /v1/coinmarketcap/history?id=1&range=30d&interval=daily`, which returned 30 `points`, each with `open`, `high`, `low`, `close`, `volume`, `market_cap` and `circulating_supply`. Check `has_more` in `pagination` before asking for the next `page`. Every successful call costs 1 credit; failed calls cost nothing.

Finance JSON REST MCP

### More finance APIs

[CoinGecko](https://perceptlayer.com/apis/coingecko) [Stocktwits](https://perceptlayer.com/apis/stocktwits) [TradingView](https://perceptlayer.com/apis/tradingview) [Yahoo Finance](https://perceptlayer.com/apis/yahoo-finance)

Use cases

### Rank coins by market cap, volume or 24-hour change with \`listings\`

`` Use the CoinMarketCap API to rank coins by market cap, volume or 24-hour change with `listings` `` 

### Pull daily or hourly OHLC candles for a coin

`Use the CoinMarketCap API to pull daily or hourly OHLC candles for a coin` 

### Compare a coin's price and liquidity across exchanges and pairs with \`markets\`

`` Use the CoinMarketCap API to compare a coin's price and liquidity across exchanges and pairs with `markets` `` 

### Rank exchanges by \`volume\` or \`score\`

`` Use the CoinMarketCap API to rank exchanges by `volume` or `score` `` 

FAQ

## Questions

**How much does the CoinMarketCap API cost?**

Each successful call costs one credit, whichever endpoint you call, and each page is one call. New accounts get free credits to start, and credit packs bring the price down as you scale.

**Can I look up a coin by name instead of number?**

Yes. \`coin\` takes either a numeric \`id\`, such as 1, or a \`slug\`, such as \`bitcoin\`. \`history\` and \`markets\` need the numeric \`id\`, which \`search\` returns.

**What format are responses in?**

Every endpoint returns JSON, with no HTML parsing on your side.

**Do I need a CoinMarketCap account?**

No. You call this CoinMarketCap API with your Perceptlayer key in the \`X-API-Key\` header, with no CoinMarketCap login.

**Is this the official CoinMarketCap API?**

No. Perceptlayer is an independent service and is not affiliated with CoinMarketCap. It returns CoinMarketCap data as JSON with a Perceptlayer key, so there is no CoinMarketCap developer account, app review or partner approval to get first. It only reads data: if CoinMarketCap has an official API and you need to act on your own CoinMarketCap account, such as posting, managing orders or reading private data, use that one.

**Should I build a CoinMarketCap scraper instead?**

You can, but a CoinMarketCap scraper is code you maintain: page changes break it, requests get blocked, and CoinMarketCap's terms govern how you collect data. The CoinMarketCap API gives you 7 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first.

## Try the CoinMarketCap API with 100 free credits

No credit card. Failed calls are never billed.

[Get a free API key](https://perceptlayer.com/signup) [Read the docs](https://docs.perceptlayer.com)
