# Query all BTC transactions where address is in inputs OR outputs

**URL:** <https://community.bitquery.io/t/query-all-btc-transactions-where-address-is-in-inputs-or-outputs/925>\
**Category:** GraphQL API\
**Tags:** closed\
**Created:** [March 23, 2022, 5:52pm UTC](https://community.bitquery.io/t/query-all-btc-transactions-where-address-is-in-inputs-or-outputs/925 "2022-03-23T17:52:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evan\_GW](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@Evan\_GW](https://community.bitquery.io/u/Evan_GW)\
**Post date:** [March 23, 2022, 5:52pm UTC](https://community.bitquery.io/t/query-all-btc-transactions-where-address-is-in-inputs-or-outputs/925/1 "2022-03-23T17:52:32Z")

</div>

Hello,

I am looking to make a query that will get all BTC transactions where an address appears in either the inputs or the outputs. So far I have a query that looks like the one below, however this query is all transactions where the address apears in the inputs AND outputs. Any Idea on how to do ‘OR’ condition filters?

My current incorrect Query:

query MyQuery {  
bitcoin(network: bitcoin) {  
transactions(  
inputAddress: {in: “bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh”}  
outputAddress: {in: “bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh”}  
) {  
hash  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![aman](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@aman](https://community.bitquery.io/u/aman)\
**Post date:** [March 25, 2022, 4:25am UTC](https://community.bitquery.io/t/query-all-btc-transactions-where-address-is-in-inputs-or-outputs/925/2 "2022-03-25T04:25:56Z")

</div>

You can try running a similar query [All transactions for Bitcoin address](https://graphql.bitquery.io/ide/yjnh98O6So). I hope this helps you solve your problem.

Other queries:

1. [inbound-btc](https://graphql.bitquery.io/ide/inbound-btc)
2. [outbound-btc](https://graphql.bitquery.io/ide/outbound-btc)
