api/v2/multi-tickers - Bitcoin
Example code for the api/v2/multi-tickers REST method. Complete guide on how to use the api/v2/multi-tickers REST method in the GetBlock Web3 documentation.
This endpoint returns fiat rate tickers for a comma-separated list of Unix timestamps. Work and payload grow with the number of timestamps requested.
Parameters
timestamp
string
query
Yes
Comma-separated Unix timestamps
currency
string
query
No
Fiat currency code to return
token
string
query
No
Token symbol or contract key for token-specific rates
Request
curl --location --request GET 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/multi-tickers/?timestamp=1617180599,1617184199¤cy=usd'const response = await fetch(
'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/multi-tickers/?timestamp=1617180599,1617184199¤cy=usd'
);
console.log(await response.json());import requests
response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/multi-tickers/?timestamp=1617180599,1617184199¤cy=usd')
print(response.json())Response
[
{
"ts": 1617180599,
"rates": {
"usd": 512.34
}
},
{
"ts": 1617184199,
"rates": {
"usd": 514.1
}
}
]Response Parameters
ts
integer
Timestamp of the returned rate entry
rates
object
Map of currency codes to rates for the timestamp
Use Cases
Batch Valuation: Fetch rates for many points in one request
History Backfill: Attach fiat values across a transaction history at once
Charting: Build a fiat price series from multiple timestamps
Reporting: Value a period of activity with fewer requests
Error Handling
400
Bad request
A query parameter has an invalid value
404
Not found
No rate data exists for the requested query
500
Internal error
The indexer failed to read rate data
Was this helpful?