inputs and outputs of bitcoin address

Returns 10 outputs and inputs on Bitcoin, where output address is bc1q7c…pemf, input address is bc1q7c…pemf and date since 2023-06-05, sorted by block height transaction index, highest first: block height, timestamp time, transaction hash, output index, output direction, value, output transaction hash and 3 more fields.

By gaurav · saved 12 June 2023 · run 2 times · Bitquery API v1

What it returns

Filters

The query

query ($network: BitcoinNetwork!, $address: String!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {
  bitcoin(network: $network) {
    inflows: outputs(
      date: {since: $from, till: $till}
      outputAddress: {is: $address}
      options: {desc: ["block.height", "outputIndex"], limit: $limit, offset: $offset}
    ) {
      block {
        height
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
      }
      transaction {
        hash
      }
      outputIndex
      outputDirection
      value
      value_usd: value(in: USD)
    }
    outflow: inputs(
      date: {since: $from, till: $till}
      inputAddress: {is: $address}
      options: {desc: ["block.height", "transaction.index"], limit: $limit, offset: $offset}
    ) {
      block {
        height
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
      }
      outputTransaction {
        hash
        index
      }
      transaction {
        hash
        index
      }
      inputIndex
      value
      value_usd: value(in: USD)
    }
  }
}

Variables

{
  "limit": 10,
  "offset": 0,
  "address": "bc1q7cyrfmck2ffu2ud3rn5l5a8yv6f0chkp0zpemf",
  "network": "bitcoin",
  "from": "2023-06-05",
  "till": "2023-06-12T23:59:59",
  "dateFormat": "%Y-%m-%d"
}

Similar queries