Currencies are all assets that can be used as reference for coins. 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.)
Get a list of reference currenices, 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. $).
GET /reference-currencies
Name | Type | Description |
---|---|---|
limit (optional) | Number |
Limit. Used for pagination Default value: 20Size range: 0-100 |
offset (optional) | Number |
Offset. Used for pagination Default value: 0 |
types (optional) | Array |
A currency is one of three types: coin (e.g. Bitcoin, Ethereum, etc.), fiat (US Dollar, Euro, Yen, etc.) or a denominator (e.g. Satoshi). Filter the response by providing one or more types Allowed values: coin fiat denominator |
Example: cURL
curl https://api.coinranking.com/v2/reference-currencies \
-H 'x-access-token: your-api-key' \
-G
Example: NodeJs
const request = require('request');
const options = {
method: 'GET',
url: 'https://api.coinranking.com/v2/reference-currencies',
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/reference-currencies",
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;
bash
- limit
curl https://api.coinranking.com/v2/reference-currencies?limit=10 \
-H 'x-access-token: your-api-key' \
-G
bash
- offset
curl https://api.coinranking.com/v2/reference-currencies?offset=50 \
-H 'x-access-token: your-api-key' \
-G
bash
- types
# In this example only fiat and coin reference-currencies are listed (i.e. no denominators
# like Satoshi)
curl https://api.coinranking.com/v2/reference-currencies?types[]=coin&types[]=fiat \
-H 'x-access-token: your-api-key' \
-G
Name | Type | 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.) or 'denominator' (Satoshi, Wei, etc.) |
data.currencies.symbol | String |
Currency symbol |
data.currencies.name | String |
Name of the currency |
data.currencies.iconUrl | String |
Location of the icon |
data.currencies.sign | String |
Some currencies have a symbol, like $ for USD and Ƀ for BTC |
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": "$"
}
]
}
}
422
Name | Type | Description |
---|---|---|
VALIDATION_ERROR | Object |
The request could not be validated. The response should provide more details. |
Response:
HTTP/1.1 422 Unprocessable Entity
{
"status": "fail",
"type": "VALIDATION_ERROR",
"message": "limit must be at least 1 and most 100"
}