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

bb_getTickersList - Bitcoin Cash

Example code for the bb_getTickersList JSON-RPC method. Complete guide on how to use the bb_getTickersList JSON-RPC method in the GetBlock Web3 documentation.

This method returns the fiat currencies for which the indexer has rate data available at a given timestamp.

Parameters

Parameter
Type
Required
Description

timestamp

integer

Yes

Unix timestamp for the requested currency list

Request

curl --location --request GET 'https://go.getblock.io/<ACCESS-TOKEN>/api/v2/tickers-list/?timestamp=1617180599'
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "bb_getTickersList",
    "params": [
        {
            "timestamp": 1617180599
        }
    ],
    "id": "getblock.io"
}'
example.js
const response = await fetch(
    'https://go.getblock.io/<ACCESS-TOKEN>/api/v2/tickers-list/?timestamp=1617180599'
);
console.log(await response.json());
example.py
import requests

response = requests.get('https://go.getblock.io/<ACCESS-TOKEN>/api/v2/tickers-list/?timestamp=1617180599')

print(response.json())

Response

{
    "ts": 1617180599,
    "available_currencies": [
        "usd",
        "eur",
        "gbp",
        "jpy",
        "btc"
    ]
}

Response Parameters

Field
Type
Description

ts

integer

Timestamp the currency list applies to

available_currencies

array

Fiat and crypto currency codes with rate data

error

string

Error text when no list is available

Use Cases

  • Currency Pickers: Populate a currency selector with supported codes

  • Rate Availability: Check which currencies have data before requesting rates

  • Localization: Offer only currencies the indexer can price

  • Validation: Confirm a requested currency is supported at a timestamp

Error Handling

Error Code
Message
Description

400 / -32602

Bad request

A query parameter has an invalid value

404 / -32603

Not found

No rate data exists for the requested currency or timestamp

500 / -32603

Internal error

The indexer failed to read rate data

Was this helpful?