Need Help Translating Obsolete API Code

2 replies 329 views
Posts: 15 · Reputation: 29
#1Aug 31, 2019, 02:18 PM
Hey everyone... I'm stuck trying to figure out some old code that uses an outdated API. Here’s the snippet: listfile="\n".join(f'wget -qO- https://chain.so/api/v2/get_tx_spent/BTC/{line.rstrip()[:]} > index.data' for line in myfile) Can anyone help me understand what data this is pulling from a block explorer? Like, is it getting transaction hashes or all transactions for a specific wallet?
5 Reply Quote Share
mr_apeNewbie
Posts: 401 · Reputation: 35
#2Aug 31, 2019, 07:21 PM
So, that v2 endpoint is no longer supported on chain.so. The `get_tx_spent` function was designed to get transactions tied to a specific address. It has been replaced by the `transactions` endpoint now. You can check the API docs for more info. The old responses included transaction hashes and details like amounts and signatures too.
4 Reply Quote Share
Posts: 15 · Reputation: 29
#3Aug 31, 2019, 10:06 PM
Thanks a lot, that makes sense! Now I can try to recreate that request using a different block explorer since chain.so wants $150 a month for access to their API key... What a hassle!
4 Reply Quote Share

Related topics