<p>You can use <a href="https://github.com/edmlbox/.Net-Bitcoin-RPC" rel="nofollow noreferrer">Net-Bitcoin-RPC</a> c# library to connect to your node and get the address.</p>
<pre><code>BitcoinClient bitcoinClient = new BitcoinClient(&quot;http://127.0.0.1:8333&quot;, &quot;alice:pass&quot;);
Wallet wallet = new Wallet(bitcoinClient);

//Optional.
AddressType addressType = AddressType.bech32;

//Optional.
string label = &quot;best address&quot;;

string getnewaddress = await wallet.GetNewAddress(label, addressType);

Console.WriteLine(getnewaddress);  
</code></pre>

CC BY-SA 4.0
2020-08-29T07:34:19.080Z
2020-08-29T07:34:19.080Z
Ernes Ernes
<p>I want to build an API to query an arbitrary bitcoin address for received transactions. The address is not necessarily associated with my wallet. Is this possible using the commands in <code>bitcoin-cli</code>?</p>
<p>I do not want to rely on a third party service like <code>blockchain.com</code> Though a public code library would be fine.</p>

<api>
How can I build my own get address transactions API?
Mike
# How can I build my own get address transactions API?

(Asked by: username_0 on 2020-08-28)

I want to build an API to query an arbitrary bitcoin address for received transactions. The address is not necessarily associated with my wallet. Is this possible using the commands in `bitcoin-cli`?

I do not want to rely on a third party service like `blockchain.com` Though a public code library would be fine.

**Tags:** api


---

## 1 answers

### Answer by username_1 on 2020-08-29. Score: 0

You can use [Net-Bitcoin-RPC](https://github.com/edmlbox/.Net-Bitcoin-RPC) c# library to connect to your node and get the address.

```
BitcoinClient bitcoinClient = new BitcoinClient("http://127.0.0.1:8333", "alice:pass");
Wallet wallet = new Wallet(bitcoinClient);

//Optional.
AddressType addressType = AddressType.bech32;

//Optional.
string label = "best address";

string getnewaddress = await wallet.GetNewAddress(label, addressType);

Console.WriteLine(getnewaddress);  

```


---

