NAV
cURL

API

Please note : from the 15 September 2016, our APIs will be only accessible through Mashape. This route will be closed to the public. If you have questions, you can reach out to us at hello@kaiko.com

Introduction

Welcome to the Kaiko API! You can use our API to request blockchain and exchanges data.

All requests and responses are application/json content type and follow typical HTTP response status codes for success and failure.

HTTP endpoint

https://api.kaiko.com/v1

Websocket endpoint

wss://markets.kaiko.com/v1

Accessing the data

Kaiko provides some of its data as flat files on our store. Basic data files such as price indices or statistics are provided free of charge. More complex data such as full trade history or order books comes at a fee. For heavy usage and to avoid the rate limiting please go through Mashape. We provide a free tier up to 3000 calls per month.

License

Except where otherwise noted, the content delivered via the API is licensed under a Creative Commons Attribution 4.0 International license (non commercial use only).

For more information about the license, please refer to the Creative Commons website here.

Errors

The Kaiko API uses the following error codes:

Error Code Meaning
400 Bad Request – Invalid request format
404 Not Found – The specified kitten could not be found
500 Internal Server Error – We had a problem with our server. Try again later.

Pagination

Requests that return multiple items will be paginated by default, using the page query string parameter, and possibly some other parameters. The unit of page depends on the requested resource.

The from parameter is always included in the response. The to parameter is always excluded in the response.

The pagination info is included in the Link header. It is easier to follow these Link header values instead of constructing your own URLs.

Versioning

Right now the version is v1. As we our in beta, please expect the API to change considerably and break often.

Blockchain

These endpoints allow you to request data about the Bitcoin mainnet blockchain.

Blocks

curl "https://api.kaiko.com/v1/blocks/300000"
{
   "hash":"000000000000000082ccf8f1557c5d40b21edabb18d2d691cfbf87118bac7254",
   "next_block_hash":"000000000000000049a0914d83df36982c77ac1f65ade6a52bdced2ce312aba9",
   "previous_block_hash":"000000000000000067ecc744b5ae34eebbde14d21ca4db51652e4d67e155f07e",
   "merkleroot":"915c887a2d9ec3f566a648bedcf4ed30d0988e22268cfe43ab5b0cf8638999d3",
   "branch":"main",
   "fees":4028360,
   "value":208005436605,
   "nonce":222771801,
   "bits":419465580,
   "difficulty":"8000872135",
   "reward":2500000000,
   "transactions_count":237,
   "size":128810,
   "height":300000,
   "timestamp":"2014-05-10T06:32:34.000Z",
   "version":2,
   "total_out":208005436605,
   "transactions":[
      {
         "hash":"b39fa6c39b99683ac8f456721b270786c627ecb246700888315991877024b983",
         "value":2504028360,
         "index":0
      },
      {
         "hash":"7301b595279ece985f0c415e420e425451fcf7f684fcce087ba14d10ffec1121",
         "value":36472990000,
         "index":1
      },
      {
         "hash":"6961d06e4a921834bbf729a94d7ab423b18ddd92e5ce9661b7b871d852f1db74",
         "value":4534776015,
         "index":2
      },
      {
         "hash":"85e72c0814597ec52d2d178b7125af0e3cfa07821912ca81bf4b1fbe4b4b70f2",
         "value":53399980000,
         "index":3
      }
    ],
    "transactions_count": 237,
    "value": 208005436605,
    "version": 2
}

This endpoint retrieves a specific block by its hash or height.

HTTP Request

GET https://api.kaiko.com/v1/blocks/{hash|height}

URL Parameters

Parameter Description
hash The block hash in big endian
height The block height

Range of blocks

curl "https://api.kaiko.com/v1/blocks?from=1&to=4"
[
    {
        "branch": "main",
        "confirmations": 374910,
        "hash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
        "height": 1,
        "miner": null,
        "size": 215,
        "timestamp": "2009-01-09T02:54:25.000Z",
        "transactions_count": 1,
        "value": 5000000000
    },
    {
        "branch": "main",
        "confirmations": 374909,
        "hash": "000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd",
        "height": 2,
        "miner": null,
        "size": 215,
        "timestamp": "2009-01-09T02:55:44.000Z",
        "transactions_count": 1,
        "value": 5000000000
    },
    {
        "branch": "main",
        "confirmations": 374908,
        "hash": "0000000082b5015589a3fdf2d4baff403e6f0be035a5d9742c1cae6295464449",
        "height": 3,
        "miner": null,
        "size": 215,
        "timestamp": "2009-01-09T03:02:53.000Z",
        "transactions_count": 1,
        "value": 5000000000
    }
]

This endpoint retrieves a range of blocks, paginated by their height. The to parameter is always excluded from the response.

HTTP Request

GET https://api.kaiko.com/v1/blocks?from=1&to=4

URL Parameters

Parameter Description
from The starting height (included)
to The ending height (excluded)
order The sorting order. Either asc or desc
full Boolean. Include transactions list or not.
limit The number of blocks per page. Max is 20.

Latest blocks

When you do not give any from or to parameters, this endpoint retrieves a list of 20 latest blocks.

Block transactions

curl "https://api.kaiko.com/v1/blocks/300000/transactions"
{
  "hash": "000000000000000082ccf8f1557c5d40b21edabb18d2d691cfbf87118bac7254",
  "next_block_hash": "000000000000000049a0914d83df36982c77ac1f65ade6a52bdced2ce312aba9",
  "previous_block_hash": "000000000000000067ecc744b5ae34eebbde14d21ca4db51652e4d67e155f07e",
  "merkleroot": "915c887a2d9ec3f566a648bedcf4ed30d0988e22268cfe43ab5b0cf8638999d3",
  "branch": "main",
  "fees": 4028360,
  "value": 208005436605,
  "nonce": 222771801,
  "bits": 419465580,
  "difficulty": "8000872135",
  "reward": 2500000000,
  "transactions_count": 237,
  "size": 128810,
  "height": 300000,
  "timestamp": "2014-05-10T06:32:34.000Z",
  "version": 2,
  "total_out": 208005436605,
  "transactions": [
    {
      "hash": "b39fa6c39b99683ac8f456721b270786c627ecb246700888315991877024b983",
      "block_height": 300000,
      "block_hash": "000000000000000082ccf8f1557c5d40b21edabb18d2d691cfbf87118bac7254",
      "block_time": "2014-05-10T06:32:34.000Z",
      "created_at": "2014-05-10T06:32:34.000Z",
      "lock_time": 0,
      "size": 157,
      "version": 1,
      "fees": "0",
      "prev_hash": "0000000000000000000000000000000000000000000000000000000000000000",
      "inputs": [
        {
          "previous_transaction_hash": "0000000000000000000000000000000000000000000000000000000000000000",
          "prev_index": 4294967295,
          "amount": 2500000000,
          "script_hex": "03e09304062f503253482f0403c86d53087ceca141295a00002e522cfabe6d6d7561cf262313da1144026c8f7a43e3899c44f6145f39a36507d36679a8b700610400000000000000",
          "script_type": null,
          "addresses": []
        }
      ],
      "outputs": [
        {
          "amount": 2504028360,
          "script": "OP_DUP OP_HASH160 80ad90d403581fa3bf46086a91b2d9d4125db6c1 OP_EQUALVERIFY OP_CHECKSIG",
          "script_hex": "76a91480ad90d403581fa3bf46086a91b2d9d4125db6c188ac",
          "script_type": "pubkeyhash",
          "spent": true,
          "addresses": [
            "1CjPR7Z5ZSyWk6WtXvSFgkptmpoi4UM9BC"
          ]
        }
      ],
      "amount": 2504028360,
      "index": 0
    },
    {
      "hash": "7301b595279ece985f0c415e420e425451fcf7f684fcce087ba14d10ffec1121",
      "block_height": 300000,
      "block_hash": "000000000000000082ccf8f1557c5d40b21edabb18d2d691cfbf87118bac7254",
      "block_time": "2014-05-10T06:32:34.000Z",
      "created_at": "2014-05-10T06:32:34.000Z",
      "lock_time": 0,
      "size": 259,
      "version": 1,
      "fees": "0",
      "prev_hash": "e9166ef24d3bb23a5af806a35e2b4924d325ddc655d7482e6716eedc5040ff4d",
      "inputs": [
        {
          "previous_transaction_hash": "e9166ef24d3bb23a5af806a35e2b4924d325ddc655d7482e6716eedc5040ff4d",
          "prev_index": 0,
          "amount": 36473000000,
          "script": "3046022100cb6dc911ef0bae0ab0e6265a45f25e081fc7ea4975517c9f848f82bc2b80a909022100e30fb6bb4fb64f414c351ed3abaed7491b8f0b1b9bcd75286036df8bfabc3ea501 04b70574006425b61867d2cbb8de7c26095fbc00ba4041b061cf75b85699cb2b449c6758741f640adffa356406632610efb267cb1efa0442c207059dd7fd652eea",
          "script_hex": "493046022100cb6dc911ef0bae0ab0e6265a45f25e081fc7ea4975517c9f848f82bc2b80a909022100e30fb6bb4fb64f414c351ed3abaed7491b8f0b1b9bcd75286036df8bfabc3ea5014104b70574006425b61867d2cbb8de7c26095fbc00ba4041b061cf75b85699cb2b449c6758741f640adffa356406632610efb267cb1efa0442c207059dd7fd652eea",
          "script_type": "pubkeyhash",
          "addresses": [
            "18heVg1RMgPbrciP2iW42nfsTtyPrMhpkd"
          ]
        }
      ],
      "outputs": [
        {
          "amount": 10500000000,
          "script": "OP_DUP OP_HASH160 61cf5af7bb84348df3fd695672e53c7d5b3f3db9 OP_EQUALVERIFY OP_CHECKSIG",
          "script_hex": "76a91461cf5af7bb84348df3fd695672e53c7d5b3f3db988ac",
          "script_type": "pubkeyhash",
          "spent": true,
          "addresses": [
            "19vAwujzTjTzJhQQtdQFKeP5u3msLusgWs"
          ]
        },
        {
          "amount": 25972990000,
          "script": "OP_DUP OP_HASH160 fd4ed114ef85d350d6d40ed3f6dc23743f8f99c4 OP_EQUALVERIFY OP_CHECKSIG",
          "script_hex": "76a914fd4ed114ef85d350d6d40ed3f6dc23743f8f99c488ac",
          "script_type": "pubkeyhash",
          "spent": null,
          "addresses": [
            "1Q6NNpHM1pyh6kEqzinBhEgsRc3nmpTGLm"
          ]
        }
      ],
      "amount": 36472990000,
      "index": 1
    },

Get detailed transactions (inputs and outputs scripts, addresses and amount) for a specific block. This query is paginated by transaction index.

HTTP Request

GET https://api.kaiko.com/v1/blocks/{hash|height}/transactions

URL Parameters

Parameter Description
hash The block hash in big endian
height The block height
from Starting index (included)
to Ending index (excluded)

Transactions

curl "https://api.kaiko.com/v1/transactions/51eb0b1e85c7d6bf6bc7290450db41998d5442da2426c599ffa1ad259cdb5d26"
{
    "amount": 350111486,
    "block_hash": "00000000000000000fa8bfd95b6a473d5d8864c74167dfec7077f684b95d106c",
    "block_height": 375479,
    "block_time": "2015-09-21T15:25:48.000Z",
    "confirmations": 6,
    "fees": 0,
    "hash": "51eb0b1e85c7d6bf6bc7290450db41998d5442da2426c599ffa1ad259cdb5d26",
    "created_at": "2015-09-21T15:25:48.000Z",
    "inputs": [
        {
            "addresses": [
                "1NkaiuAxC8uLkzZW9CciTKTusfKjqPiivE"
            ],
            "amount": 350211486,
            "index": 0,
            "prev_index": 1,
            "previous_transaction_hash": "f7579657711573ec30e8200bb1661b1be8dc8f9ded79a54c6a85d3feec6181ac",
            "script": "304402200af4d49d8b41539709f6e4a09149d51cead0f3820f35125a3b814d93482d9b7502204ed5f9e26b3001579d2a1e2e629c36109ac9b45992e9091806a092e54b5d6b0301 0455d0b7d69a93d520540a33e029cb5ae1e5a58858339297dfc3972621fff38c530ace5b995a42bfccdcf56c87a273cf3eb9bbd6428875510164e67c3511bac9dd",
            "script_hex": "47304402200af4d49d8b41539709f6e4a09149d51cead0f3820f35125a3b814d93482d9b7502204ed5f9e26b3001579d2a1e2e629c36109ac9b45992e9091806a092e54b5d6b0301410455d0b7d69a93d520540a33e029cb5ae1e5a58858339297dfc3972621fff38c530ace5b995a42bfccdcf56c87a273cf3eb9bbd6428875510164e67c3511bac9dd",
            "script_type": "pubkeyhash"
        }
    ],
    "lock_time": 0,
    "nbInputs": 1,
    "nbOutputs": 2,
    "outputs": [
        {
            "addresses": [
                "1Q2gFiucbP2oRyh5Y5P2i4nzwwPEnKv4Md"
            ],
            "amount": 50000000,
            "index": 0,
            "script": "OP_DUP OP_HASH160 fc9c1391abc1391d4566efc660fae66a67ec983e OP_EQUALVERIFY OP_CHECKSIG",
            "script_hex": "76a914fc9c1391abc1391d4566efc660fae66a67ec983e88ac",
            "script_type": "pubkeyhash",
            "spent": null
        },
        {
            "addresses": [
                "1NkaiuAxC8uLkzZW9CciTKTusfKjqPiivE"
            ],
            "amount": 300111486,
            "index": 1,
            "script": "OP_DUP OP_HASH160 ee98ad8867a87d1a1a4a6b3d02ec83f56d6c46dd OP_EQUALVERIFY OP_CHECKSIG",
            "script_hex": "76a914ee98ad8867a87d1a1a4a6b3d02ec83f56d6c46dd88ac",
            "script_type": "pubkeyhash",
            "spent": true
        }
    ],
    "prev_hash": "f7579657711573ec30e8200bb1661b1be8dc8f9ded79a54c6a85d3feec6181ac",
    "size": 257,
    "version": 1
}

This endpoint retrieves a specific transaction by its hash. Works for unconfirmed transactions too. This query is paginated by inputs and outputs.

HTTP Request

GET https://api.kaiko.com/v1/transactions/{hash}

URL Parameters

Parameter Description
hash The transaction hash in big endian
from Starting input/output index (included)
to Ending input/output index (excluded)

Raw transactions

curl "https://api.kaiko.com/v1/rawtx/51eb0b1e85c7d6bf6bc7290450db41998d5442da2426c599ffa1ad259cdb5d26"
{
  "hash": "51eb0b1e85c7d6bf6bc7290450db41998d5442da2426c599ffa1ad259cdb5d26",
  "raw":"0100000001ac8161ecfed3856a4ca579ed9d8fdce81b1b66b10b20e830ec731571579657f7010000008a47304402200af4d49d8b41539709f6e4a09149d51cead0f3820f35125a3b814d93482d9b7502204ed5f9e26b3001579d2a1e2e629c36109ac9b45992e9091806a092e54b5d6b0301410455d0b7d69a93d520540a33e029cb5ae1e5a58858339297dfc3972621fff38c530ace5b995a42bfccdcf56c87a273cf3eb9bbd6428875510164e67c3511bac9ddffffffff0280f0fa02000000001976a914fc9c1391abc1391d4566efc660fae66a67ec983e88ac7e56e311000000001976a914ee98ad8867a87d1a1a4a6b3d02ec83f56d6c46dd88ac00000000"
}

HTTP Request

GET https://api.kaiko.com/v1/rawtx/{hash}

Broadcasting transactions

HTTP Request

curl "https://api.kaiko.com/v1/pushtx -XPOST -d
'raw=0100000001ac8161ecfed3856a4ca579ed9d8fdce81b1b66b10b20e830ec731571579657f7010000008a47304402200af4d49d8b41539709f6e4a09149d51cead0f3820f35125a3b814d93482d9b7502204ed5f9e26b3001579d2a1e2e629c36109ac9b45992e9091806a092e54b5d6b0301410455d0b7d69a93d520540a33e029cb5ae1e5a58858339297dfc3972621fff38c530ace5b995a42bfccdcf56c87a273cf3eb9bbd6428875510164e67c3511bac9ddffffffff0280f0fa02000000001976a914fc9c1391abc1391d4566efc660fae66a67ec983e88ac7e56e311000000001976a914ee98ad8867a87d1a1a4a6b3d02ec83f56d6c46dd88ac00000000'"
{
  "hash": "51eb0b1e85c7d6bf6bc7290450db41998d5442da2426c599ffa1ad259cdb5d26"
}
OR
{
  "error": {
    "type": "invalid_request_error",
    "message": "Missing inputs"
  }
}

POST https://api.kaiko.com/v1/pushtx

HTTP POST PARAMS

Parameter Description
raw The raw transaction

Address balance

{
  "address": "12afiKXBpGsuaqL7AJsEdQT5XvfVSkNtdP",
  "total": {
    "balance": 0,
    "received": 48110288,
    "received_count": 1,
    "sent": 48110288,
    "sent_count": 1
  },
  "confirmed": {
    "balance": 0,
    "received": 48110288,
    "received_count": 1,
    "sent": 48110288,
    "sent_count": 1,
    "first_tx": "c5c336190aeb548def02bb0e8c695deb5355c8991d0dfb271498ee132a5f1293",
    "first_seen": "2016-05-12T14:30:11.000Z",
    "last_tx": "9f637f6554cf5c2b20dd3087533a528bac73f98457e4dce23cab90e7bffc24e6",
    "last_seen": "2016-05-12T14:30:11.000Z",
    "mining_rewards": 0,
    "mining_txs": 0
  },
  "unconfirmed": {
    "balance": 0,
    "received": 0,
    "received_count": 0,
    "sent": 0,
    "sent_count": 0
  }
}

This endpoint retrieves the balance and metadata of an address or a comma-separated list of addresses. Balances are in satoshis.

HTTP Request

https://api.kaiko.com/v1/addresses/{wif_address|hash160}

example:

https://api.kaiko.com/v1/addresses/3Nt1smucEdFks8uYQhyGvXGBuocTcMSmsT

Address transactions history

{
   "confirmed_transactions": [
     {
        "hash": "9f637f6554cf5c2b20dd3087533a528bac73f98457e4dce23cab90e7bffc24e6",
        "block_height": 403918,
        "block_hash": "000000000000000000e8a100341e808ccd843e6598b5bd76f6d2d6699d6a892a",
        "block_time": "2016-03-23T12:49:20.000Z",
        "created_at": "2015-09-21T15:25:48.000Z",
        "lock_time": 0,
        "size": 191,
        "version": 1,
        "amount": 48100288,
        "fees": 10000,
        "nbInputs": 1,
        "nbOutputs": 1,
        "inputs": [
          {
            "prev_hash": "c5c336190aeb548def02bb0e8c695deb5355c8991d0dfb271498ee132a5f1293",
            "prev_index": 1,
            "amount": 48110288,
            "script": "3044022076d1ff6da8cf8edcc88ad7b77501d40eacb6e6e053031b7433658f6937ec413a022001fbbec824c82ef1f0b0f4184f5f6b4c4adb0f2597fede146fc7693811a6e8b00102e9c2e77929e458ee4f60d81c7d79c70043a497a71607206c5be0d2f9a937fd01",
            "script_hex": "473044022076d1ff6da8cf8edcc88ad7b77501d40eacb6e6e053031b7433658f6937ec413a022001fbbec824c82ef1f0b0f4184f5f6b4c4adb0f2597fede146fc7693811a6e8b0012102e9c2e77929e458ee4f60d81c7d79c70043a497a71607206c5be0d2f9a937fd01",
            "script_type": "pubkeyhash",
            "index": 0,
            "addresses": [
              "12afiKXBpGsuaqL7AJsEdQT5XvfVSkNtdP"
            ]
          }
        ],
        "outputs": [
          {
            "next_hash": "95adc5d7f5b6c135ce371a586f7673ad8dea369a9b5716bcdb60f9500f71875f",
            "next_index": 6,
            "spent": true,
            "amount": 48100288,
            "script": "OP_DUP OP_HASH160 6d5a5feea8890b40b03bedbb539908cf3f07a526 OP_EQUALVERIFY OP_CHECKSIG",
            "script_hex": "76a9146d5a5feea8890b40b03bedbb539908cf3f07a52688ac",
            "script_type": "pubkeyhash",
            "addresses": [
              "1AyCvFruafL1MU1r8Ck7ZNGJ7pvb7P2Rrf"
            ],
            "index": 0
          }
        ],
        "balance_update": "-48110288",
        "confirmations": 3
     }
   ],
  "unconfirmed_transaction": [
    {
       "hash": "9f637f6554cf5c2b20dd3087533a528bac73f98457e4dce23cab90e7bffc24e6",
       "block_height": 0,
       "block_hash": 0,
       "block_time": 0,
       "lock_time": 0,
       "created_at": "2015-09-21T15:25:48.000Z",
       "size": 191,
       "version": 1,
       "amount": 48100288,
       "fees": 10000,
       "nbInputs": 1,
       "nbOutputs": 1,
       "inputs": [
         {
           "prev_hash": "c5c336190aeb548def02bb0e8c695deb5355c8991d0dfb271498ee132a5f1293",
           "prev_index": 1,
           "amount": 48110288,
           "script": "3044022076d1ff6da8cf8edcc88ad7b77501d40eacb6e6e053031b7433658f6937ec413a022001fbbec824c82ef1f0b0f4184f5f6b4c4adb0f2597fede146fc7693811a6e8b00102e9c2e77929e458ee4f60d81c7d79c70043a497a71607206c5be0d2f9a937fd01",
           "script_hex": "473044022076d1ff6da8cf8edcc88ad7b77501d40eacb6e6e053031b7433658f6937ec413a022001fbbec824c82ef1f0b0f4184f5f6b4c4adb0f2597fede146fc7693811a6e8b0012102e9c2e77929e458ee4f60d81c7d79c70043a497a71607206c5be0d2f9a937fd01",
           "script_type": "pubkeyhash",
           "index": 0,
           "addresses": [
             "12afiKXBpGsuaqL7AJsEdQT5XvfVSkNtdP"
           ]
         }
       ],
       "outputs": [
         {
           "next_hash": "95adc5d7f5b6c135ce371a586f7673ad8dea369a9b5716bcdb60f9500f71875f",
           "next_index": 6,
           "spent": true,
           "amount": 48100288,
           "script": "OP_DUP OP_HASH160 6d5a5feea8890b40b03bedbb539908cf3f07a526 OP_EQUALVERIFY OP_CHECKSIG",
           "script_hex": "76a9146d5a5feea8890b40b03bedbb539908cf3f07a52688ac",
           "script_type": "pubkeyhash",
           "addresses": [
             "1AyCvFruafL1MU1r8Ck7ZNGJ7pvb7P2Rrf"
           ],
           "index": 0
         }
       ],
       "balance_update": "-48110288",
       "confirmations": 3
    }
  ],
}

This endpoint retrieves all the transactions that flowed to or from a comma-separated list of addresses. Note that you can sort the sent/received transactions adding 0 for sent, 1 for received as filter in the query options.

The reponse contains two arrays for confirmed and unconfirmed transactions. In order to make recovering transactions from addresses that contain thousands of transactions manageable. The response is paginated on three levels: 1. address from the list 2. transaction from an address 3. by input/output Your client should merge the different pages by keeping references to transaction hashes and input/output counts. The next page is provided by the Link response header. Don’t try to construct the link yourself. Pages are currently limited to 50 inputs/outputs.

HTTP Request

https://api.kaiko.com/v1/addresses/{wif_addresses_list}/transactions

example:

https://api.kaiko.com/v1/addresses/3Nt1smucEdFks8uYQhyGvXGBuocTcMSmsT,12afiKXBpGsuaqL7AJsEdQT5XvfVSkNtdP/transactions

URL Parameters

Parameter Description
filter 0 for all, 1 for sent or 2 for received

Address UTXOs

{
  "address": "197XLNiUKp5MZhT1yykShrmtCNhNXtFLTA",
  "utxos": [
    {
      "hash": "f035575aefb986bf8c8d98b841e1d8517d9e9a4ecdeb427ba11e526b155ebe17",
      "index": 1,
      "value": 6000
    }
  ]
}

This endpoint retrieves an address’ Unspent Transaction Outputs (UTXOs): the list of transaction hash + index that this address can spend at the moment. The spendable value for those particular outputs is also given.

HTTP Request

https://api.kaiko.com/v1/addresses/{wif_address|hash160}/utxos

example:

https://api.kaiko.com/v1/addresses/13rAgFosgwjwW9HYw64gyrgy4AVjK2CacR/utxos

Mempool

curl "https://api.kaiko.com/v1/mempool"
{
   "after_block": [false, false, false],
   "bytes": [4439510, 4455228, 4477936],
   "ts": ["2016-05-02T11:00:01.776Z", "2016-05-02T11:00:11.777Z", "2016-05-02T11:00:21.779Z"],
   "txs":[528, 562, 600]
}

This endpoint retrieves the Mempool stats from Kaiko’s Bitcoin node. The data represents the response from the getmempoolinfo command which is executed on Kaiko’s Bitcoin node every 10 seconds (more on the mempool data can be found here)

HTTP Request

GET https://api.kaiko.com/v1/mempool

URL Parameters

Parameter Description
from get the mempool stats from this timestamp
to get the mempool stats to this timestamp

Exchanges

Retrieve tickers, trades and order books from the major exchanges and the Kaiko Bitcoin price indices

Constants

Exchanges keys and available pairs

Name URL Key btcusd btccny btceur btcjpy ethbtc ethusd etheur
BTC-e btc-e
BTCC btcchina
Bitfinex bitfinex
Bitstamp bitstamp
Gemini gemini
Coinbase coinbase
Kraken kraken
Itbit itbit
OKCoin okcoin
Huobi huobi
Quoine quoine
Bitflyer bitflyer
Btcbox btcbox
Zaif zaif
Poloniex poloniex
Bittrex bittrex

Ticker

{
   "btcusd":{
      "okcoin":{
         "last": 230.91,
         "open": 227.17,
         "high": 235.09,
         "low": 225.04,
         "vol24": 5921.060000000003,
         "price24": 231.7,
         "symbol": "btcusd",
         "exchange": "okcoin"
      },
      "kraken":{
         "last": 228.66,
         "open": 226.3,
         "high": 233.85819,
         "low": 223.1,
         "vol24": 172.90313482999994,
         "price24": null,
         "symbol": "btcusd",
         "exchange": "kraken"
      },
      "bitstamp": {},
      "btc-e": {},
      "bitfinex": {},
      "coinbase": {}
   },
   "btceur":{
      "kraken": {},
      "btc-e": {},
      "coinbase": {}
   },
   "btccny":{
      "btcchina": {},
      "okcoin": {}
   }
}

Get the latest ticker information.

As Bitcoin exchanges don’t have trading hours, the open time is set to 00:00 UTC. Similarly, high/low values indicate the maximum and minimum value between now and the start of the current day at 00:00 UTC

vol24 is the exchanged volume in the last 24 hours yesterday

price24 is the price 24 hours ago

HTTP Requests

All tickers:

https://api.kaiko.com/v1/tickers

All pairs for a specific exchange:

https://api.kaiko.com/v1/tickers/{exchange}

example:

https://api.kaiko.com/v1/tickers/coinbase

Specific exchange / pair ticker:

https://api.kaiko.com/v1/tickers/{exchange}/{pair}

example:

https://api.kaiko.com/v1/tickers/coinbase/btcusd

Latest trades

[
   {
      "timeuuid":"8ecb2900-61fc-11e5-80f3-6070bb1edc17",
      "timestamp":"1443017306000",
      "id":"11864299",
      "price":231.15,
      "amount":0.11,
      "sell":true,
      "symbol":"btcusd"
   },
   {
      "timeuuid":"ee750480-61fb-11e5-8062-da70339da905",
      "timestamp":"1443017037000",
      "id":"11864295",
      "price":231.15,
      "amount":0.01020154,
      "sell":true,
      "symbol":"btcusd"
   }
]

Get a range of trades from a specific exchange / pair

HTTP Request

https://api.kaiko.com/v1/trades/{exchange}/{pair}/latest

example:

https://api.kaiko.com/v1/trades/bitfinex/btcusd/latest

URL Parameters

Parameter Description
limit limit the number of trades in the response. max 50

Historical exchanges rates

curl
"https://api.kaiko.com/v1/history/exchanges?exchanges=okcoin,bitfinex,btc-e,bitstamp,coinbase,kraken,itbit,gemini,huobi&from=1230764400&pairs=btcusd&fields=v,c"
{
  "bitfinex": {
    "btcusd":
      [
        {"timestamp": 1455235200, "v": "2659", "c": "381.5"},
        {"timestamp": 1455148800, "v": "4651", "c": "377.99"}
      ]
  },
  "bitstamp": {
    "btcusd":
      [
        {"timestamp": 1455235200, "v": "2626", "c": "382.03"},
        {"timestamp": 1455148800, "v": "5407", "c": "377.98"}
      ]
  }
}

Get historical data for specified exchanges, pairs and timeframe. Available fields are open, high, low, close and volume.

HTTP Request

https://api.kaiko.com/v1/history/exchanges

example:

https://api.kaiko.com/v1/history/exchanges?exchanges=coinbase,kraken&pairs=btcusd https://api.kaiko.com/v1/history/exchanges?exchanges=okcoin,huobi&pairs=btccny&fields=c,v

URL Parameters

Parameter Description
from get values from this timestamp
to get values up to this timestamp
resolution get values with this temporal resolution (avaliable values: ‘hour’, 'day’, 'week’; default is 'day’)
pairs get the prices for specific pairs (default = all pairs)
exchanges get the values from these exchanges
fields get the open, high, low, close, volume values (use 'o’, 'h’, 'l’, 'c’, 'v’)

The available exchanges / pairs are listed in the 'constants’ section

Status

Get exchanges status (up or down) and latency information.

The latency is measured from US-EAST region for five minutes.

curl "https://api.kaiko.com/v1/status"
{
  "coinbase": {
    "btcusd": {
      "timestamp": 1461239100,
      "date": "2016-04-21T11:45:00.000Z",
      "up": "100",
      "latency": {
        "mean": "44.358",
        "std": "18.601"
      },
      "server_latency": {
        "mean": "39.814",
        "std": "18.563"
      }
    }
  },
  "kraken": {
    "btcusd": {
      "timestamp": 1461239100,
      "date": "2016-04-21T11:45:00.000Z",
      "up": "100",
      "latency": {
        "mean": "1671.848",
        "std": "1058.014"
      },
      "server_latency": {
        "mean": "1668.255",
        "std": "1058.014"
      }
    }
  }
}

timestamp and date represent time after that the latency was measured

up is percentage of succesful requests to exchange API

latency is API latency measured from US-EAST region

server_latency is estimation of server response time based on measurements of ping time to exchange server

mean and std are empiricl mean value and standard deviation

HTTP Request

https://api.kaiko.com/v1/status

Status of a specific exchange

curl "https://api.kaiko.com/v1/status/coinbase"
{
  "coinbase": {
    "btcusd": {
      "timestamp": 1461239100,
      "date": "2016-04-21T11:45:00.000Z",
      "up": "100",
      "latency": {
        "mean": "44.358",
        "std": "18.601"
      },
      "server_latency": {
        "mean": "39.814",
        "std": "18.563"
      }
    }
  }
}

HTTP Request

https://api.kaiko.com/v1/status/{exchange}

Historical latencies

Get historical data for specified exchanges and timeframe:

curl https://api.kaiko.com/v1/history/status?exchanges=coinbase&from=1461240691&to=1461244291
{
  "coinbase": {
    "btcusd": [
    {
      "timestamp": 1461243900,
      "date": "2016-04-21T13:05:00.000Z",
      "up": "100",
      "latency": {
        "mean": "45.954",
        "std": "16.949"
      },
      "server_latency": {
        "mean": "42.342",
        "std": "16.943"
      }
    },
    {
      "timestamp": 1461244200,
      "date": "2016-04-21T13:10:00.000Z",
      "up": "100",
      "latency": {
        "mean": "39.034",
        "std": "13.711"
      },
      "server_latency": {
        "mean": "35.496",
        "std": "13.708"
      }
    }
    ]
  }
}

HTTP Request

https://api.kaiko.com/v1/history/status

URL Parameters:

Parameter Description
from get values from this timestamp
to get values up to this timestamp
resolution get values with given time resolution (possible values are 5min, hour, day)
exchanges get values from these exchanges (comma-separated, default = all exchanges)

Indices

Retrieve live and historical tickers from the Kaiko Bitcoin price indices. The indices are all computed in USD but are available in USD, EUR and CNY, thanks to the ECB exchange rates.

Constants

Price indices keys and available currencies

Name URL Key USD CNY EUR
Kaiko Bitcoin Global Price Index global
Kaiko Bitcoin US Price Index US us
Kaiko Bitcoin EU Price Index EU eu
Kaiko Bitcoin CN Price Index CN cn

Ethereum indices are in beta, use at your own risk.

Name URL Key BTC USD EUR
Kaiko Ethereum BTC Price Index ethbtc
Kaiko Ethereum USD Price Index ethusd
Kaiko Ethereum EUR Price Index etheur

Ticker

{
  "btcusd": {
    "us": {
      "last": 435.33,
      "open": 430.83,
      "high": 436.29,
      "low": 430.44,
      "vol24": 34041.19463913041,
      "price24": 436.48,
      "symbol": "btcusd",
      "supply": null,
      "timestamp": 1456825009,
      "name": "us"
    },
    "global": {
      "last": 442.55,
      "open": 430.95,
      "high": 443.2,
      "low": 432.85,
      "vol24": 923162.6823450307,
      "price24": 442.21,
      "symbol": "btcusd",
      "supply": null,
      "timestamp": 1456825009,
      "name": "global"
    },
    "eu": {
      "last": 433.16,
      "open": 430.63,
      "high": 434.29,
      "low": 428.06,
      "vol24": 5483.366885909997,
      "price24": 437.04,
      "symbol": "btcusd",
      "supply": null,
      "timestamp": 1456825009,
      "name": "eu"
    },
    "cn": {
      "last": 443.23,
      "open": 440.02,
      "high": 444.06,
      "low": 439.75,
      "vol24": 871169.9808199903,
      "price24": 444.81,
      "symbol": "btcusd",
      "supply": null,
      "timestamp": 1456825009,
      "name": "cn"
    }
  },
  "btccny": {},
  "btceur": {}
}

Get the latest ticker information for all our indices.

As Bitcoin markets don’t have trading hours, the open time is set to 00:00 UTC. Similarly, high/low values indicate the maximum and minimum value between now and the start of the current day at 00:00 UTC

vol24 is the exchanged volume in the last 24 hours yesterday

price24 is the price 24 hours ago

HTTP Requests

All tickers:

https://api.kaiko.com/v1/indices/tickers

Historical indices rates

curl "https://api.kaiko.com/v1/history/indices?indices=global,cn,us,eu&from=1230764400&currency=usd&fields=v,c"
[
  {
    "global": [
      {
        "timestamp": 1455235200,
        "v": "505973.96271378116",
        "c": "387.73"
      }
    ],
    "cn": [
      {
        "timestamp": 1455235200,
        "v": "472125.7518050194",
        "c": "394.17"
      }
    ],
    "eu": [
      {
        "timestamp": 1455235200,
        "v": "3826.2436363999986",
        "c": "383.31"
      }
    ]
  }
]

Get historical data for specified indices, pairs and timeframe. Available fields are open, high, low, close and volume.

We currently offer 2 types of price index: - A global index, reflecting the Bitcoin price worldwide - Regional indices (US, EU and CN) reflecting the Bitcoin price on a regional level. Even if these indices reflect the price of a specific trading area, they are available in multiple currency to be benchmarked against each other.

HTTP Request

https://api.kaiko.com/v1/history/indices

examples:

https://api.kaiko.com/v1/history/indices?indices=global https://api.kaiko.com/v1/history/indices?indices=global,us&currency=cny&fields=o,h,l,c

URL Parameters

Parameter Description
from get values from this timestamp
to get values up to this timestamp
resolution get values with this temporal resolution (avaliable values: ‘hour’, 'day’, 'week’; default is 'day’)
currency* all indices can be returned in dollar, euro or yuan (use 'usd’, 'eur’, 'cny’)
indices query our global index or the regional ones (available values: 'global’, 'us’, 'eu’, 'cn’)
fields get the open, high, low, close values (use 'o’, 'h’, 'l’, 'c’,

'v’)

The available indices / currencies are listed in the 'constants’ section

Historical indices weights

curl "https://api.kaiko.com/v1/history/indices/weights?indices=global,cn,eu&from=1230764400"
{
  "global": [
    {
      "timestamp": 1455235200,
      "weights": [
        {
          "exchange": "bitfinex",
          "pair": "btcusd",
          "weight": "0.19"
        },
        {
          "exchange": "bitstamp",
          "pair": "btcusd",
          "weight": "0.08"
        }
      ]
    }
  ],
  "cn": [],
  "eu": []
}

Get historical data for specified indices and timeframe.

HTTP Request

https://api.kaiko.com/v1/history/indices/weights

example:

https://api.kaiko.com/v1/history/indices/weights?indices=global https://api.kaiko.com/v1/history/indices/weights?indices=us,cn

URL Parameters

Parameter Description
from get values from this timestamp
to get values up to this timestamp
resolution get values with this temporal resolution (avaliable values: ‘hour’, 'day’, 'week’; default is 'day’)
indices query our global index or the regional ones (available values: 'global’, 'us’, 'eu’, 'cn’)

Volatility

Retrieve historical volatility values of the Kaiko price indices, exchanges prices, and some forex currency pairs.

Exchanges volatility

{
  "coinbase":
    {
      "btcusd":
        [
          {
            "timestamp": 1463011200,
            "volatility": 1.3281648610112269
          },
          {
            "timestamp": 1462924800,
            "volatility": 1.3289285247969325
          },
          {
            "timestamp": 1462838400,
            "volatility": 1.334844614438983
          }
        ]
    }
}

Get historical volatility data for specified exchanges, pairs and timeframe.

HTTP Request

https://api.kaiko.com/v1/volatility/exchanges

example:

https://api.kaiko.com/v1/volatility/exchanges?exchanges=coinbase&from=2016-05-10&pairs=btcusd&window=60

URL Parameters

Parameter Description
from get values from this timestamp
to get values up to this timestamp
resolution get values with this temporal resolution (avaliable values: ‘hour’, 'day’, 'week’; default is 'day’)
pairs get the values for specific pairs (default = all pairs)
exchanges get the values from these exchanges
window  volatility is calculated with the specified window (in days, 30 by default)

The available exchanges / pairs are listed in the exchanges 'constants’ section

Indices volatility

{
  "global":
    [
      {
        "timestamp": 1463011200,
        "volatility": 1.4063424514501812
      },
      {
        "timestamp": 1462924800,
        "volatility": 1.405995773137137
      },
      {
        "timestamp": 1462838400,
        "volatility": 1.40951284606363
      }
    ]
}

Get historical volatility data for specified indices and timeframe.

HTTP Request

https://api.kaiko.com/v1/volatility/indices

example:

https://api.kaiko.com/v1/volatility/indices?indices=global&from=2016-05-10&window=60

URL Parameters

Parameter Description
from get values from this timestamp
to get values up to this timestamp
resolution get values with this temporal resolution (avaliable values: ‘hour’, 'day’, 'week’; default is 'day’)
indices query our global index or the regional ones (available values: 'global’, 'us’, 'eu’, 'cn’)
window  volatility is calculated with the specified window (in days, 30 by default)

The available indices are listed in the indices 'constants’ section

Forex volatility

{
    "xauusd":
      [
        {
          "timestamp": 1463961600,
          "volatility": 0.8087449686741525
        },
        {
          "timestamp": 1463875200,
          "volatility": 1.8087449686741524
        },
        {
          "timestamp": 1463788800,
          "volatility": 1.8087449686741525
        }
      ]
}

Get historical volatility data for specified currency pair and timeframe.

HTTP Request

https://api.kaiko.com/v1/volatility/forex

example:

https://api.kaiko.com/v1/volatility/forex?pairs=xauusd&from=2016-05-10&window=60

URL Parameters

Parameter Description
from get values from this timestamp
to get values up to this timestamp
pairs get the volatility for specific pairs (default = all pairs)
window  volatility is calculated with the specified window (in days, 30 by default)

Websocket

Overview

The websocket feed provides real-time market data updates for tickers, orders and trades for Bitfinex, Bitstamp, BTCChina, Coinbase and Huobi, Gatecoin.

Url

wss://markets.kaiko.com:8080/v1

Constants

Indices keys

name
Kaiko Bitcoin Price Index indices
Kaiko BitMEX Price Index bitmex

Exchanges keys and available pairs

name btcusd btccny btceur
BTCC btcchina
Bitfinex bitfinex
Bitstamp bitstamp
Huobi huobi

Subscribe

{
  "type": "subscribe",
  "exchanges": [
    { "name": "indices", "channels": ["ticker"] },
    { "name": "bitmex", "channels": ["ticker"] },
    { "name": "bitfinex", "channels": ["ticker#btcusd", "trades#btcusd", "orderbook#btcusd"] },
    { "name": "bitstamp", "channels": ["ticker#btcusd", "trades#btcusd", "orderbook#btcusd"] },
    { "name": "btcchina", "channels": ["ticker#btccny", "trades#btccny", "orderbook#btccny"] },
    { "name": "huobi", "channels": ["ticker#btcusd,btccny", "trades#btcusd,btccny", "orderbook#btcusd,btccny"] }
  ]
}

To begin receiving feed messages, you must first send a subscribe message to the server indicating which indices, exchanges and channels you wish to subscribe to.

The message must be JSON encoded.

Unsubscribe

{
  "type": "unsubscribe",
  "exchanges": [
    { "name": "indices", "channels": ["ticker"] },
    { "name": "bitmex", "channels": ["ticker"] },
    { "name": "bitfinex", "channels": ["ticker#btcusd", "trades#btcusd", "orderbook#btcusd"] },
    { "name": "bitstamp", "channels": ["ticker#btcusd", "trades#btcusd", "orderbook#btcusd"] },
    { "name": "btcchina", "channels": ["ticker#btccny", "trades#btccny", "orderbook#btccny"] },
    { "name": "huobi", "channels": ["ticker#btcusd,btccny", "trades#btcusd,btccny", "orderbook#btcusd,btccny"] }
  ]
}

To stop receiving messages from given channels of an exchange, send an unsubcribe message.

The message must be JSON encoded.

Widget

Overview

The ticker widget provides an embeddable view of the current and past Bitcoin Price. It can be added for free to any website or blog with a simple line of code. It is highly customizable and can be added in the form of an iframe or via inline javascript.

Format

To add the widget as an iframe, simply use the following markup: html <iframe src="https://cdn.kaiko.com/widget.min.html" style='border: none'></iframe>

To use the widget via inline javascript, prefer the following markup: html <div id="bitcoin-widget"></div> <script src="https://cdn.kaiko.com/js/widget.min.js"></script>

Customizations

To customize the widgets, 2 options are available: - If you are using the iframe: add query strings parameter to the source url. For example, to select the size, use the following source: html https://cdn.kaiko.com/widget.min.html?size=small&source=cn html https://cdn.kaiko.com/widget.min.html?size=mpu&pair=btceur - If you are using inline javascript: add date attributes to your div. For example, to select the size, use the following source: html <div id="bitcoin-widget" data-size="small" data-align="center" data-theme="dark" data-pair="btcusd" data-source="global"></div>

Size

2 sizes are available: - a 210x130 small widget available with data-size="small" - a 300x250 large widget available with data-size="mpu" (minimum publishing unit)

Please note that, if you are using an iframe with the minimum publishing unit format (mpu), you need to adapt the iframe height to 250px: html <iframe src="https://cdn.kaiko.com/widget.min.html?size=mpu" style='height: 250px; border: none'></iframe>

Data sources

All of our indices are available in the widget: - The Kaiko Bitcoin Price Index (reflects the Bitcoin Price across all major exchanges) - use it with data-source=global - The Kaiko Bitcoin Price Index CNY (reflects the Bitcoin Price across all major exchanges trading in CN) - use it with data-source=cn - The Kaiko Bitcoin Price Index USD (reflects the Bitcoin Price across all major exchanges trading in US) - use it with data-source=us - The Kaiko Bitcoin Price Index EUR (reflects the Bitcoin Price across all major exchanges trading in EU) - use it with data-source=eu

More information on our indices and their computation is available here

Currency

The widget can be used to show the price in USD, CNY or EUR. All of our indices are converted in the selected currency using the European Central Bank rates (available here)

Customize the currency as follows: html <div id="bitcoin-widget" data-pair="btcusd"></div> <div id="bitcoin-widget" data-pair="btccny"></div> <div id="bitcoin-widget" data-pair="btceur"></div>

Note that the default currency is always btcusd, even if you chose to display the Kaiko Bitcoin Index CN.

Theme

2 color themes are available for now

<iframe src="https://cdn.kaiko.com/widget.min.html?theme=dark" style='border: none'></iframe>
<iframe src="https://cdn.kaiko.com/widget.min.html?theme=blue" style='border: none'></iframe>

Alignment

The widget can be aligned left, right or center

<div id="bitcoin-widget" data-align="left"></div>
<div id="bitcoin-widget" data-align="right"></div>
<div id="bitcoin-widget" data-align="center"></div>