I am wondering how I can find the transaction that spends a specific output (for a large number of transactions). So for example, I have a transaction like the following: https://www.blockchain.com/btc/tx/ebd4a554faff31dd2a07135913fa073012a4495b195c1a5d5a9a7bca3e88de61. It has two outputs which are both spent. I would like to find the transaction that spends that output. Blockchain.com has a link to the spending transaction via the tx index (https://www.blockchain.com/btc/tx-index/355543195). However, they do not offer this an API endpoint and just in the GUI. I was wondering if there exists an API that offers to find the transaction via either the tx-index or other means.
Background I just started doing research on the lightning network and I was interested in the closing of channels. In particular, I took a snapshot of the lightning network in January from https://graph.lndexplorer.com/api/graph and scan all the channel transactions to see if the channel is closed. If the channel is closed I want to know if it was a mutual close, unilateral close, or a disputed unilateral close (an old commitment tx which should have a revocation tx following the commitment tx on the chain). Since the dataset has around 16.000 channels, I need an automated way of parsing through the transactions.