Skip to main content

Bitcoin Blocks API

The Blocks API returns block-level data on Bitcoin: height, difficulty, size, transaction count, and timestamp. Use it to drive explorer front-ends, monitor chain progression, or pull historical block context for mining and network analytics.

Endpoint

Bitcoin GraphQL queries are served at https://graphql.bitquery.io.

Get the 10 most recent Bitcoin blocks

Returns blocks ordered by height descending, with the timestamp formatted for display. Add a date filter to constrain the window.

query {
bitcoin(network: bitcoin) {
blocks(options: {desc: "height", limit: 10}, date: {after: "2023-10-10"}) {
timestamp {
time(format: "%Y-%m-%d %H:%M:%S")
}
height
difficulty
transactionCount
blockSizeBigInt
}
}
}

Use height: {is: N} to look up a single block, or height: {in: [N1, N2, ...]} for several at once. The same query shape works on other UTXO networks supported here by swapping network: bitcoin for litecoin, dogecoin, and others.

Find the busiest Bitcoin blocks by transaction count

Sort blocks by transactionCount descending to surface the busiest blocks on-chain — useful for network congestion studies and block utilization analysis.

query {
bitcoin(network: bitcoin) {
blocks(options: {limit: 10, desc: "transactionCount"}) {
timestamp {
time(format: "%Y-%m-%d %H:%M:%S")
}
difficulty
maximum(of: transaction_count, get: transaction_count)
transactionCount
}
}
}

Swap the sort to desc: "difficulty" or desc: "blockSizeBigInt" for different angles. Add date: {since: ..., till: ...} to search inside a specific window, or use average(of: transaction_count) for average transactions per block.

Build with Bitquery

Ready to run this in production?

Get an API key and run these queries in minutes, or talk to us about plans and enterprise delivery.