Skip to main content

Bitcoin Fee API

Query Bitcoin transaction fees at the per-transaction level or aggregated across an address or time window — in BTC and USD. Use it for fee estimation, wallet expense tracking, and historical fee trend analysis.

Endpoint

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

List Bitcoin transactions with per-tx fees in BTC and USD

Pulls transactions for a specific address on a given day with per-transaction fee amounts (BTC and USD), input/output values, and counts. Run query.

query MyQuery {
bitcoin(network: bitcoin) {
transactions(
options: {limit: 10, desc: ["block.height"]}
date: {is: "2025-05-08"}
inputAddress: {is: "bc1qrtjvr4d8qtstw5334mspp7rmrzl55uj3dcwj09"}
) {
block {
timestamp {
iso8601
}
height
}
feeValue
feeInUSD: feeValue(in: USD)
feeValueDecimal
hash
index
inputValue
inputCountBigInt
inputCount
outputValueDecimal
outputValue
outputCountBigInt
outputCount
inputValueDecimal
}
}
}

Drop the inputAddress filter to see fees across all transactions, add date: {since: ..., till: ...} for a window, or sort by feeValue to surface the highest-fee transactions first.

Sum total Bitcoin fees paid by an address on a single day

Aggregate total fees paid by an address with feeValue(calculate: sum) in both BTC and USD. Run query.

query MyQuery {
bitcoin(network: bitcoin) {
transactions(
date: {is: "2025-05-08"}
inputAddress: {is: "bc1qrtjvr4d8qtstw5334mspp7rmrzl55uj3dcwj09"}
) {
total_fees_in_usd: feeValue(calculate: sum, in: USD)
total_fees: feeValue(calculate: sum)
}
}
}

Change date to a range for multi-day totals, drop inputAddress for a network-wide aggregate, or add feeValue(calculate: average) for average fee per transaction.

Video tutorial: getting Bitcoin transaction fee data

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.