bitNZ will be closing down on April 15 2017, please withdraw all funds before then

API

This API (application programming interface) allows bitNZ users to view public data and their private user data using custom software.

Request Limits

Please do not make more than 600 requests per 10 minute period or your IP address may be denied access.

Authentication

All private functions require authentication. Three parameters (API key, nonce, signature) are needed to authenticate a request.

API KEY:

To create an API key go here. An API key can be read only (in regards to your account) or it can have permissions to "trade" and/or "withdraw".

NONCE:

Nonce is an integer that must increase with each request you make. You can start with any regular integer greater then zero. A common practise is to use the current unix timestamp for this parameter.

SIGNATURE:

Signature is a HMAC-SHA256 encoded message containing the nonce, your username and the API key. The message must be generated with your secret code that is generated along side your API key. The message must be converted to an uppercase hexidecimal representation.

Example in Python:

    message = nonce + username + api_key
    signature = hmac.new(api_secret, msg=message, digestmod=hashlib.sha256).hexdigest().upper() 

Public Functions

TICKER:

GET https://bitnz.com/api/0/ticker

Returns JSON dictionary:

TRADES:

GET https://bitnz.com/api/0/trades

Params:

Returns JSON list of trade dictionary objects:

TRADES CHART:

GET https://bitnz.com/api/0/trades_chart

Params:

Returns a png image of trade history

ORDERBOOK:

GET https://bitnz.com/api/0/orderbook

Params:

Returns a JSON dictionary of "bids" and "asks". Each is an array of orders with each order a small array containing two elements, the price and amount of BTC ordered.

Private Functions

USER ACCOUNT BALANCE:

POST https://bitnz.com/api/0/private/balance

Params:

Returns JSON dictionary:

OPEN BUY ORDERS:

POST https://bitnz.com/api/0/private/orders/buy/open

Params:

Returns JSON array of open buy orders. Each order is a dictionary:

OPEN SELL ORDERS:

POST https://bitnz.com/api/0/private/orders/sell/open

Params:

Returns JSON array of open sell orders. Each order is a dictionary:

CLOSED BUY ORDERS:

POST https://bitnz.com/api/0/private/orders/buy/closed

Params:

Returns JSON array of closed buy orders. Each order is a dictionary:

CLOSED SELL ORDERS:

POST https://bitnz.com/api/0/private/orders/sell/closed

Params:

Returns JSON array of closed sell orders. Each order is a dictionary:

CANCEL BUY ORDER:

POST https://bitnz.com/api/0/private/orders/buy/cancel

Params:

Returns JSON dictionary:

On failure the following entries are in the dictionary:

CANCEL SELL ORDER:

POST https://bitnz.com/api/0/private/orders/sell/cancel

Params:

Returns JSON dictionary:

On failure the following entries are in the dictionary:

CREATE BUY ORDER:

POST https://bitnz.com/api/0/private/orders/buy/create

Params:

Returns JSON dictionary:

On success the following entries are in the dictionary: On failure the following entries are in the dictionary:

CREATE SELL ORDER:

POST https://bitnz.com/api/0/private/orders/sell/create

Params:

Returns JSON dictionary:

On success the following entries are in the dictionary: On failure the following entries are in the dictionary:

BTC ADDRESS:

POST https://bitnz.com/api/0/private/btc/address

Params:

Returns JSON dictionary:

On success the following entries are in the dictionary: On failure the following entries are in the dictionary:

BTC WITHDRAW:

POST https://bitnz.com/api/0/private/btc/withdraw

Params:

Returns JSON dictionary:

On success the following entries are in the dictionary: On failure the following entries are in the dictionary: