1

This question already has an answer here:

I'm looking for a way to query all transactions related to a particular bitcoin address - I periodically need to find all transactions for numerous addresses.

I've seen info about bitcoind searchrawtransactions, although it looks like this may no longer be supported?

Any recommendations?

marked as duplicate by Raghav Sood, JBaczuk, 0xb10c, chytrik, cdecker Aug 20 '18 at 9:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

To use getrawtransaction to lookup any transaction, you have to have the -txindex flag set, so that all transactions are indexed. But, you have to know the txid.

getrawtransaction "txid" ( verbose "blockhash" )

NOTE: By default this function only works for mempool transactions. If the -txindex option is
enabled, it also works for blockchain transactions. If the block which contains the transaction
is known, its hash can be provided even for nodes without -txindex. Note that if a blockhash is
provided, only that block will be searched and if the transaction is in the mempool or other
blocks, or if this node does not have the given block available, the transaction will not be found.

I would recommend using an api such as blockchain.info

Single Address

  • https://blockchain.info/rawaddr/$bitcoin_address
  • Address can be base58 or hash160

  • Optional limit parameter to show n transactions e.g. &limit=50 (Default: 50, Max: 50)

  • Optional offset parameter to skip the first n transactions e.g. &offset=100 (Page 2 for limit 50)

{ "hash160":"660d4ef3a743e3e696ad990364e555c271ad504b", "address":"1AJbsFZ64EpEfS5UAjAfcUG8pH8Jn3rn1F", "n_tx":17, "n_unredeemed":2, "total_received":1031350000, "total_sent":931250000, "final_balance":100100000, "txs":[--Array of Transactions--] }

What you want is in the txs property of the returned json object.

  • Thanks for the info, but i’d prefer not to rely on a third party, i’m looking to do this in-house. Also, I will have not have the txids, I’ll need to query with the address as the parameter – sizzlecookie Aug 6 '18 at 20:59
  • Then I think you'll have to write your own block parsing scripts to search the entire blockchain. – JBaczuk Aug 6 '18 at 22:06

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