Get stats for selection of coins
Get stats for a selection of coins.
https://api.coinranking.com/v2/stats/coins
Query parameters
| Parameter | Description |
|---|---|
referenceCurrencyUuid (optional) String | UUID of coin (either fiat or crypto), in which all the prices 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: yhjMzLPhuIDlExample:
https://api.coinranking.com/v2/stats/coins?referenceCurrencyUuid=5k-_VTxqtCEI
|
timePeriod (optional) String | Negative changes, positive changes and the change in market cap are influenced by the time period. The maximum Allowed values: 1h 3h 12h 24h 7d 30d 3m 1y 3y 5y Example:
https://api.coinranking.com/v2/stats/coins?timePeriod=1y
|
uuids (optional) Array | UUIDs to filter the list on. If you know the UUIDs of the coins you want to fetch, you can use this filter to get the specific coins. Uuids does not work in combination with tag. If you use both filters, the tag filter takes precedence. Example:
https://api.coinranking.com/v2/stats/coins?uuids[]=razxDUgYGNAdQ&uuids[]=Qwsogvtv82FCd
|
tag (optional) String | Tag to filter the list on. If you provide a tag, this takes precedence over the uuids filter. We have many tags you can check out. Allowed values:defi stablecoin nft many more... Example:
https://api.coinranking.com/v2/stats/coins?tag=defi
|
Code examples
curl 'https://api.coinranking.com/v2/stats/coins?referenceCurrencyUuid=5k-_VTxqtCEI&timePeriod=7d' \
-H 'x-access-token: your-api-key' \
-G const options = {
headers: {
'x-access-token': 'your-api-key',
},
};
fetch('https://api.coinranking.com/v2/stats/coins?referenceCurrencyUuid=5k-_VTxqtCEI&timePeriod=7d', options)
.then((response) => response.json())
.then((result) => console.log(result)); <?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.coinranking.com/v2/stats/coins?referenceCurrencyUuid=5k-_VTxqtCEI&timePeriod=7d",
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; import requests
headers = {
'x-access-token': 'your-api-key'
}
response = requests.request("GET", "https://api.coinranking.com/v2/stats/coins?referenceCurrencyUuid=5k-_VTxqtCEI&timePeriod=7d", headers=headers)
print(response.text) Response
HTTP/1.1 200 OK
{
"status": "success",
"data": {
"stats": {
"positiveChanges": 3118,
"negativeChanges": 3725,
"numberOfCoins": 31110,
"volume": "226221134262.99506",
"volumeShare": "100",
"marketCap": "1278354560622",
"marketCapChange": "0.06",
"marketCapShare": "100",
"topCurrencySymbol": "BTC",
"topCurrencyMarketCap": "668081784272",
"topCurrencyDominance": "52.26"
}
}
} Response fields
| Property | Description |
|---|---|
status String | Status of the request Allowed values:success |
data Object | |
data.stats Object | |
data.stats.positiveChanges Number | The amount of coins within the group that now have a higher price than at the beginning of the selected timeperiod. |
data.stats.negativeChanges Number | The amount of coins within the group that now have a lower price than at the beginning of the selected timeperiod. |
data.stats.numberOfCoins Number | The amount of coins selected for these stats based on the filters provided. See either the tag or uuids filter for more information about filtering these stats. |
data.stats.volume String | The trading volume in US Dollar of the coins within the group, within the time period. |
data.stats.volumeShare String | The percentage of trading volume compared to coins outside of the selection. E.g. if you have used the tag filter to only get DeFi coins, this is the percentage of trading volume of DeFi coins compared to all other coins. |
data.stats.marketCap String | The market cap in US Dollars of the selected coins. |
data.stats.marketCapChange String | The change in market cap in US Dollars of the selected coins, as compared to the beginning of the selected time period. |
data.stats.marketCapShare String | Similar to volumeShare, this compares the selection of coins against all other coins, but for market cap. |
data.stats.topCurrencySymbol String | The symbol of the currency that currently holds the highest market cap within the selection. |
data.stats.topCurrencyMarketCap String | The market cap in US Dollars of the currency that currently holds the highest market cap |
data.stats.topCurrencyDominance String | A percentage that tells you how big the biggest coin in the selection is compared to the rest of the selection, measured in market cap. |
Error response
HTTP/1.1 404 Not Found
{
"status": "fail",
"type": "TAG_NOT_FOUND",
"message": "Tag not found"
} Error responses
| Error | Description |
|---|---|
TAG_NOT_FOUND Object | The tag could not be found. Try another tag. |
| 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. |