opreturn.net

API Documentation

opreturn.net provides a simple REST JSON API to programmatically retrieve blockchain data over HTTPS.
Supported blockchains include bitcoin (btc), litecoin (ltc), dogecoin (doge), and garlicoin (grlc).

Documentation to request data is below, along with code examples and the JSON response.
all, apikey, address, block, bestblockhash, blockchaininfo, blockheader, blocktimes, hash, mempool, network, peers, pubkey, transaction

Address
Note: Response may be slow for addresses with a large number of receive transactions.
Addresses with greater than 20000 receive transactions will not return transaction history.

GET Address

Endpoints
GET /api/[$coin]/addr/[$address]/
GET /api/[$coin]/addr/[$address]/[$verbose]/
GET /api/[$coin]/addr/[$address]/[$startblock]/[$endblock]/[$verbose]/

//Returns address information & transaction history
//If verbose is 0, address information includes array of receiving txids
//If verbose is 1, address information includes an Object of receiving transaction details (txid, vout, value, spend_block, spend_txid)
//If verbose is utxo, address information includes an Object of unspent outputs (txid, vout, value)
//If startblock and endblock are included, includes an Object of receiving transaction details received between startblock and endblock

[OPTIONS]
$coin (string): btc or ltc or doge or grlc
$address (string)
$verbose (boolean) or (string):
  0 returns "tx":["txid","txid","txid",...]
  1 returns "tx":[{"txid":"txid","vout":int,"value":int,"receive_block":int,"spend_block":int,"spend_txid":"txid"},{...}]
  utxo returns "utxo":[{"txid":str,"vout":int,"value":int,"receive_block":int},{...}]
$startblock (int): include transactions >= startblock
$endblock (int): include transactions <= endblock


Code example - get address

curl "https://opreturn.net/api/btc/addr/16S4PtXuabyc7qiPstBwFjpzyd8TBtc3G1/"

Response

{
    "coin": "btc",
    "cmd": "addr",
    "input": "16S4PtXuabyc7qiPstBwFjpzyd8TBtc3G1",
    "verbose": 0,
    "success": true,
    "addr": {
        "address": "16S4PtXuabyc7qiPstBwFjpzyd8TBtc3G1",
        "isvalid": true,
        "scriptpubkey": "76a9143b95dc9594dc60e4abfd4d60f5d3c73c783a34b888ac",
        "isscript": false,
        "iswitness": false,
        "receive_n": 1,
        "receive_sats": 2500000000,
        "spent_n": 1,
        "spent_sats": 2500000000,
        "unspent_n": 0,
        "unspent_sats": 0,
        "firstreceive_block": 131261,
        "firstreceive_time": 1308239013,
        "lastreceive_block": 131261,
        "lastreceive_time": 1308239013,
        "firstspend_block": 131503,
        "firstspend_time": 1308350016,
        "lastspend_block": 131503,
        "lastspend_time": 1308350016,
        "tx": [
            "e2d0a317b8e6c9e0160f44a4e412dcc86e4f92bfe94ef7a41f715f9be8170c3d"
        ]
    }
}
Code example - get address (verbose)

curl "https://opreturn.net/api/btc/addr/16S4PtXuabyc7qiPstBwFjpzyd8TBtc3G1/1/"

Response

{
    "coin": "btc",
    "cmd": "addr",
    "input": "16S4PtXuabyc7qiPstBwFjpzyd8TBtc3G1",
    "verbose": 1,
    "success": true,
    "addr": {
        "address": "16S4PtXuabyc7qiPstBwFjpzyd8TBtc3G1",
        "isvalid": true,
        "scriptpubkey": "76a9143b95dc9594dc60e4abfd4d60f5d3c73c783a34b888ac",
        "isscript": false,
        "iswitness": false,
        "receive_n": 1,
        "receive_sats": 2500000000,
        "spent_n": 1,
        "spent_sats": 2500000000,
        "unspent_n": 0,
        "unspent_sats": 0,
        "firstreceive_block": 131261,
        "firstreceive_time": 1308239013,
        "lastreceive_block": 131261,
        "lastreceive_time": 1308239013,
        "firstspend_block": 131503,
        "firstspend_time": 1308350016,
        "lastspend_block": 131503,
        "lastspend_time": 1308350016,
        "tx": [
            {
                "txid": "e2d0a317b8e6c9e0160f44a4e412dcc86e4f92bfe94ef7a41f715f9be8170c3d",
                "vout": 1,
                "value": 2500000000,
                "receive_block": 131261,
                "spend_block": 131503,
                "spend_txid": "c2f144a42ccad0e1c3ce76c8ec45ebb10f4a2a35021b183decf76cd636b6725c"
            }
        ]
    }
}