API HTTP Endpoints

Status of the Zcash Network

  /api/v1/status?q=xxx

Where "xxx" can be:

Utility Methods

  /api/v1/utils/estimatefee[?nbBlocks=2]

Block

  /api/v1/block/[:hash]
  /api/v1/block/00000000a967199a2fad0877433c93df785a8d8ce062e5f9b451cd1397bdbf62

Block Index

Get block hash by height

  /api/v1/block-index/[:height]
  /api/v1/block-index/0

This would return:

{
  "blockHash":"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
}

which is the hash of the Genesis block (0 height)

Raw Block

  /api/v1/rawblock/[:blockHash]
  /api/v1/rawblock/[:blockHeight]

This would return:

{
  "rawblock":"blockhexstring..."
}

Block Summaries

Block summaries endpoint and post methods currently disabled

Get block summaries by date:

  /api/v1/blocks?limit=3&blockDate=2016-04-22

Example response:

{
  "blocks": [
    {
      "height": 408495,
      "size": 989237,
      "hash": "00000000000000000108a1f4d4db839702d72f16561b1154600a26c453ecb378",
      "time": 1461360083,
      "txlength": 1695,
      "poolInfo": {
        "poolName": "BTCC Pool",
        "url": "https://pool.btcc.com/"
      }
    }
  ],
  "length": 1,
  "pagination": {
    "next": "2016-04-23",
    "prev": "2016-04-21",
    "currentTs": 1461369599,
    "current": "2016-04-22",
    "isToday": true,
    "more": true,
    "moreTs": 1461369600
  }
}

Transaction

  /api/v1/tx/[:txid]
  /api/v1/tx/80b7d7036bfd730753f167887beb85dc0eddb5cf914f339e457cd9bf71b763c2
  /api/v1/rawtx/[:rawid]
  /api/v1/rawtx/80b7d7036bfd730753f167887beb85dc0eddb5cf914f339e457cd9bf71b763c2

Address

  /api/v1/addr/[:addr][?noTxList=1][&from=&to=]
  /api/v1/addr/mmvP3mTe53qxHdPqXEvdu8WdC7GfQ2vmx5?noTxList=1
  /api/v1/addr/mmvP3mTe53qxHdPqXEvdu8WdC7GfQ2vmx5?from=1000&to=2000

Address Properties

  /api/v1/addr/[:addr]/balance
  /api/v1/addr/[:addr]/totalReceived
  /api/v1/addr/[:addr]/totalSent
  /api/v1/addr/[:addr]/unconfirmedBalance

The response contains the value in Satoshis.

Unspent Outputs

  /api/v1/addr/[:addr]/utxo

Sample return:

[
  {
    "address":"mo9ncXisMeAoXwqcV5EWuyncbmCcQN4rVs",
    "txid":"d5f8a96faccf79d4c087fa217627bb1120e83f8ea1a7d84b1de4277ead9bbac1",
    "vout":0,
    "scriptPubKey":"76a91453c0307d6851aa0ce7825ba883c6bd9ad242b48688ac",
    "amount":0.000006,
    "satoshis":600,
    "confirmations":0,
    "ts":1461349425
  },
  {
    "address": "mo9ncXisMeAoXwqcV5EWuyncbmCcQN4rVs",
    "txid": "bc9df3b92120feaee4edc80963d8ed59d6a78ea0defef3ec3cb374f2015bfc6e",
    "vout": 1,
    "scriptPubKey": "76a91453c0307d6851aa0ce7825ba883c6bd9ad242b48688ac",
    "amount": 0.12345678,
    "satoshis: 12345678,
    "confirmations": 1,
    "height": 300001
  }
]

Unspent Outputs for Multiple Addresses

GET method:

  /api/v1/addrs/[:addrs]/utxo
  /api/v1/addrs/2NF2baYuJAkCKo5onjUKEPdARQkZ6SYyKd5,2NAre8sX2povnjy4aeiHKeEh97Qhn97tB1f/utxo

POST method:

  /api/v1/addrs/utxo

POST params:

addrs: 2NF2baYuJAkCKo5onjUKEPdARQkZ6SYyKd5,2NAre8sX2povnjy4aeiHKeEh97Qhn97tB1f

Transactions by Block

  /api/v1/txs/?block=HASH
  /api/v1/txs/?block=00000000fa6cf7367e50ad14eb0ca4737131f256fc4c5841fd3c3f140140e6b6

Transactions by Address

  /api/v1/txs/?address=ADDR
  /api/v1/txs/?address=mmhmMNfBiZZ37g1tgg2t8DDbNoEdqKVxAL

Transactions for Multiple Addresses

GET method:

  /api/v1/addrs/[:addrs]/txs[?from=&to=]
  /api/v1/addrs/t1VBSArSLHQwMQ6KiKaqLpSmFJKeymHshxd,
                2NAre8sX2povnjy4aeiHKeEh97Qhn97tB1f/txs?from=0&to=20

POST method:

  /api/v1/addrs/txs

POST params:

addrs: t1VBSArSLHQwMQ6KiKaqLpSmFJKeymHshxd,
                2NAre8sX2povnjy4aeiHKeEh97Qhn97tB1f
from (optional): 0
to (optional): 20
noAsm (optional): 1 (will omit script asm from results)
noScriptSig (optional): 1 (will omit the scriptSig from all inputs)
noSpent (option): 1 (will omit spent information per output)

Sample output:

{ totalItems: 100,
  from: 0,
  to: 20,
  items:
    [ { txid: '3e81723d069b12983b2ef694c9782d32fca26cc978de744acbc32c3d3496e915',
       version: 1,
       locktime: 0,
       vin: [Object],
       vout: [Object],
       blockhash: '00000000011a135e5277f5493c52c66829792392632b8b65429cf07ad3c47a6c',
       confirmations: 109367,
       time: 1393659685,
       blocktime: 1393659685,
       valueOut: 0.3453,
       size: 225,
       firstSeenTs: undefined,
       valueIn: 0.3454,
       fees: 0.0001 },
      { ... },
      { ... },
      ...
      { ... }
    ]
 }

Note: If pagination params are not specified, the result is an array of transactions.

Transaction Broadcasting

POST method:

  /api/v1/tx/send

POST params:

  rawtx: "signed transaction as hex string"

  eg

  rawtx: rawdata

POST response:

  {
      txid: [:txid]
  }

  eg

  {
      txid: "c7736a0a0046d5a8cc61c8c3c2821d4d7517f5de2bc66a966011aaa79965ffba"
  }

Historic Blockchain Data Sync Status

  /api/v1/sync

Live Network P2P Data Sync Status

  /api/v1/peer