The Coin Secrets API enables OP_RETURN transactions to be retrieved from the bitcoin or testnet blockchains, as well as unconfirmed transactions from the memory pool. The API also parses the content of the OP_RETURNs for display in a similar way to the Coin Secrets website.
Use regular HTTP GET requests to one of the following URL forms:
353197is a bitcoin block number.
http://api.coinsecrets.org/mempoolfor the bitcoin memory pool.
350145is a bitcoin testnet block number.
http://api-testnet.coinsecrets.org/mempoolfor the bitcoin testnet memory pool.
Responses are in JSON format. Assuming no error occurred, the top-level object of the response will contain
timestamp fields, which indicate the requested block height and the timestamp inside that block header. (These fields will be
null for mempool requests.) There will also be a field named
op_returns, containing an array of information about OP_RETURNs. Each item in this array contains the following fields:
txid– the transaction's hexadecimal bitcoin transaction ID (txid).
txoffset– the byte offset of the transaction within the block (
nullfor mempool requests).
script– the full hexadecimal script of the OP_RETURN output.
hex– the hexadecimal data embedded within the output, i.e. with the OP_RETURN and data length opcodes removed.
ascii– the ASCII representation of the OP_RETURN data, with non-ASCII characters converted to
protocols– a list of detected protocols. For each protocol, the
displaycontent is provided where available.
Please be sensible and send no more than one request per second. We want to keep this open without authentication for as long as possible.
Thanks and enjoy!