Post
Topic
Board Development & Technical Discussion
Re: How to determine the sender of BTC through an API
by
lucasholder
on 22/04/2020, 12:23:23 UTC
Thank you so much and our reply was helpful. However, assuming I wanted using a script on chron, to check for transations in my wallet from an address, can that be possible?
You could, for example, hit Blockcypher's address API endpoint[1] to get the latest transaction and then use it to hit the endpoint posted above to get the data you need. Then do the rest of the handling on your code.

[1] https://api.blockcypher.com/v1/btc/main/addrs/1ArgjWtWL8a2yshyeJUqtTtqgqKpZFGst5

the main problem is parsing the JSON response that the API sends back which would require additional libraries that are designed to do that, and i don't think it is possible to do this with a simple script.

If you're writing a shell script, you can use the jq tool for parsing the response and extracting the field(s) you want: https://stedolan.github.io/jq/tutorial/