Exchange Rate
Get Exchange Rate
This endpoint provides the current exchange rate for the specified blockchain.
GET https://api.whatsonchain.com/v1/<chain>/<network>/exchangerate
Example Request
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/exchangerate"
Example Response
{
"rate": 27.055,
"time": 1752257180,
"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/19
for BSV.2010/07/18
for 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"
Example Response
[{
"rate": 60.3905,
"time": 1660089600
},{
"rate": 62.661,
"time": 1660176000
},{
"rate": 62.9375,
"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?