The blockchain.info API allows for querying information about a particular Transaction by its ID. But if you want to follow the coins to the next transaction, I'm not seeing what the next query should be.

Each "out" of the transaction has an address associated with it, and you can query for details about a address' recent transactions. But if you're exploring deep in the past, the most recent 50 transactions for a given address won't have the spend for that particular "out".

So is there another API out there that allows you to query Transaction details based on "has transaction N as an 'in'"? Or do I need to go through the blockchain and make my own cache?

Edit: Blockchain.info clearly has the link to the transaction that spends a given output in their database, since the HTML view of a transaction now has "spent" tags after outputs that have been spent, which are links to the next transaction. However, that particular bit of data is not in the API view of the same transaction.

3 Answers 3


The raw transaction info includes the Unspent Transaction Out (UTXO) which is the link to each of the components of the spend:

  • I'm not looking for the unspent ones, I'm looking for the spent ones. And either way, I'm not seeing a "utxo" field in the raw transaction output; for example, TX 68491522 has two spent outputs, and you can click "spent" next to each in the HTML version to see the next in the chain. However, looking at the raw version, that data doesn't have any links like you're describing that I can see. Commented Apr 26, 2013 at 15:32

Ancient question but it is still relevant today...

With many blockchain APIs, there is unfortunately no way to query "which transaction spent this output?".

The most efficient alternative is to download all transaction history for the output address, and parse every transaction, looking for one that spends the output in question.


You have to go through the blockchain and create your own cache. I don't know of any service available that allows you to run a query like this on their API. Too many people use blockchain.info anyway, so it would be valuable to have other entities providing their data to the network.

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.