Exchange Rate
Get Exchange Rate
This endpoint provides the current exchange rate for the specified blockchain.
GET https://api.whatsonchain.com/v1/<chain>/<network>/exchangerateExample Request
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/exchangerate"curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/exchangerate"Example Response
{
"rate": 27.055,
"time": 1752257180,
"currency": "USD"
}{
"rate": 117581.6,
"time": 1752257200,
"currency": "USD"
}URL Parameters
Parameter
Description
chain
Desired blockchain: bsv or btc.
network
Selected network: main or test.
Get Historical Exchange Rate
This endpoint provides the historical exchange rate data for the specified blockchain.
Exchange rate data goes back to:
2018/11/19for BSV.2010/07/18for BTC.
GET https://api.whatsonchain.com/v1/<chain>/main/exchangerate/historical?from=<unixtimestamp>&to=<unixtimestamp>Example Request
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/exchangerate/historical?from=1660139745&to=1660312545"curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/exchangerate/historical?from=1660139745&to=1660312545"Example Response
[{
"rate": 60.3905,
"time": 1660089600
},{
"rate": 62.661,
"time": 1660176000
},{
"rate": 62.9375,
"time": 1660262400
}][{
"rate": 23962.9,
"time": 1660089600
},{
"rate": 23935.3,
"time": 1660176000
},{
"rate": 24398.7,
"time": 1660262400
}]URL Parameters
Parameter
Description
chain
Desired blockchain: bsv or btc.
from
The starting date (unixtimestamp) to retrieve the exchange rate data.
to
The end date (unixtimestamp) to retrieve the exchange rate data.
Last updated
Was this helpful?