Exchange rates functions

1. Specific currency pair rate
2. Rates of all available currency pairs
An API request is HTTP POST request to one of the hosts specified in the User's Dashboard. General view of an API request URL:
http(s)://API_HOST/v1/<function>/<params>
Data of the POST request always has 3 parameters:
public_key=<PUBLIC_KEY>&rnd=<RND>&signature=<SIGNATURE>
PUBLIC_KEY – user's public key, RND – random set of latin letters and numbers, SIGNATURE – signature of API request, PRIVATE_KEY – user's private key.
The public and private keys of user are unique for each user and are displayed in the User's Dashboard. The request sender generates RND, for security reasons it is recommended to generate a new RND for each request.
For all examples below user's public key (PUBLIC_KEY) is equal
67DbHjAodk9Cbic98mG98492d4N1IB29m51P3j
private key (PRIVATE_KEY) is
35CJ1KMG57HPjNaF4MCEe9HiAEKF39eNigikJ2393
RND is
J04PDiMH9pH2k10Il713D5c76f1
Every API function has certain weight, the total weight of functions per 1 minute must be equal or less than limit of weight that is set for the user. Default limit is 10 scores. Contact support to increase the limit.

1. Function "rates-specific"

Weight of function "rates-specific" is 1 score.

General

http(s)://API_HOST/v1/rates/<CURRENCY_PAIR>
CURRENCY_PAIR – currency pair name.
SIGNATURE is calculated by the formula:
SHA512(PUBLIC_KEY+';'+RND+';'+CURRENCY_PAIR+';'+PRIVATE_KEY)

Response (JSON)

{
cp: CURRENCY_PAIR,
last: LAST_VALUE,
average: AVERAGE_VALUE,
created_at: CREATED_AT
}
CURRENCY_PAIR – currency pair name, LAST_VALUE – value of the last exchange rate, AVERAGE_VALUE – simple moving average 24h ((HIGH+LOW)/2), CREATED_AT – exchange rate measurement time.
LAST_VALUE – the median value of the currency pair exchange rate from many (greater than 10) of the largest cryptocurrency exchanges.
An exchange rate is measured (CREATED_AT) several times per hour. Ask support for details.

Example

REQUEST URL:
http(s)://API_HOST/v1/rates/btcusdt
REQUEST DATA:
public_key=67DbHjAodk9Cbic98mG98492d4N1IB29m51P3j&rnd=J04PDiMH9pH2k10Il713D5c76f1&signature=15df9cf64354cb623545d570ef24195d7e21ab1fb5e51cceab7f3d71cb52ce130181a9f9fc08217962c9c08aa09ea1b772e7f02300cd988a2dae58c1615d9aab
JSON RESPONSE:
{"cp"=>"btcusdt", "last"=>"22915.559999999998", "average"=>"22959.355", "created_at"=>"2022-08-05T23:00:20.000+03:00"}

2. Function "rates-all"

Weight of function "rates-all" is 2 scores.

General

http(s)://API_HOST/v1/rates
SIGNATURE is calculated by the formula:
SHA512(PUBLIC_KEY+';'+RND+';'+PRIVATE_KEY)

Response (JSON)

[
{
cp: CURRENCY_PAIR_1,
last: LAST_VALUE_1,
average: AVERAGE_VALUE_1,
created_at: CREATED_AT_1
},
{
cp: CURRENCY_PAIR_2,
last: LAST_VALUE_2,
average: AVERAGE_VALUE_2,
created_at: CREATED_AT_2
},
...
{
cp: CURRENCY_PAIR_N,
last: LAST_VALUE_N,
average: AVERAGE_VALUE_N,
created_at: CREATED_AT_N
}
]
Values of CURRENCY_PAIR_(1,2,...,N), LAST_VALUE_(1,2,...,N), AVERAGE_VALUE_(1,2,...,N) and CREATED_AT_(1,2,...,N) are the similar to those in function rates-specific.

Example

REQUEST URL:
http(s)://API_HOST/v1/rates
REQUEST DATA:
public_key=67DbHjAodk9Cbic98mG98492d4N1IB29m51P3j&rnd=J04PDiMH9pH2k10Il713D5c76f1&signature=f01a58246dd7cac4dc6931df3140766a7f7197958d843cefde9a4c1970e461aa66a7a84aad316c44ae4ee3187b7fc986e7deb6466c4b9e61bbcf9d4b09daeafd
JSON RESPONSE:
[{"cp"=>"btcusd", "last"=>"23051.81", "average"=>"22938.124499999998", "created_at"=>"2022-08-05T17:00:15.000+03:00"}, {"cp"=>"btcusdt", "last"=>"23052.09", "average"=>"22932.620000000003", "created_at"=>"2022-08-05T17:00:21.000+03:00"}, {"cp"=>"btceur", "last"=>"22653.47", "average"=>"22418.425", "created_at"=>"2022-08-05T17:00:25.000+03:00"}, {"cp"=>"btcrub", "last"=>"1403889.0", "average"=>"1401240.5", "created_at"=>"2022-08-05T17:00:26.000+03:00"}, {"cp"=>"btcuah", "last"=>"913457.99", "average"=>"892016.2525", "created_at"=>"2022-08-05T17:00:26.000+03:00"}, {"cp"=>"ltcbtc", "last"=>"0.002645", "average"=>"0.0026185949999999996", "created_at"=>"2022-08-05T17:00:30.000+03:00"}, {"cp"=>"ltcusd", "last"=>"60.9525", "average"=>"60.455", "created_at"=>"2022-08-05T17:00:32.000+03:00"}, {"cp"=>"ltcusdt", "last"=>"60.97", "average"=>"60.45", "created_at"=>"2022-08-05T17:00:35.000+03:00"}, {"cp"=>"ltceur", "last"=>"59.945", "average"=>"59.087500000000006", "created_at"=>"2022-08-05T17:00:36.000+03:00"}, {"cp"=>"ethbtc", "last"=>"0.073113", "average"=>"0.07184", "created_at"=>"2022-08-05T17:00:41.000+03:00"}, {"cp"=>"ethusd", "last"=>"1684.5749999999998", "average"=>"1653.3075", "created_at"=>"2022-08-05T17:00:43.000+03:00"}, {"cp"=>"ethusdt", "last"=>"1684.6480000000001", "average"=>"1652.9775", "created_at"=>"2022-08-05T17:00:47.000+03:00"}, {"cp"=>"etheur", "last"=>"1656.12", "average"=>"1614.9850000000001", "created_at"=>"2022-08-05T17:00:49.000+03:00"}, {"cp"=>"ethrub", "last"=>"102581.5", "average"=>"101022.75", "created_at"=>"2022-08-05T17:00:50.000+03:00"}, {"cp"=>"dashbtc", "last"=>"0.002215", "average"=>"0.0021850000000000003", "created_at"=>"2022-08-05T17:00:53.000+03:00"}, {"cp"=>"dashusd", "last"=>"51.05", "average"=>"50.245000000000005", "created_at"=>"2022-08-05T17:00:54.000+03:00"}, {"cp"=>"dashusdt", "last"=>"51.03", "average"=>"50.230000000000004", "created_at"=>"2022-08-05T17:00:56.000+03:00"}, {"cp"=>"dasheur", "last"=>"50.2705", "average"=>"49.74075", "created_at"=>"2022-08-05T17:00:56.000+03:00"}, {"cp"=>"xmrbtc", "last"=>"0.0068590000000000005", "average"=>"0.00694925", "created_at"=>"2022-08-05T17:00:58.000+03:00"}, {"cp"=>"xmrusd", "last"=>"158.3", "average"=>"159.435", "created_at"=>"2022-08-05T17:00:59.000+03:00"}, {"cp"=>"xmrusdt", "last"=>"158.05825", "average"=>"159.4675", "created_at"=>"2022-08-05T17:01:01.000+03:00"}, {"cp"=>"xmreur", "last"=>"155.23", "average"=>"155.755", "created_at"=>"2022-08-05T17:01:01.000+03:00"}, {"cp"=>"zecbtc", "last"=>"0.0029443", "average"=>"0.0028692500000000003", "created_at"=>"2022-08-05T17:01:04.000+03:00"}, {"cp"=>"zecusd", "last"=>"67.72999999999999", "average"=>"66.0085", "created_at"=>"2022-08-05T17:01:06.000+03:00"}, {"cp"=>"zecusdt", "last"=>"67.76400000000001", "average"=>"66.0325", "created_at"=>"2022-08-05T17:01:07.000+03:00"}, {"cp"=>"zeceur", "last"=>"66.308", "average"=>"64.666", "created_at"=>"2022-08-05T17:01:08.000+03:00"}, {"cp"=>"bchbtc", "last"=>"0.005972", "average"=>"0.0059465", "created_at"=>"2022-08-05T17:01:12.000+03:00"}, {"cp"=>"bchusd", "last"=>"137.67", "average"=>"136.51", "created_at"=>"2022-08-05T17:01:15.000+03:00"}, {"cp"=>"bchusdt", "last"=>"137.65", "average"=>"136.46499999999997", "created_at"=>"2022-08-05T17:01:18.000+03:00"}, {"cp"=>"bcheur", "last"=>"135.25", "average"=>"133.46249999999998", "created_at"=>"2022-08-05T17:01:19.000+03:00"}]