Reference currencies
The price of a coin is shown in a reference currency. Currencies include, but are not limited to, coins. In contrast to coins, currencies also includes Fiat currencies like US Dollar, EURO, YEN and more. Furthermore, currencies also comprehends denominators as Satoshi and Wei (these are the atomic units for respectively Bitcoin and Ethereum, or - perhaps overly simplified - one could compare them with what the cent is to the Dollar.) Additionally, currencies include commodities, indices, and stocks like Gold, S&P 500, Tesla, etc, which can also be used as reference currencies.
Get list of reference currencies
Get a list of reference currencies, which can be used as reference for coins. The response includes all the essentials for this use-case, such as the symbol (e.g. USD) and - if available - the sign (e.g. $).
https://api.coinranking.com/v2/reference-currencies
Query parameters
| Parameter | Description |
|---|---|
limit (optional) Number | Limit. Used for pagination. 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: 20Size range: 0-5000 Example:
https://api.coinranking.com/v2/reference-currencies?limit=10
|
offset (optional) Number | Offset. Used for pagination Default value: 0Example:
https://api.coinranking.com/v2/reference-currencies?offset=50
|
types (optional) Array | A currency is one of six types: coin (e.g. Bitcoin, Ethereum, etc.), fiat (US Dollar, Euro, Yen, etc.), denominator (e.g. Satoshi), commodities (e.g. Gold, Silver, etc.), indices (e.g. S&P 500, NASDAQ, etc.), or stocks (e.g. Tesla, Apple, etc.). Filter the response by providing one or more types. Allowed values:coin fiat denominator commodities indices stocks Example:
https://api.coinranking.com/v2/reference-currencies?types[]=coin&types[]=fiat
|
search (optional) String | Filter the results by searching for currency names or symbols. Example:
https://api.coinranking.com/v2/reference-currencies?search=EUR
|
cursor (optional) String |
Cursor for pagination. Use the
https://api.coinranking.com/v2/reference-currencies?cursor=eyJ0IjoxLC...
|
Code examples
curl 'https://api.coinranking.com/v2/reference-currencies?limit=50&offset=0&types[]=coin&types[]=fiat' \
-H 'x-access-token: your-api-key' \
-G const options = {
headers: {
'x-access-token': 'your-api-key',
},
};
fetch('https://api.coinranking.com/v2/reference-currencies?limit=50&offset=0&types[]=coin&types[]=fiat', 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/reference-currencies?limit=50&offset=0&types[]=coin&types[]=fiat",
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/reference-currencies?limit=50&offset=0&types[]=coin&types[]=fiat", headers=headers)
print(response.text) Response
HTTP/1.1 200 OK
{
"status": "success",
"data": {
"stats": {
"total": 3
},
"currencies": [
{
"uuid": "Qwsogvtv82FCd",
"type": "coin",
"symbol": "BTC",
"name": "Bitcoin",
"iconUrl": "https://cdn.coinranking.com/bOabBYkcX/bitcoin_btc.svg",
"sign": "₿"
},
{
"uuid": "razxDUgYGNAdQ",
"type": "coin",
"symbol": "ETH",
"name": "Ethereum",
"iconUrl": "https://cdn.coinranking.com/rk4RKHOuW/eth.svg",
"sign": "Ξ"
},
{
"uuid": "yhjMzLPhuIDl",
"type": "fiat",
"symbol": "USD",
"name": "US Dollar",
"iconUrl": "https://cdn.coinranking.com/kz6a7w6vF/usd.svg",
"sign": "$"
}
]
},
"pagination": {
"limit": 20,
"hasNextPage": true,
"hasPreviousPage": false,
"nextCursor": "eyJ0IjoxLCJyIjpudWxsLCJ1IjoieWhqTXpMUGh1SURsIiwibyI6bnVsbCwiZCI6bnVsbH0",
"previousCursor": null
}
} Response fields
| Property | Description |
|---|---|
status String | Status of the request Allowed values:success |
data Object | |
data.stats Object | |
data.stats.total Number | Total number of coins |
data.currencies Object[] | List of reference currencies |
data.currencies.uuid String | UUID of the reference currency |
data.currencies.type String | The type of the currency can be either 'coin' (BTC, ETH, etc.), 'fiat' (USD, EUR, etc.), 'denominator' (Satoshi, Wei, etc.), 'commodities' (Gold, Silver, etc.), 'indices' (S&P, NASDAQ, etc.), or 'stocks' (Tesla, Apple, etc.) |
data.currencies.symbol String | Currency symbol |
data.currencies.name String | Name of the currency |
data.currencies.iconUrl String | Location of the icon. Replace |
data.currencies.sign String | Some currencies have a symbol, like $ for USD and ₿ for BTC |
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
HTTP/1.1 422 Unprocessable Entity
{
"status": "fail",
"type": "VALIDATION_ERROR",
"message": "limit must be at least 1 and most 100"
} Error responses
| Error | Description |
|---|---|
VALIDATION_ERROR Object | The request could not be validated. The response should provide more details. |
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 orderBy or orderDirection 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. |