Get a free API key Generate key

Stats

Get global stats

These global statistics tell about the data available on coinranking.

GET /stats

Query parameters

Name Type Description
referenceCurrencyUuid (optional) String

UUID of reference currency, in which all the prices are calculated. Defaults to US Dollar

Default value: yhjMzLPhuIDl

Examples

Example: cURL

curl https://api.coinranking.com/v2/stats \
  -H 'x-access-token: your-api-key' \
  -G

Example: NodeJs

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.coinranking.com/v2/stats',
  headers: {
    'x-access-token': 'your-api-key'
  }
};

request(options, (error, response) => {
  if (error) throw new Error(error);
  console.log(response.body);
});

Example: PHP

<?php
  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => "https://api.coinranking.com/v2/stats",
    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;

Parameters examples

bash - referenceCurrencyUuid

# By default the stats are shown in US Dollar. In this example,
# EURO (5k-_VTxqtCEI) is used as a reference
curl https://api.coinranking.com/v2/stats?referenceCurrencyUuid=5k-_VTxqtCEI \
  -H 'x-access-token: your-api-key' \
  -G

Success response

Name Type Description
status String

Status of the request

Allowed values:
success
data Object
data.totalCoins Number

Total number of coins

data.totalMarkets Number

Total amount of markets used for price calculation

data.totalExchanges Number

Total amount of exchanges paired with Coinranking

data.totalMarketCap String

Market capitalization. Price times circulating supply

data.total24hVolume String

Total trade volume in 24 hours, calculated in the reference currency

Success response example - Response:

HTTP/1.1 200 OK
{
  "status":"success",
  "data": {
    "totalCoins": 3220,
    "totalMarkets": 27497,
    "totalExchanges": 190,
    "totalMarketCap": "425992114544",
    "total24hVolume": "23752040073"
  }
}

Error response

Error response - 422

Name Type 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.

Error response example - Response:

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