api/v2/address - Bitcoin

This endpoint returns balance and transaction data for a single Bitcoin address. The details query parameter controls how much data is returned, from a balance-only summary to full transaction objects.

Parameters

ParameterTypeLocationRequiredDescription
addressstringpathYesThe Bitcoin address to query
pageintegerqueryNo1-based page index for transaction history. Default 1
pageSizeintegerqueryNoHistory items per page. Default and maximum is 1000
fromintegerqueryNoFirst block height to include when filtering history
tointegerqueryNoLast block height to include when filtering history
detailsstringqueryNoDetail level: basic, txids, txslight, or txs. Default txids
filterstringqueryNoFilter history by input or output side of the address
secondarystringqueryNoSecondary fiat currency code for converted values

Request

bashcurl --location --request GET 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/address/bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq?page=1&pageSize=1000&details=txids'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/address/bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq?page=1&pageSize=1000&details=txids'
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/address/bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq?page=1&pageSize=1000&details=txids')

print(response.json())

Response

json{
    "page": 1,
    "totalPages": 1,
    "itemsOnPage": 1000,
    "address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq",
    "balance": "9407625",
    "totalReceived": "45231890",
    "totalSent": "35824265",
    "unconfirmedBalance": "0",
    "unconfirmedTxs": 0,
    "txs": 5,
    "txids": [
        "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
        "6a3e1f2b8c9d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091"
    ]
}

Response Parameters

FieldTypeDescription
addressstringThe queried address
balancestringConfirmed balance in satoshis
totalReceivedstringTotal received in satoshis
totalSentstringTotal sent in satoshis
unconfirmedBalancestringUnconfirmed balance in satoshis
txsintegerNumber of confirmed transactions
txidsarrayTransaction ids, present when details is txids
transactionsarrayFull transaction objects, present when details is txs

Use Cases

  • Balance Display: Show the confirmed and unconfirmed balance of an address
  • History Pages: Page through an address's transaction ids or full transactions
  • Payment Detection: Detect incoming payments by watching an address balance
  • Accounting: Read total received and sent for bookkeeping
  • Block Filtering: Restrict history to a block-height range with from and to

Error Handling

HTTP StatusMessageDescription
400Bad requestThe address is malformed or not a valid Bitcoin address
404Not foundNo indexed data exists for the requested address
500Internal errorThe indexer failed to read address data