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

API Key
API requests without an apikey are limited to 500 calls in a 24-hour rolling period. To increase this limit, submit an apikey request at the request form below, and we'll provide an apikey for 2000 API calls per 24-hours.

https://opreturn.net/api/docs/requestapikey/
Use your apikey with the request header [apikey: $value]

["http" => ["method" => "GET", "header" => ["Content-Type: application/json", "apikey: $private_apikey"]]]


Or use your apikey by adding it as a get variable at the end of the curl request

curl "https://opreturn.net/api/btc/blockchaininfo/?apikey=$value"



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"
            }
        ]
    }
}

Block

GET Block

Endpoints
GET /api/[$coin]/block/[$block]/
GET /api/[$coin]/block/[$block]/[$verbose]/

//If verbose is 0, returns a string that is serialized, hex-encoded data for block
//If verbose is 1, returns an Object with information about block
//If verbose is 2, returns an Object with information about block and information about each transaction

[OPTIONS]
$coin (string): btc or ltc or doge or grlc
$block (int) or (string): block height or block hash
$verbose (int):
  0 returns "block":"raw block hex" (string)
  1 returns "block":{decoded block} (object)
  2 returns "block":{decoded block {decoded transaction},{...}} (object)


Code example - get block

curl "https://opreturn.net/api/btc/block/00000000000002da292e12fce09c27f98b16540bbc6ad31acf25aa2e94de3a2a/"

Response

{
    "coin": "btc",
    "cmd": "block",
    "input": "00000000000002da292e12fce09c27f98b16540bbc6ad31acf25aa2e94de3a2a",
    "verbose": false,
    "success": true,
    "block": "0100000063bdb5f061991bb26992fe1ed191d72ec1b72b3e902e2b8413070000000000002e1aab9d9425e08f70ee921ee0d2665a937d11fcf13dd579e8e43f0e0de64a458a50684f87320b1ac23930790301000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0f0487320b1a02f500062f503253482fffffffff0100f2052a01000000434104aed9647950bd053c9816e060a07e408ef072c786c4ebee66d955be7f0e15c91ef1f98e974e15a6cbc29434996b27eb846bcc8c647dfcf7f6e9f550bffbd8f611ac0000000001000000057866578d513e190e32444c55bb4843726af6b2a6cd1241c2af87a98db7cfe841000000008c493046022100bce110e972a1d613040f6edb478196ee3388efaa3b95488e792efc277576d838022100d7216ec0e3753c794cd74e1258aff30360b20c364941f8a29d662bdc2b1d889d0141048834bf51a9ad25c860912d7484d3589a1f4773a8f78074f6b86306c3abc7e095e0fcdb1e4e0974a700cfc09dfef508d12981f9801d90c0bf8b8be5db4757d9efffffffff0acf4f12fc31dd2f6e9ec064658d104a89cdf2b73102031a4abb244ff554ddcd000000008a4730440220289577d35bdb1d548a5dc3b499154a74b5716247717895e7a4df544d89d53cdd0220617f390423109483d73da9eb87f23b3e44c346565ed1082d986124d1f667325a0141044d52ed4c89155e5702523fd5d8d54232391045443667ee4d053bd268a095e67dad1ecf606543fb82b9418a4188dfabcdfbf1d8fb9f2aeee779498687dae8dcd2ffffffff396294b1067800ac5251c7073a8269dc53989dab3072042577ce0b3f504f50a5010000008b483045022100caa289cb853c98f8613fe1ac8bcb8dc741dcb5a06f0a415f39356d022374baaf02200c495802ef2dbaab21effb2d665ffec254df82964780a77d9ebd4a2deaa78a230141049bf08e9503b01a802f8fb268b1446a61c1162345c0d63467a967386f667b0fb2b6b48d2d09599436258c3d167ec0a22f172dc6441b031f4f5664245f12b778e2ffffffff0fb82803ca3d5255e0fc3f223ef214cfdaa81fe4ca930bde7d886920b1a9f0e0010000008a47304402204486bde38c44693c0c0f4a7293927fe515fe582b23ec149def65f58e7ae0bc9102201763f8f30408df5397bc2c32974485e868b10d5aac57cdc14f74963f66110bab01410463ff62d475803c4d8d7ecc74713dfeca073cccec914369cc18e44af50aca479cc746330f8cabd5b7b5c59a745144db5f06ec1e2cbcdc09cdaff619f10a46107bffffffff7bba45ed16240009ccb5105a225ca24fbd0873c27a01ecd77f0e0701d750d539010000008b483045022100a152f539d68adeb690d7c7de3595e8a6110b233eb80cc7fd397e98479ad6e4d9022019f947b1ca3a3b6e13ea9760dce2493a68c442976400494565953d1fb0d5d7b501410453ecdb6ae0647388d6b9d02bbd74df38642f4cc059e91618492cef7e80d8bada2311138a459b8a12162ab93d8bc17d6a739b9306a3c45e61d9ad89f759718121ffffffff0240420f00000000001976a914a5359215fc9ac4c26172e8cc10de4ec37386e41288acc0fadeac090000001976a91475c14976caa8e3a75fc896c77a7d62bdfcadf5ca88ac00000000010000000134006790638c84d5d21b1937ef9b592db61eed08ad63fd0ff49cad47880bf1e5010000008b48304502203cca6c62043e6a03d6c97794243b6a73d2e7060b942f1f48b7cdb7f20d5706d7022100b1b40748958f5fdae18faea3405f3205baf03d0b4ed648ed98f9ed96f7b3c92f01410406a593ce98d71b7e6b364778541188fd96ba598ef659aaf66ec1e31ead44b22d943c6c5197a936024946b816cc15a3230cfe895d8f95c6e8fccf3f533a234a59ffffffff02c0cf6a00000000001976a914d4c85bbc0d9a7c951ff58e08c3bf12377c405fdd88acc0f35e01000000001976a914f82a1c525bf29ae328c2dcfc2ab3e2f6791083b988ac00000000"
}
Code example - get block (verbose)

curl "https://opreturn.net/api/btc/block/00000000000002da292e12fce09c27f98b16540bbc6ad31acf25aa2e94de3a2a/1/"

Response

{
    "coin": "btc",
    "cmd": "block",
    "input": "00000000000002da292e12fce09c27f98b16540bbc6ad31acf25aa2e94de3a2a",
    "verbose": true,
    "success": true,
    "block": {
        "hash": "00000000000002da292e12fce09c27f98b16540bbc6ad31acf25aa2e94de3a2a",
        "confirmations": 695516,
        "height": 172008,
        "version": 1,
        "versionHex": "00000001",
        "merkleroot": "454ae60d0e3fe4e879d53df1fc117d935a66d2e01e92ee708fe025949dab1a2e",
        "time": 1332236426,
        "mediantime": 1332235505,
        "nonce": 2033203650,
        "bits": "1a0b3287",
        "difficulty": 1498294.3628165,
        "chainwork": "00000000000000000000000000000000000000000000000e93e9237f21d5601d",
        "nTx": 3,
        "previousblockhash": "0000000000000713842b2e903e2bb7c12ed791d11efe9269b21b9961f0b5bd63",
        "nextblockhash": "000000000000057cdd86869938763f1582bdcd68bd6b3086c648357306a21953",
        "strippedsize": 1458,
        "size": 1458,
        "weight": 5832,
        "tx": [
            "9fd96876245e3d68e9d3587191c435ca445ecdec1831c5ebbd795fad03102392",
            "efd762416ac867e64fd480b43978f5c5fc60742befe1900c2c175477445ec4e9",
            "d38ff6587f43cea5a399462bc735920f30073bbe06b5d7df5154196c5dd8d637"
        ]
    }
}

Bestblockhash

GET Bestblockhash

Endpoint
GET /api/[$coin]/bestblockhash/

//Returns the hash of the best (tip) block in the most-work fully-validated chain

[OPTIONS]
$coin (string): btc or ltc or doge or grlc


Code example - get bestblockhash

curl "https://opreturn.net/api/btc/bestblockhash/"

Response

{
    "coin": "btc",
    "cmd": "bestblockhash",
    "success": true,
    "bestblockhash": "0000000000000000000256864e7d17665e891d6a3619f97221ffad764d020157"
}

Blockchaininfo

GET Blockchaininfo

Endpoint
GET /api/[$coin]/blockchaininfo/

//Returns an object containing various state info regarding blockchain processing

[OPTIONS]
$coin (string): btc or ltc or doge or grlc


Code example - get blockchaininfo

curl "https://opreturn.net/api/btc/blockchaininfo/"

Response

{
    "coin": "btc",
    "cmd": "blockchaininfo",
    "success": true,
    "blockchaininfo": {
        "chain": "main",
        "blocks": 868780,
        "headers": 868780,
        "bestblockhash": "0000000000000000000256864e7d17665e891d6a3619f97221ffad764d020157",
        "difficulty": 95672703408224,
        "time": 1730691862,
        "mediantime": 1730689853,
        "verificationprogress": 0.99999917034785,
        "initialblockdownload": false,
        "chainwork": "00000000000000000000000000000000000000009807828d5acec9b657515eea",
        "size_on_disk": 695652263555,
        "pruned": false,
        "warnings": ""
    }
}

Blockheader

GET Blockheader

Endpoints
GET /api/[$coin]/blockheader/[$block]/
GET /api/[$coin]/blockheader/[$block]/[$verbose]/

//If verbose is 0, returns a string that is serialized, hex-encoded data for blockheader
//If verbose is 1, returns an Object with information about blockheader

[OPTIONS]
$coin (string): btc or ltc or doge or grlc
$block (int) or (string): block height or block hash
$verbose (boolean):
  0 returns "block":"raw blockheader hex" (string)
  1 returns "block":{decoded blockheader} (object)


Code example - get blockheader

curl "https://opreturn.net/api/btc/blockheader/00000000000002da292e12fce09c27f98b16540bbc6ad31acf25aa2e94de3a2a/"

Response

{
    "coin": "btc",
    "cmd": "blockheader",
    "input": "00000000000002da292e12fce09c27f98b16540bbc6ad31acf25aa2e94de3a2a",
    "verbose": false,
    "success": true,
    "blockheader": "0100000063bdb5f061991bb26992fe1ed191d72ec1b72b3e902e2b8413070000000000002e1aab9d9425e08f70ee921ee0d2665a937d11fcf13dd579e8e43f0e0de64a458a50684f87320b1ac2393079"
}
Code example - get blockheader (verbose)

curl "https://opreturn.net/api/btc/blockheader/00000000000002da292e12fce09c27f98b16540bbc6ad31acf25aa2e94de3a2a/1/"

Response

{
    "coin": "btc",
    "cmd": "blockheader",
    "input": "00000000000002da292e12fce09c27f98b16540bbc6ad31acf25aa2e94de3a2a",
    "verbose": true,
    "success": true,
    "blockheader": {
        "hash": "00000000000002da292e12fce09c27f98b16540bbc6ad31acf25aa2e94de3a2a",
        "confirmations": 695516,
        "height": 172008,
        "version": 1,
        "versionHex": "00000001",
        "merkleroot": "454ae60d0e3fe4e879d53df1fc117d935a66d2e01e92ee708fe025949dab1a2e",
        "time": 1332236426,
        "mediantime": 1332235505,
        "nonce": 2033203650,
        "bits": "1a0b3287",
        "difficulty": 1498294.3628165,
        "chainwork": "00000000000000000000000000000000000000000000000e93e9237f21d5601d",
        "nTx": 3,
        "previousblockhash": "0000000000000713842b2e903e2bb7c12ed791d11efe9269b21b9961f0b5bd63",
        "nextblockhash": "000000000000057cdd86869938763f1582bdcd68bd6b3086c648357306a21953"
    }
}

Blockheight

GET Blockheight

Endpoint
GET /api/[$coin]/blockheight/

//Returns blockchain height

[OPTIONS]
$coin (string): btc or ltc or doge or grlc


Code example - get blockheight

curl "https://opreturn.net/api/btc/blockheight/"

Response

{
    "coin": "btc",
    "cmd": "blockheight",
    "success": true,
    "blockheight": 868780
}

Blocktimes

GET Blocktimes

Endpoint
GET /api/[$coin]/blocktimes/[$height]/

//Returns object array of block height, hash, time for 300 blocks, starting at provided height
//If height is greater than highest block, returns 300 most recent blocks

[OPTIONS]
$coin (string): btc or ltc or doge or grlc
$height (int): starting block height, set above current block height to get 300 most recent blocks


Code example - get blocktimes

curl "https://opreturn.net/api/btc/blocktimes/600000/"

Response

{
    "coin": "btc",
    "cmd": "blocktimes",
    "input": 600000,
    "success": true,
    "blocktimes": [
        {
            "height": 600000,
            "hash": "00000000000000000007316856900e76b4f7a9139cfbfba89842c8d196cd5f91",
            "time": 1571443461
        },
        {
            "height": 600001,
            "hash": "00000000000000000000817313d6b5fe4838ec6eff47fbe7c4b9f22a40c2a4f4",
            "time": 1571443613
        },
        {
            "height": 600002,
            "hash": "00000000000000000002447735c7723ee9188322c0938e6587866a4458b9135f",
            "time": 1571444075
        },
        {
            "...": "..."
        },
        {
            "height": 600299,
            "hash": "0000000000000000001402fa829a5aabeed3e7a5b691d6af4def1771b5b44663",
            "time": 1571624512
        }
    ]
}

Mempool

GET Mempool

Endpoint
GET /api/[$coin]/mempool/[$verbose]

//If verbose is 0, returns details on the active state of the memory pool
//If verbose is 1, returns array of txids in memory pool

[OPTIONS]
$coin (string): btc or ltc or doge or grlc
$verbose (boolean):


Code example - get mempool

curl "https://opreturn.net/api/btc/mempool/"

Response

{
    "coin": "btc",
    "cmd": "mempool",
    "verbose": 0,
    "success": true,
    "mempool": {
        "loaded": true,
        "size": 9756,
        "bytes": 3359042,
        "usage": 20769184,
        "total_fee": 0.05166626,
        "maxmempool": 50000000,
        "mempoolminfee": 1.0e-6,
        "minrelaytxfee": 1.0e-6,
        "incrementalrelayfee": 1.0e-5,
        "unbroadcastcount": 0,
        "fullrbf": false
    }
}

Network

GET Network

Endpoint
GET /api/[$coin]/network/

//Returns an object containing various state info regarding P2P networking

[OPTIONS]
$coin (string): btc or ltc or doge or grlc


Code example - get network

curl "https://opreturn.net/api/btc/network/"

Response

{
    "coin": "btc",
    "cmd": "network",
    "success": true,
    "network": {
        "version": 240001,
        "subversion": "\/Satoshi:24.0.1(opreturn.net)\/",
        "protocolversion": 70016,
        "localservices": "0000000000000409",
        "localservicesnames": [
            "NETWORK",
            "WITNESS",
            "NETWORK_LIMITED"
        ],
        "localrelay": true,
        "timeoffset": 0,
        "networkactive": true,
        "connections": 19,
        "connections_in": 9,
        "connections_out": 10,
        "networks": [
            {
                "name": "ipv4",
                "limited": false,
                "reachable": true,
                "proxy": "",
                "proxy_randomize_credentials": false
            },
            {
                "name": "ipv6",
                "limited": false,
                "reachable": true,
                "proxy": "",
                "proxy_randomize_credentials": false
            }
        ],
        "relayfee": 1.0e-6,
        "incrementalfee": 1.0e-5,
        "localaddresses": [
            {
                "address": "2601:640:cb7f:5530:40c1:9d7f:2602:e26d",
                "port": 8333,
                "score": 1
            }
        ],
        "warnings": ""
    }
}

Peers

GET Peers

Endpoint
GET /api/[$coin]/peers/

//Returns data about each connected network node as a json array of objects.

[OPTIONS]
$coin (string): btc or ltc or doge or grlc


Code example - get peers

curl "https://opreturn.net/api/btc/peers/"

Response

{
    "coin": "btc",
    "cmd": "peers",
    "success": true,
    "peers": [
        {
            "id": 0,
            "addr": "10.0.0.186:44666",
            "addrbind": "10.0.0.9:8333",
            "network": "not_publicly_routable",
            "services": "0000000000000409",
            "servicesnames": [
                "NETWORK",
                "WITNESS",
                "NETWORK_LIMITED"
            ],
            "lastsend": 1730691434,
            "lastrecv": 1730691434,
            "last_transaction": 0,
            "last_block": 0,
            "bytessent": 12504684332,
            "bytesrecv": 33667954,
            "conntime": 1726346642,
            "timeoffset": 0,
            "pingtime": 0.001813,
            "minping": 0.000365,
            "version": 70016,
            "subver": "\/Satoshi:22.0.0(opreturn.net)\/",
            "inbound": true,
            "bip152_hb_to": false,
            "bip152_hb_from": true,
            "startingheight": 861325,
            "presynced_headers": -1,
            "synced_headers": 861325,
            "synced_blocks": 861325,
            "inflight": [],
            "relaytxes": false,
            "minfeefilter": 0,
            "addr_relay_enabled": true,
            "addr_processed": 0,
            "addr_rate_limited": 0,
            "permissions": [],
            "bytessent_per_msg": {
                "addrv2": 1954893,
                "block": 15377038,
                "blocktxn": 12295946983,
                "cmpctblock": 188971675,
                "feefilter": 115360,
                "getheaders": 1053,
                "headers": 773,
                "ping": 1158176,
                "pong": 1158112,
                "sendaddrv2": 24,
                "sendcmpct": 33,
                "sendheaders": 24,
                "verack": 24,
                "version": 140,
                "wtxidrelay": 24
            },
            "bytesrecv_per_msg": {
                "getaddr": 24,
                "getblocktxn": 31349552,
                "getdata": 596,
                "getheaders": 1053,
                "headers": 106,
                "ping": 1158112,
                "pong": 1158176,
                "sendaddrv2": 24,
                "sendcmpct": 99,
                "sendheaders": 24,
                "verack": 24,
                "version": 140,
                "wtxidrelay": 24
            },
            "connection_type": "inbound"
        },
        {
            "...": "..."
        }
    ]
}

Pubkey

GET Pubkey

Endpoints
GET /api/[$coin]/pubkey/[$pubkey]/
GET /api/[$coin]/pubkey/[$pubkey]/[$verbose]/
GET /api/[$coin]/pubkey/[$pubkey]/[$startblock]/[$endblock]/[$verbose]/

//Returns pubkey information & transaction history
//If verbose is 0, pubkey information includes array of receiving txids
//If verbose is 1, pubkey information includes an Object of receiving transaction details (txid, vout, value, spend_block, spend_txid)
//If verbose is utxo, pubkey 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
$pubkey (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 pubkey (verbose)

curl "https://opreturn.net/api/btc/pubkey/024d57123256b2a84e6618bc12b08f81cd54ec79fcd7a55a129eee9402bac8d5f7/1/"

Response

{
    "coin": "btc",
    "cmd": "pubkey",
    "input": "024d57123256b2a84e6618bc12b08f81cd54ec79fcd7a55a129eee9402bac8d5f7",
    "verbose": 1,
    "success": true,
    "pubkey": {
        "pubkey": "024d57123256b2a84e6618bc12b08f81cd54ec79fcd7a55a129eee9402bac8d5f7",
        "compressed": 1,
        "pubkeyhash": "f4f5209eb5bce683a4a1dd325e22bdda6a31cf95",
        "isvalid": true,
        "scriptpubkey": "21024d57123256b2a84e6618bc12b08f81cd54ec79fcd7a55a129eee9402bac8d5f7ac",
        "address": "1PLDXZPhFEfGGxdXr54FxvWUvWcRCrjHEG",
        "isscript": 0,
        "note": "Any transaction history is for the raw pubkey only and not the derived P2PKH address",
        "receive_n": 1,
        "receive_sats": 5000000000,
        "spent_n": 1,
        "spent_sats": 5000000000,
        "unspent_n": 0,
        "unspent_sats": 0,
        "firstreceive_block": 163368,
        "firstreceive_time": 1327250584,
        "lastreceive_block": 163368,
        "lastreceive_time": 1327250584,
        "firstspend_block": 163519,
        "firstspend_time": 1327327338,
        "lastspend_block": 163519,
        "lastspend_time": 1327327338,
        "tx": [
            {
                "txid": "0e842d4d66bc1c30a88f17eefa1e3436c6524aca39e9ad358edf380daf7a49ab",
                "vout": 0,
                "value": 5000000000,
                "receive_block": 163368,
                "spend_block": 163519,
                "spend_txid": "40ec5c20d8eb34e96b72dda9773f030c254a4d687496c169082366e20e4059e7"
            }
        ]
    }
}

GET Transaction

GET Transaction

Endpoints
GET /api/[$coin]/tx/[$txid]/
GET /api/[$coin]/tx/[$txid]/[$verbose]/

//Returns transaction (serialized hex encoded) or decoded transaction

[OPTIONS]
$coin (string): btc or ltc or doge or grlc
$txid (string)
$verbose (boolean):
  0 returns "tx":"raw transaction hex" (string)
  1 returns "tx":{decoded transaction} (object)


Code example - get transaction

curl "https://opreturn.net/api/btc/tx/d38ff6587f43cea5a399462bc735920f30073bbe06b5d7df5154196c5dd8d637/"

Response

{
    "coin": "btc",
    "cmd": "tx",
    "input": "d38ff6587f43cea5a399462bc735920f30073bbe06b5d7df5154196c5dd8d637",
    "verbose": false,
    "success": true,
    "tx": "010000000134006790638c84d5d21b1937ef9b592db61eed08ad63fd0ff49cad47880bf1e5010000008b48304502203cca6c62043e6a03d6c97794243b6a73d2e7060b942f1f48b7cdb7f20d5706d7022100b1b40748958f5fdae18faea3405f3205baf03d0b4ed648ed98f9ed96f7b3c92f01410406a593ce98d71b7e6b364778541188fd96ba598ef659aaf66ec1e31ead44b22d943c6c5197a936024946b816cc15a3230cfe895d8f95c6e8fccf3f533a234a59ffffffff02c0cf6a00000000001976a914d4c85bbc0d9a7c951ff58e08c3bf12377c405fdd88acc0f35e01000000001976a914f82a1c525bf29ae328c2dcfc2ab3e2f6791083b988ac00000000"
}
Code example - get transaction (verbose)

curl "https://opreturn.net/api/btc/tx/d38ff6587f43cea5a399462bc735920f30073bbe06b5d7df5154196c5dd8d637/1/"

Response

{
    "coin": "btc",
    "cmd": "tx",
    "input": "d38ff6587f43cea5a399462bc735920f30073bbe06b5d7df5154196c5dd8d637",
    "verbose": true,
    "success": true,
    "tx": {
        "txid": "d38ff6587f43cea5a399462bc735920f30073bbe06b5d7df5154196c5dd8d637",
        "hash": "d38ff6587f43cea5a399462bc735920f30073bbe06b5d7df5154196c5dd8d637",
        "version": 1,
        "size": 258,
        "vsize": 258,
        "weight": 1032,
        "locktime": 0,
        "vin": [
            {
                "txid": "e5f10b8847ad9cf40ffd63ad08ed1eb62d599bef37191bd2d5848c6390670034",
                "vout": 1,
                "scriptSig": {
                    "asm": "304502203cca6c62043e6a03d6c97794243b6a73d2e7060b942f1f48b7cdb7f20d5706d7022100b1b40748958f5fdae18faea3405f3205baf03d0b4ed648ed98f9ed96f7b3c92f[ALL] 0406a593ce98d71b7e6b364778541188fd96ba598ef659aaf66ec1e31ead44b22d943c6c5197a936024946b816cc15a3230cfe895d8f95c6e8fccf3f533a234a59",
                    "hex": "48304502203cca6c62043e6a03d6c97794243b6a73d2e7060b942f1f48b7cdb7f20d5706d7022100b1b40748958f5fdae18faea3405f3205baf03d0b4ed648ed98f9ed96f7b3c92f01410406a593ce98d71b7e6b364778541188fd96ba598ef659aaf66ec1e31ead44b22d943c6c5197a936024946b816cc15a3230cfe895d8f95c6e8fccf3f533a234a59"
                },
                "sequence": 4294967295
            }
        ],
        "vout": [
            {
                "value": 0.07,
                "n": 0,
                "scriptPubKey": {
                    "asm": "OP_DUP OP_HASH160 d4c85bbc0d9a7c951ff58e08c3bf12377c405fdd OP_EQUALVERIFY OP_CHECKSIG",
                    "desc": "addr(1LQ6GowxrLyrRy1XLV3Bd1QMfLhwUHQZhC)#qe7077af",
                    "hex": "76a914d4c85bbc0d9a7c951ff58e08c3bf12377c405fdd88ac",
                    "address": "1LQ6GowxrLyrRy1XLV3Bd1QMfLhwUHQZhC",
                    "type": "pubkeyhash"
                }
            },
            {
                "value": 0.23,
                "n": 1,
                "scriptPubKey": {
                    "asm": "OP_DUP OP_HASH160 f82a1c525bf29ae328c2dcfc2ab3e2f6791083b9 OP_EQUALVERIFY OP_CHECKSIG",
                    "desc": "addr(1PdB2UNa2rWNdh7hRfiZnth2YT6QE7dmr9)#hp7mk7as",
                    "hex": "76a914f82a1c525bf29ae328c2dcfc2ab3e2f6791083b988ac",
                    "address": "1PdB2UNa2rWNdh7hRfiZnth2YT6QE7dmr9",
                    "type": "pubkeyhash"
                }
            }
        ],
        "hex": "010000000134006790638c84d5d21b1937ef9b592db61eed08ad63fd0ff49cad47880bf1e5010000008b48304502203cca6c62043e6a03d6c97794243b6a73d2e7060b942f1f48b7cdb7f20d5706d7022100b1b40748958f5fdae18faea3405f3205baf03d0b4ed648ed98f9ed96f7b3c92f01410406a593ce98d71b7e6b364778541188fd96ba598ef659aaf66ec1e31ead44b22d943c6c5197a936024946b816cc15a3230cfe895d8f95c6e8fccf3f533a234a59ffffffff02c0cf6a00000000001976a914d4c85bbc0d9a7c951ff58e08c3bf12377c405fdd88acc0f35e01000000001976a914f82a1c525bf29ae328c2dcfc2ab3e2f6791083b988ac00000000",
        "blockhash": "00000000000002da292e12fce09c27f98b16540bbc6ad31acf25aa2e94de3a2a",
        "confirmations": 695516,
        "time": 1332236426,
        "blocktime": 1332236426
    }
}


POST Transaction, broadcast to network

POST Transaction

Endpoint
POST /api/[$coin]/tx/post/
//Broadcast signed transaction to network

[OPTIONS]
$coin (string): btc or ltc or doge or grlc
method: POST
content: [tx: $signedtxhex]


Code example - post tx

curl --data'{"tx": 
"020000000108c89c258396b64de301b67300e46962c36167c030ae84aa9288c9dd35715ba1000000006a47304402201a7eaa89d5cfaef6d1e1e8e3fae1de4dbf119c2827fdf826599bbfb0e939a82902201c1654479e38197313d239653cb0cf7b2d931259c603912c5f07171a6ce43b7f012103b0ec36023d7ac835b913452617d6abcc295971ad6c9e95dae6cefd563ef17cb3ffffffff0156ebb201000000001976a91488dc24381f1269a68e8b049824265c43dc7e05e288ac00000000"}'
https://opreturn.net/api/grlc/tx/post/
Response

{
    "coin": "grlc",
    "cmd": "tx",
    "input": "post",
    "tx": "020000000108c89c258396b64de301b67300e46962c36167c030ae84aa9288c9dd35715ba1000000006a47304402201a7eaa89d5cfaef6d1e1e8e3fae1de4dbf119c2827fdf826599bbfb0e939a82902201c1654479e38197313d239653cb0cf7b2d931259c603912c5f07171a6ce43b7f012103b0ec36023d7ac835b913452617d6abcc295971ad6c9e95dae6cefd563ef17cb3ffffffff0156ebb201000000001976a91488dc24381f1269a68e8b049824265c43dc7e05e288ac00000000",
    "success": true,
    "txid": "fdad5c146551a03e89fd5aaefce1b2418224bd590db9158e0e18835d58c719c2"
}

Non-Blockchain API Requests

Other API requests that don't return blockchain data. Primarily hash functions:

hash160

GET hash160

Endpoint
GET /api/hash/hash160/[$string]/

//Returns 20 byte hash160 digest of input string. hash160 is ripemd160(sha256($string))

[OPTIONS]
$string (string): input string to generate hash160 digest


Code example - get hash160

curl "https://opreturn.net/api/hash/hash160/unhashedstring/"

Response

{
    "api": "hash",
    "cmd": "hash160",
    "input": "unhashedstring",
    "success": true,
    "hash160": "7ff47961043a4b6cd6e3ed0eb8421bc37eb2ebfd"
}

hash256

GET hash256

Endpoint
GET /api/hash/hash256/[$string]/

//Returns 32 byte hash256 digest of input string. hash256 is double sha256: sha256(sha256($string))

[OPTIONS]
$string (string): input string to generate hash256 digest


Code example - get hash256

curl "https://opreturn.net/api/hash/hash256/unhashedstring/"

Response

{
    "api": "hash",
    "cmd": "hash256",
    "input": "unhashedstring",
    "success": true,
    "hash256": "9d6d0e30079a97b3444f29c53075bbeec557c675f2816aebc5b26aefe210f42d"
}

md5

GET md5

Endpoint
GET /api/hash/md5/[$string]/

//Returns 16 byte md5 digest of input string: md5($string)

[OPTIONS]
$string (string): input string to generate md5 digest


Code example - get md5

curl "https://opreturn.net/api/hash/md5/unhashedstring/"

Response

{
    "api": "hash",
    "cmd": "md5",
    "input": "unhashedstring",
    "success": true,
    "md5": "58de52000e00567be333d8b7fb8dd9f6"
}

ripemd160

GET ripemd160

Endpoint
GET /api/hash/ripemd160/[$string]/

//Returns 20 byte ripemd160 digest of input string: ripemd160($string)

[OPTIONS]
$string (string): input string to generate ripemd160 digest


Code example - get ripemd160

curl "https://opreturn.net/api/hash/ripemd160/unhashedstring/"

Response

{
    "api": "hash",
    "cmd": "ripemd160",
    "input": "unhashedstring",
    "success": true,
    "ripemd160": "ad9aa3f69e869487e53776849743202781edba84"
}

sha1

GET sha1

Endpoint
GET /api/hash/sha1/[$string]/

//Returns 20 byte sha1 digest of input string: sha1($string)

[OPTIONS]
$string (string): input string to generate sha1 digest


Code example - get sha1

curl "https://opreturn.net/api/hash/sha1/unhashedstring/"

Response

{
    "api": "hash",
    "cmd": "sha1",
    "input": "unhashedstring",
    "success": true,
    "sha1": "05c905c86a5a4ed0d8b5f47b9555e8c2e77f867d"
}

sha256

GET sha256

Endpoint
GET /api/hash/sha256/[$string]/

//Returns 32 byte sha256 digest of input string: sha256($string)

[OPTIONS]
$string (string): input string to generate sha256 digest


Code example - get sha256

curl "https://opreturn.net/api/hash/sha256/unhashedstring/"

Response

{
    "api": "hash",
    "cmd": "sha256",
    "input": "unhashedstring",
    "success": true,
    "sha256": "9125b4cde221a4ea0f79877c3f13ccc9020d858fb42d1ac3c3f5e59ee9ec2181"
}