Skip to content

Market data API

martin-nginio edited this page Jul 24, 2019 · 10 revisions

Market data API is accessible through https and parameters are passed using GET-requests. All responses are encoded in JSON.

Currently the market APIs are cached for 1 second (Except trades which is cached for 2 seconds).

Tick:

path: /market/BTC/AUD/tick

sample response:

{"bestBid":13837.64,"bestAsk":13865.91,"lastPrice":13865.91,"currency":"AUD","instrument":"BTC","timestamp":1563999153,"volume24h":202.73146,"price24h":-728.71,"low24h":13692.44,"high24h":14594.62}

Orderbook:

path: /market/BTC/AUD/orderbook

sample response:

{"currency":"AUD","instrument":"BTC","timestamp":1476243360,"asks":[[844.98,0.45077821],[845.0,2.7069457],[848.68,2.58512],[848.76,0.29745]],"bids":[[844.0,0.00489636],[840.21,0.060724],[840.16,0.1180803],[840.1,0.32130103]]}

Trades:

path: /market/BTC/AUD/trades

sample response:

[{"tid":4432702312,"amount":0.01959674,"price":845.0,"date":1378878093},{"tid":59861212129,"amount":1.21434000,"price":845.15,"date":1377840783}]

since is an optional parameter for trades (get trades since the trade id). For instance:

/market/BTC/AUD/trades?since=59868345231

v2/

Active markets:

path: /v2/market/active

sample response:

{
    "success": true,
    "errorCode": null,
    "errorMessage": null,
    "markets": [
        {
            "instrument": "BTC",
            "currency": "AUD"
        },
        {
            "instrument": "LTC",
            "currency": "AUD"
        },
        {
            "instrument": "LTC",
            "currency": "BTC"
        },
        {
            "instrument": "ETH",
            "currency": "BTC"
        },
        {
            "instrument": "ETH",
            "currency": "AUD"
        },
        {
            "instrument": "XRP",
            "currency": "AUD"
        },
        {
            "instrument": "XRP",
            "currency": "BTC"
        },
        {
            "instrument": "POWR",
            "currency": "AUD"
        },
        {
            "instrument": "POWR",
            "currency": "BTC"
        },
        {
            "instrument": "OMG",
            "currency": "AUD"
        },
        {
            "instrument": "OMG",
            "currency": "BTC"
        }
    ]
}

Trades:

path: /v2/market/{instrument}/{currency}/trades

url parameters:

  • indexForward: Set to true to see trades more recent in time, if a since parameter is used. Default is false.
  • limit: Number of results to return per "page". If not provided, default is 200.
  • since: a trade id. If provided, and indexForward is false, returned results will be trades earlier than the trade id provided, non-inclusive. If indexForward is true, returned results will be trades after the trade id provided, non-inclusive.

pagination: yes

sample request: /v2/market/BTC/AUD/trades?limit=&since=116082008

sample response:

{
    "success": true,
    "errorCode": null,
    "errorMessage": null,
    "trades": [
        {
            "id": 116082007,
            "price": 88118000000,
            "volume": 1189817,
            "creationTime": 1468115880783
        },
        {
            "id": 116075304,
            "price": 87100000000,
            "volume": 100000,
            "creationTime": 1468114578646
        },
        {
            "id": 116074896,
            "price": 88374000000,
            "volume": 220427,
            "creationTime": 1468114492317
        },
        {
            "id": 116058580,
            "price": 88142000000,
            "volume": 962049,
            "creationTime": 1468111460168
        },
        {
            "id": 116053310,
            "price": 88266000000,
            "volume": 15328802,
            "creationTime": 1468110652290
        }
    ],
    "paging": {
        "newer": "/v2/market/BTC/AUD/trades?limit=5&since=116082007&indexForward=true",
        "older": "/v2/market/BTC/AUD/trades?limit=5&since=116053310&indexForward=false"
    }
}

Historical Ticks:

path: /v2/market/{instrument}/{currency}/tickByTime/{[minute | hour | day]}

url parameters:

  • limit: Number of results to return per "page". If not provided, default is 3000.
  • since: a unix timestamp in milliseconds. If provided, and indexForward is false, returned results will be candles earlier than the timestamp provided, inclusive. If indexForward is true, returned results will be candles after the timestamp provided, inclusive.
  • indexForward: Set to true to see candles more recent than the timestamp in the since parameter, if a since parameter is used. Default is false.
  • sortForward: Set to true to see the earliest candles first in the list of returned candles i.e. in chronological order. Default is false.

pagination: yes

sample request: /v2/market/BTC/AUD/tickByTime/hour?since=1537671600000&limit=4&indexForward=true&sortForward=true

sample response:

{
    "success": true,
    "paging": {
        "newer": "/v2/market/BTC/AUD/tickByTime/hour?limit=4&sortForward=true&indexForward=true&since=1537682400000",
        "older": "/v2/market/BTC/AUD/tickByTime/hour?limit=4&sortForward=true&since=1537671600000"
    },
    "ticks": [
        {
            "timestamp": 1537671600000,
            "open": 908800000000,
            "high": 909771000000,
            "low": 906053000000,
            "close": 906935000000,
            "volume": 1113664994
        },
        {
            "timestamp": 1537675200000,
            "open": 908506000000,
            "high": 909770000000,
            "low": 906936000000,
            "close": 909184000000,
            "volume": 929443810
        },
        {
            "timestamp": 1537678800000,
            "open": 909187000000,
            "high": 909600000000,
            "low": 909187000000,
            "close": 909596000000,
            "volume": 215936611
        },
        {
            "timestamp": 1537682400000,
            "open": 909596000000,
            "high": 909616000000,
            "low": 907175000000,
            "close": 907175000000,
            "volume": 388776816
        }
    ]
}

Introduction updated 9/28/18

Authentication

Pagination

WebSocket v2

WebSocket v1 deprecated

Market Data API updated 7/24/19

Trading API updated 08/19/19

Transaction API

Account API updated 3/14/19

Fund Transfer API updated 08/06/19

FAQ

Clone this wiki locally