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.