# Get transaction input and output address when filtering for both in OR condition

**URL:** <https://community.bitquery.io/t/get-transaction-input-and-output-address-when-filtering-for-both-in-or-condition/2122>\
**Category:** GraphQL API\
**Created:** [October 24, 2024, 10:09am UTC](https://community.bitquery.io/t/get-transaction-input-and-output-address-when-filtering-for-both-in-or-condition/2122 "2024-10-24T10:09:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![franz](https://avatars.discourse-cdn.com/v4/letter/f/c37758/32.png) [@franz](https://community.bitquery.io/u/franz)\
**Post date:** [October 24, 2024, 10:09am UTC](https://community.bitquery.io/t/get-transaction-input-and-output-address-when-filtering-for-both-in-or-condition/2122/1 "2024-10-24T10:09:22Z")

</div>

I have a query that fetch transactions for a specific address. I managed to create the filter in OR condition, so that inputAddress OR outputAddress must match the given one.  
That works but it seems it misses the information about the address. I would like to fetch the inputAddress and outputAddress to understand where the filter did the match, but those fields are unavailable in the transactions API. I need some other field that helps me to understand the direction ofr the transaction, if the given wallet was in input or in output.  
This is my query

```auto
query ($network: BitcoinNetwork!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime, $address: String!) {
  bitcoin(network: $network) {
    transactions(
      options: {desc: ["block.height", "index"], limit: $limit, offset: $offset}
      any: [{inputAddress: {is: $address}}, {outputAddress: {is: $address}}]
    ) {
      block(time: {since: $from, till: $till}) {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      inputValue
      outputValue
      index
      hash
      feeValue
      txCoinbase
      fee_value_usd: feeValue(in: USD)
      minedValue
      outputCount
      inputCount
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Divya](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Divya](https://community.bitquery.io/u/Divya)\
**Post date:** [October 25, 2024, 10:55am UTC](https://community.bitquery.io/t/get-transaction-input-and-output-address-when-filtering-for-both-in-or-condition/2122/2 "2024-10-25T10:55:34Z")

</div>

Looks like Coinpath is the API for what you are asking.

Coinpath like the name says traces the path b/w two addresses, even if they’re connected 4-5 levels deep.

Check sample query [bitcoin coinpath example - Blockchain Data API](https://ide.bitquery.io/bitcoin-coinpath-example)

More docs on how coinapth works [Bitquery V1 API Documentation | Blockchain Data API (V1 Docs)](https://docs.bitquery.io/v1/docs/building-queries/Coinpath-Explained/How_to_read_coinpath_graph)

> **[Bitquery V1 API Documentation | Blockchain Data API (V1 Docs)](https://docs.bitquery.io/v1/docs/Examples/bitcoin/Bitcoin-Coinpath-API)**
>
> Blockchain APIs documentation for querying transactions, balances, transfers, NFTs, tokens, Dex trades, Smart contract calls, events, and much more. We support 40+ blockchains, including Bitcoin, Ethereum, Solana, Polygon, Arbitrum, Optimism, etc.
