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

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