1

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.

2 Answers 2

1

You can use NBXplorer: https://github.com/dgarage/NBXplorer/blob/master/docs/API.md#address-transactions

How to setup NBXplorer? https://youtu.be/a5ehSfzYkJo

Requirements: Bitcoin Core and .NET Core SDK

0

You can use 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);  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.