api/v2/tickers - Zcash
Example code for the api/v2/tickers REST method. Complete guide on how to use the api/v2/tickers REST method in the GetBlock Web3 documentation.
This endpoint returns current or historical fiat exchange rates for Zcash. A timestamp or block selects historical rates; without either, the latest available rates are returned.
Parameters
currency
string
query
No
Fiat currency code. All available currencies when omitted
timestamp
integer
query
No
Unix timestamp for historical rates
block
string
query
No
Block height or hash whose timestamp selects the rate
Request
curl --location --request GET 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/tickers/?currency=usd'const response = await fetch(
'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/tickers/?currency=usd'
);
console.log(await response.json());import requests
response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/tickers/?currency=usd')
print(response.json())Response
{
"ts": 1789744501,
"rates": {
"usd": 1478.55
}
}Response Parameters
ts
integer
Timestamp of the rate actually returned
rates
object
Rates keyed by currency code
Use Cases
Fiat Display: Show a ZEC amount in a user's local currency
Historical Valuation: Value a past transaction at the rate of its block
Invoicing: Convert a fiat-priced invoice into ZEC at the current rate
Error Handling
400
Bad request
A path or query parameter is malformed
403
Forbidden
Missing or invalid ACCESS-TOKEN
404
Not found
No indexed data exists for the request
500
Internal error
The indexer failed to process the request
Last updated
Was this helpful?