Get coin market cap history

Growth This endpoint requires the growth plan or higher. Free, Basic and Startup plans can use preview access.

With the coin market-caps endpoint you can check out a coin's historical market cap. The market cap for each coin is determined by the latest price for one coin, multiplied by the amount of coins in circulation.

https://api.coinranking.com/v2/coin/:uuid/market-cap-history

Preview access

Free, Basic and Startup plans can test this endpoint with five successful requests per account per UTC day. Use the documented endpoint URL with your existing API key. Preview access is applied automatically. The allowance resets at 00:00 UTC.

All API keys, resource IDs, query parameters and pagination requests share this endpoint's allowance for your account. Failed requests do not consume the preview allowance. Successful previews also count toward your normal API usage, and your plan's result, historical-window and rate limits still apply. See endpoint previews for limits, response headers and quota errors.

Path parameters

Parameter Description
uuid String

UUID of the coin you want to request the market cap data for. A UUID is our unique identifier for each coin. You can find them in all our coin endpoints, or look them up in the find UUID page.

Query parameters

Parameter Description
interval (optional) String

The interval determines the time period over which each market cap item is determined.

Default value: day
Allowed values:
hour day week month

Example:
https://api.coinranking.com/v2/coin/Qwsogvtv82FCd/market-cap-history?interval=hour
limit (optional) Number

Limit. Limit the amount of time periods for which the marketCaps are retrieved. For example, when interval=hour and limit is 10, data will be returned for the last 10 hours. The maximum amount of results you can fetch in one request is 100 for Free and 5000 for all paid plans, including previews where available.

Default value: 50
Size range: 0-5000

Example:
https://api.coinranking.com/v2/coin/Qwsogvtv82FCd/market-cap-history?limit=10

Code examples

curl
curl 'https://api.coinranking.com/v2/coin/Qwsogvtv82FCd/market-cap-history?interval=hour&limit=50' \
  -H 'x-access-token: your-api-key' \
  -G
JavaScript
const options = {
  headers: {
    'x-access-token': 'your-api-key',
  },
};

fetch('https://api.coinranking.com/v2/coin/Qwsogvtv82FCd/market-cap-history?interval=hour&limit=50', options)
  .then((response) => response.json())
  .then((result) => console.log(result));
PHP
<?php
  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => "https://api.coinranking.com/v2/coin/Qwsogvtv82FCd/market-cap-history?interval=hour&limit=50",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: your-api-key"
      ),
  ));

  $response = curl_exec($curl);

  curl_close($curl);
  echo $response;
Python
import requests

headers = {
  'x-access-token': 'your-api-key'
}

response = requests.request("GET", "https://api.coinranking.com/v2/coin/Qwsogvtv82FCd/market-cap-history?interval=hour&limit=50", headers=headers)

print(response.text)

Response

json
HTTP/1.1 200 OK
{
  "status": "success",
  "data": {
    "history": [
      {
        "timestamp": 1698220800,
        "marketCap": "663355719491"
      },
      {
        "timestamp": 1698217200,
        "marketCap": "662740429329"
      },
      {
        "timestamp": 1698213600,
        "marketCap": "666715637188"
      },
    ]
  }
}

Response fields

Property Description
status String

Status of the request

Allowed values:
success
data Object
data.history Object[]

List of market cap items

data.history.timestamp Number

An Epoch timestamp in seconds

data.history.marketCap String/null

the market cap in US Dollars

Error response

json
HTTP/1.1 404 Not Found
{
  "status": "fail",
  "type": "COIN_NOT_FOUND",
  "message": "Coin not found"
}

Error responses

Error Description
COIN_NOT_FOUND Object The coin could not be found. Try another UUID.
Error Description
VALIDATION_ERROR Object The request could not be validated. The response should provide more details.