Get global trading volume history

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

With the global trading volume history endpoint, you can retrieve historical cryptocurrency trading data, enabling you to analyze market trends and track cryptocurrency trading activity over time.

On Coinranking, we use this endpoint on our global trading volume chart.

https://api.coinranking.com/v2/stats/global-trading-volumes

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.

Query parameters

Parameter Description
referenceCurrencyUuid (optional) String

UUID of coin (either fiat or crypto), in which all the trading volumes are calculated. Defaults to US Dollar, but you can use any coin. You can find UUIDs for reference currencies in any coin endpoint, including a convenient dedicated reference currency endpoint

Default value: yhjMzLPhuIDl

Example:
https://api.coinranking.com/v2/stats/global-trading-volumes?referenceCurrencyUuid=5k-_VTxqtCEI
interval (optional) String

The interval determines the time period over which each trading volume item is calculated.

  • day: the total volume traded in a single day
  • week: the total volume traded over a week
  • month: the total volume traded over an entire month
Default value: day
Allowed values:
day week month

Example:
https://api.coinranking.com/v2/stats/global-trading-volumes?interval=day
limit (optional) Number

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

Default value: 50
Size range: 1-1000

Example:
https://api.coinranking.com/v2/stats/global-trading-volumes?limit=10
cursor (optional) String

Cursor for pagination. Use the nextCursor value from the previous response to get the next page of results, or the previousCursor value to navigate back to the previous page. See Pagination for more information.

Example:
https://api.coinranking.com/v2/stats/global-trading-volumes?cursor=eyJ0IjoxLC...

Code examples

curl
curl 'https://api.coinranking.com/v2/stats/global-trading-volumes?referenceCurrencyUuid=5k-_VTxqtCEI&interval=day&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/stats/global-trading-volumes?referenceCurrencyUuid=5k-_VTxqtCEI&interval=day&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/stats/global-trading-volumes?referenceCurrencyUuid=5k-_VTxqtCEI&interval=day&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/stats/global-trading-volumes?referenceCurrencyUuid=5k-_VTxqtCEI&interval=day&limit=50", headers=headers)

print(response.text)

Response

json
HTTP/1.1 200 OK
{
  "status": "success",
  "data": {
    "volumes": [
      {
        "timestamp": 1742947200,
        "intervalVolume": "68304365278.00"
      },
      {
        "timestamp": 1743033600,
        "intervalVolume": "64019945571.00"
      },
      {
        "timestamp": 1743120000,
        "intervalVolume": "32021315171.25"
      }
    ]
  },
  "pagination": {
    "limit": 50,
    "hasNextPage": true,
    "hasPreviousPage": false,
    "nextCursor": "eyJ0cyI6MTc0MzEyMDAwMH0",
    "previousCursor": null
  }
}

Response fields

Property Description
status String

Status of the request

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

Array of trading volume data points

data.volumes.timestamp Number

An Epoch timestamp in seconds

data.volumes.intervalVolume String/null

The total trading volume within the requested time interval in the reference currency

pagination Object

Pagination information. See Pagination for more details.

pagination.limit Number

The number of results per page

pagination.hasNextPage Boolean

Whether there are more results available after the current page

pagination.hasPreviousPage Boolean

Whether there are results available before the current page

pagination.nextCursor String/null

Cursor to use for the next page, or null if there are no more results

pagination.previousCursor String/null

Cursor to use for the previous page, or null if on the first page

Error response

json
HTTP/1.1 422 Unprocessable Entity
{
  "status": "fail",
  "type": "REFERENCE_UNAVAILABLE",
  "message": "Reference currency not available"
}

Error responses

Error Description
VALIDATION_ERROR Object

The request could not be validated. The response should provide more details.

REFERENCE_UNAVAILABLE Object

The reference currency used in the request is not available. Choose another UUID.

INVALID_CURSOR Object

The cursor string is malformed or could not be decoded. Start pagination from the beginning without a cursor.

CURSOR_MISMATCH Object

The cursor was created with different interval parameters. Match the original parameters or start over.

PAGINATION_CONFLICT Object

Both cursor and offset parameters were provided. Use only one pagination method per request.