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

<ul>
<li><a href="http://blockchain.info/rawtx/" rel="nofollow">http://blockchain.info/rawtx/</a>$tx_index</li>
</ul>

CC BY-SA 3.0
2013-04-26T15:32:54.427Z
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](http://blockchain.info/tx-index/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](http://blockchain.info/rawtx/68491522), that data doesn't have any links like you're describing that I can see.
MidnightLightning
CC BY-SA 3.0
2013-04-26T08:49:10.850Z
2013-04-26T08:49:10.850Z
Stephen Gornick
<p>Ancient question but it is still relevant today...</p>

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

<p>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.</p>

CC BY-SA 4.0
2018-11-29T03:28:50.033Z
2018-11-29T03:28:50.033Z
Mark Lundeberg
<p>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.</p>

CC BY-SA 3.0
2013-10-23T17:53:58.967Z
2013-10-23T17:53:58.967Z
bvpx
<p>The <a href="http://blockchain.info/api/blockchain_api" rel="nofollow">blockchain.info API</a> 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.</p>

<p>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".</p>

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

<p><strong>Edit:</strong> 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.</p>

<transactions><api><blockchain.info>
Get transaction that spent a transaction id
MidnightLightning
# Get transaction that spent a transaction id

(Asked by: username_0 on 2013-02-26)

The [blockchain.info API](http://blockchain.info/api/blockchain_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.

**Tags:** transactions, api, blockchain.info


---

## 3 answers

### Answer by username_1 on 2013-04-26. Score: 0

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

* <http://blockchain.info/rawtx/>$tx\_index

> **Comments:**
> **username_0**: 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](http://blockchain.info/tx-index/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](http://blockchain.info/rawtx/68491522), that data doesn't have any links like you're describing that I can see.  

---

### Answer by username_2 on 2018-11-29. Score: 0

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.


---

### Answer by username_3 on 2013-10-23. Score: -1

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.


---

