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

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