Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

Parameter
Type
Location
Required
Description

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'
example.js
const response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/tickers/?currency=usd'
);
console.log(await response.json());
example.py
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

Field
Type
Description

ts

integer

Timestamp of the rate actually returned

rates

object

Rates keyed by currency code

ts is the timestamp of the rate actually returned, which can differ from the one requested. A rate of -1 marks a currency that is unavailable for that timestamp.

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

HTTP Status
Message
Description

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?