The Chain.com API offers functionality for returning OP_RETURN data by:
- Address
- TxID
- Block height
The JSON return data from the REST API has a text field which is meant to be the decoded hex data sent (ie 6a``hex data) but it’s returned in the format \\x``hex data.
In Python you can simply do this:
import __future__
import requests; from binascii import unhexlify
rdata = requests.get("https://api.chain.com/v2/bitcoin/addresses/%s/op-returns?api-key-id=DEMO-4a5e1e4" % "1Bj5UVzWQ84iBCUiy5eQ1NEfWfJ4a3yKG1") # substitute URL here
assert rdata.status_code == 200
jdata = rdata.json()
hexdata = [unhexlify(str(t["text"]).encode("utf-8"))) for t in jdata
print(hexdata)









