What is this ?

The application programming interface, API for short allows you to access and remotely monitor your account. You can query the latest market prices, send trades and check your account balance. Write your own software and apps to control your account or use some of our code samples.

Secure Access

By default any actions against your account are disabled. You will first need to generate an API Key from the accounts page before gaining access to any secure functions.

Market Data

Querying the site excessively will quickly result in your IP being blocked and wont’t help process your requests any faster. The server will quickly throttle you back before shutting you down. For fast market data pushed as its published see our stomp websocket service

Publicly Available Data

FID Codes

GET https://nzbcx.com/api/market/{ticker_code}/{fid}
Example

Ticker : BTCNZD
Fid : LTP

https://nzbcx.com/api/market/BTCNZD/LTP

Will return the Last Traded Price for the bitcoin New Zealand Dollar ticker.

All Available Codes and current value

GET https://nzbcx.com/api/market/{ticker_code}
Will Return a full list of FID Codes
https://nzbcx.com/api/market/BTCNZD

Ticker Data

GET https://nzbcx.com/api/ticker/{ticker_code}
Returns a JSON structure

  • last - last BTC price
  • high - last 24 hours price high
  • low - last 24 hours price low
  • vwap - last 24 hours volume weighted average price: vwap
  • volume - last 24 hours volume
  • bid - highest buy order
  • ask - lowest sell order

https://nzbcx.com/api/ticker/BTCNZD

The format may be familiar as it is similar to that used by other well known exchanges.

Order Book

GET https://nzbcx.com/api/orderbook/{ticker_code}
Returns a JSON structure

Params: Order grouping flag set to 0 to return the complete order book
Default to 1 to return aggregated volumes.

Returns: "bids" and "asks".
sorted by price and quantity.

https://nzbcx.com/api/orderbook/BTCNZD

The format may be familiar as it is similar to that used by other well known exchanges.

Trades

GET https://nzbcx.com/api/trades/{ticker_code}
Returns a JSON structure

Params: minutes , hours , days
time period defaults to 1 hour if no parameters are set.

  • tid - execution id
  • date - unix timestamp
  • price - BTC price
  • amount - BTC amount

https://nzbcx.com/api/trades/BTCNZD?hours=1&minutes=30&days=2

The number of trades returned is capped to avoid long running queries.

Last Traded

GET https://nzbcx.com/api/last/{ticker_code}
Returns a JSON structure

Params: max
defaults to 1 if no max number of trades to be returned is specified

  • tid - execution id
  • date - unix timestamp
  • price - BTC price
  • amount - BTC amount

https://nzbcx.com/api/last/BTCNZD?max=2

The number of trades returned is capped to avoid long running queries.

Last Update

GET https://nzbcx.com/api/lastupdate/{ticker_code}
Returns a JSON structure
  • timestamp - unix server timestamp
  • lastupdate - unix timestamp

https://nzbcx.com/api/lastupdate/BTCNZD

This request is intended to provide clients with a simple mechanism of
reducing bandwidth usage.
The API also supports the ETag and If-None-Match headers on most requests.
Resending a If-None-Match ETag on a HEAD request will return a HTTP 304 response if no updates have taken place on the exchange.

Note for performance reasons all market data requests over HTTP/HTTPS are cached at a short but fixed time initial.
This means the data you receive may be several second behind. For real-time data use the websocket api.