bb_getBalanceHistory - Bitcoin Cash
Example code for the bb_getBalanceHistory JSON-RPC method. Complete guide on how to use the bb_getBalanceHistory JSON-RPC method in the GetBlock Web3 documentation.
Parameters
Parameter
Type
Required
Description
Request
curl --location --request GET 'https://go.getblock.io/<ACCESS-TOKEN>/api/v2/balancehistory/bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a?from=1617100000&to=1617300000&fiatcurrency=usd'curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "bb_getBalanceHistory",
"params": [
"bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a",
{
"from": 1617100000,
"to": 1617300000,
"fiatcurrency": "usd"
}
],
"id": "getblock.io"
}'const response = await fetch(
'https://go.getblock.io/<ACCESS-TOKEN>/api/v2/balancehistory/bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a?from=1617100000&to=1617300000&fiatcurrency=usd'
);
console.log(await response.json());import requests
response = requests.get('https://go.getblock.io/<ACCESS-TOKEN>/api/v2/balancehistory/bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a?from=1617100000&to=1617300000&fiatcurrency=usd')
print(response.json())Response
[
{
"time": 1617177600,
"txs": 1,
"received": "9407625",
"sent": "0",
"sentToSelf": "0",
"rates": {
"usd": 512.34
}
}
]Response Parameters
Field
Type
Description
Use Cases
Error Handling
Error Code
Message
Description
Was this helpful?