API v1 Documentation

API requests are rate limited to 2 requests per second

General

Endpoint:

https://openchains.info/api/v1/coins

Parameters:

None

Result:

[
   {
      "name":"Bitcoin",
      "id":"bitcoin",
      "indexed":true,
      "indexed_height":392656
   },
   {
      "name":"Litecoin",
      "id":"litecoin",
      "indexed":false
   }
]

Coin

Endpoint:

https://openchains.info/api/v1/{id}/getheight

Parameters:

None

Result:

563654

Endpoint:

https://openchains.info/api/v1/{id}/getblockhash

Parameters:

Name Description Required
index The index/height of the block Yes


Result:

000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a

Endpoint:

https://openchains.info/api/v1/{id}/getblock

Parameters:

Name Description Required
hash The hash of the block Yes


Result:

{
  "hash": "000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a",
  "confirmations": 616876,
  "strippedsize": 215,
  "size": 215,
  "weight": 860,
  "height": 100,
  "version": 1,
  "versionHex": "00000001",
  "merkleroot": "2d05f0c9c3e1c226e63b5fac240137687544cf631cd616fd34fd188fc9020866",
  "tx": [
    "2d05f0c9c3e1c226e63b5fac240137687544cf631cd616fd34fd188fc9020866"
  ],
  "time": 1231660825,
  "mediantime": 1231656204,
  "nonce": 1573057331,
  "bits": "1d00ffff",
  "difficulty": 1,
  "chainwork": "0000000000000000000000000000000000000000000000000000006500650065",
  "nTx": 1,
  "previousblockhash": "00000000cd9b12643e6854cb25939b39cd7a1ad0af31a9bd8b2efe67854b1995",
  "nextblockhash": "00000000b69bd8e4dc60580117617a466d5c76ada85fb7b87e9baea01f9d9984"
}

Endpoint:

https://openchains.info/api/v1/{id}/getrawtransaction

Parameters:

Name Description Required
txid The txid of the transaction Yes


Result:

{
  "txid": "2d05f0c9c3e1c226e63b5fac240137687544cf631cd616fd34fd188fc9020866",
  "hash": "2d05f0c9c3e1c226e63b5fac240137687544cf631cd616fd34fd188fc9020866",
  "version": 1,
  "size": 134,
  "vsize": 134,
  "weight": 536,
  "locktime": 0,
  "vin": [
    {
      "coinbase": "04ffff001d014d",
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 50,
      "n": 0,
      "scriptPubKey": {
        "asm": "04e70a02f5af48a1989bf630d92523c9d14c45c75f7d1b998e962bff6ff9995fc5bdb44f1793b37495d80324acba7c8f537caaf8432b8d47987313060cc82d8a93 OP_CHECKSIG",
        "hex": "4104e70a02f5af48a1989bf630d92523c9d14c45c75f7d1b998e962bff6ff9995fc5bdb44f1793b37495d80324acba7c8f537caaf8432b8d47987313060cc82d8a93ac",
        "type": "pubkey"
      }
    }
  ],
  "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d014dffffffff0100f2052a01000000434104e70a02f5af48a1989bf630d92523c9d14c45c75f7d1b998e962bff6ff9995fc5bdb44f1793b37495d80324acba7c8f537caaf8432b8d47987313060cc82d8a93ac00000000",
  "blockhash": "000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a",
  "confirmations": 616876,
  "time": 1231660825,
  "blocktime": 1231660825,
  "vin_value": "",
  "vout_value": "50",
  "vout_count": 0,
  "fee": "-50",
  "assets": false
}

Endpoint:

https://openchains.info/api/v1/{id}/getpeerinfo

Parameters:

None

Result:

[
  {
    "id": 0,
    "addr": "35.210.232.209:8767",
    "addrlocal": "45.61.147.172:59056",
    "addrbind": "45.61.147.172:59056",
    "services": "000000000000000d",
    "relaytxes": true,
    "lastsend": 1581516109,
    "lastrecv": 1581516155,
    "bytessent": 749347,
    "bytesrecv": 1262115,
    "conntime": 1581256223,
    "timeoffset": 0,
    "pingtime": 0.089467,
    "minping": 0.088738,
    "version": 70026,
    "subver": "/Ravencoin:3.3.1(ravencore-sl)/",
    "inbound": false,
    "addnode": false,
    "startingheight": 1094987,
    "banscore": 0,
    "synced_headers": 1099293,
    "synced_blocks": 1099293,
    "inflight": [],
    "whitelisted": false,
    "bytessent_per_msg": {
      "addr": 19875,
      "cmpctblock": 310,
      "feefilter": 32,
      "getaddr": 24,
      "getdata": 21433,
      "getheaders": 1085,
      "headers": 415308,
      "inv": 142940,
      "notfound": 122,
      "ping": 69312,
      "pong": 69312,
      "sendcmpct": 132,
      "sendheaders": 24,
      "tx": 9287,
      "verack": 24,
      "version": 127
    },
    "bytesrecv_per_msg": {
      "addr": 33467,
      "block": 535,
      "cmpctblock": 460853,
      "feefilter": 32,
      "getdata": 1037,
      "getheaders": 1085,
      "headers": 274596,
      "inv": 86718,
      "notfound": 158,
      "ping": 69312,
      "pong": 69312,
      "reject": 78,
      "sendcmpct": 66,
      "sendheaders": 24,
      "tx": 264677,
      "verack": 24,
      "version": 141
    }
  }
]

Endpoint:

https://openchains.info/api/v1/{id}/getsupply

Parameters:

None

Result:

1000.00000000

Note:

Not all coins support this endpoint

Endpoint:

https://openchains.info/api/v1/{id}/difficulty

Parameters:

None

Result:

59798.41777704
or
{
    "proof-of-work": 0.07040521,
    "proof-of-stake": 0.00048827,
    "search-interval": 30
}
                                

Coin Extended (for indexed coins)

Endpoint:

https://openchains.info/api/v1/{id}/balance

Parameters:

Name Description Required
address Address on blockchain Yes


Result:

1000.00000000