api/v2/tickers/- Bitcoin Cash

This endpoint returns current or historical fiat exchange rates for Bitcoin Cash. A timestamp or block selects historical rates.

Parameters

ParameterTypeLocationRequiredDescription
currencystringqueryNoFiat currency code. When omitted, all available rates are returned
timestampintegerqueryNoUnix timestamp for historical rates
blockstringqueryNoBlock height or hash whose time is used for historical rates

Request

bashcurl --location --request GET 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/tickers/?currency=usd'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/tickers/?currency=usd'
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/tickers/?currency=usd')

print(response.json())

Response

json{
    "ts": 1785418362,
    "rates": {
        "usd": 211.79
    }
}

Response Parameters

FieldTypeDescription
tsintegerTimestamp of the returned rates
ratesobjectMap of fiat currency codes to rates
errorstringError text when a rate is unavailable

Use Cases

  • Fiat Display: Show a BCH amount in a user's local currency
  • Historical Valuation: Read the rate at a past timestamp or block
  • Invoicing: Convert a fiat-priced invoice into BCH at the current rate
  • Reporting: Attach fiat values to transaction histories

Error Handling

HTTP StatusMessageDescription
400Bad requestA query parameter has an invalid value
404Not foundNo rate data exists for the requested query
500Internal errorThe indexer failed to read rate data