Funds

API Documentation

API Setup

API PHP Simple Usage Example

Havelock Investments provides two separate methods to access the API.
  1. By passing a cmd POST variable to a single API URL, at https://www.havelockinvestments.com/api/index.php
  2. By requesting a command URL, at https://www.havelockinvestments.com/r/cmd

Using either method, all other parameters (required or optional) are expected as a POST parameter.

All responses from the server are JSON.

Requests are rate limited by IP ADDRESS to 300 requests per 600 seconds. All queries return a parameters 'apirate' that tells you your current usage over the past 600 seconds.

BETA WARNING!!
API is still subject to change based on feedback provided from users.
If you need help, or have any questions or suggestions, please jump on irc Freenode: #havelockinvestments.


general

Ticker

Enabled
cmd: ticker
url: https://www.havelockinvestments.com/r/ticker

Optional Post Variables

symbol: Symbol to fetch ticker for


Return Data

[]: Contains array of ticker objects

Ticker (Full Details)

Enabled
cmd: tickerfull
url: https://www.havelockinvestments.com/r/tickerfull

Optional Post Variables

symbol: Symbol to fetch full ticker for


Return Data

[]: Contains array of ticker objects

Order Book

Enabled
cmd: orderbook
url: https://www.havelockinvestments.com/r/orderbook

Required Post Variables

symbol: Symbol to fetch orderbook for


Return Data

status: Contains 'ok' or 'error'
apirate: API usage rate for the past 600 seconds
message: Contains error message if applicable
bids: Contains Bids array, as price=>amount pairs
asks: Contains Asks array, as price=>amount pairs

Order Book (Full Details)

Enabled
cmd: orderbookfull
url: https://www.havelockinvestments.com/r/orderbookfull

Required Post Variables

symbol: Symbol to fetch orderbook for


Return Data

status: Contains 'ok' or 'error'
message: Contains error message if applicable
apirate: API usage rate for the past 600 seconds
bids: Contains Bids array, as order_id indexed array containing {id:id, price:price, amount:amount} pairs
asks: Contains Asks array, as order_id indexed array containing {id:id, price:price, amount:amount} pairs

Dividend History

Enabled
cmd: dividends
url: https://www.havelockinvestments.com/r/dividends

Required Post Variables

symbol: Symbol to fetch dividends for


Return Data

status: Contains 'ok' or 'error'
message: Contains error message if applicable
apirate: API usage rate for the past 600 seconds
dividends: Contains Dividends array

Trade History

Enabled
cmd: trades
url: https://www.havelockinvestments.com/r/trades

Required Post Variables

symbol: Symbol to fetch trade history for


Optional Post Variables

dtstart: Date/Time to start from (yyyy-mm-dd hh:mm:ss)
dtend: Date/Time to end at (yyyy-mm-dd hh:mm:ss)


Return Data

status: Contains 'ok' or 'error'
message: Contains error message if applicable
apirate: API usage rate for the past 600 seconds
trades: Contains trades array


account

Portfolio

Enabled
cmd: portfolio
url: https://www.havelockinvestments.com/r/portfolio

Required Post Variables

key: Secret API Key


Return Data

status: Contains 'ok' or 'error'
message: Contains error message if applicable
apirate: API usage rate for the past 600 seconds
portfolio: Contains array of portfolio objects

Balance

Enabled
cmd: balance
url: https://www.havelockinvestments.com/r/balance

Required Post Variables

key: Secret API Key


Return Data

status: Contains 'ok' or 'error'
message: Contains error message if applicable
apirate: API usage rate for the past 600 seconds
balance: Contains balance object

Open Orders

Enabled
cmd: orders
url: https://www.havelockinvestments.com/r/orders

Required Post Variables

key: Secret API Key


Return Data

status: Contains 'ok' or 'error'
message: Contains error message if applicable
apirate: API usage rate for the past 600 seconds
orders: Contains array of order objects

Transaction History

Enabled
cmd: transactions
url: https://www.havelockinvestments.com/r/transactions

Required Post Variables

key: Secret API Key


Optional Post Variables

limit: Maximum number of transactions to fetch (default: 50, maximum: 300)
sort: Sort results ASC (Ascending) or DESC (Descending) (default: DESC)
sinceid: Show transactions since (but not including) specific id (default: 0)
sincets: Show transactions since (and including) specific ts (default: 0)


Return Data

status: Contains 'ok' or 'error'
message: Contains error message if applicable
apirate: API usage rate for the past 600 seconds
transactions: Contains array of transaction objects

Withdraw Bitcoins

Disabled
cmd: withdraw
url: https://www.havelockinvestments.com/r/withdraw

Required Post Variables

key: Secret API Key
amount: Amount to withdraw in bitcoins
address: Bitcoin address to withdraw to


Return Data

status: Contains 'ok' or 'error'
message: Contains error message if applicable
apirate: API usage rate for the past 600 seconds
txnid: Contains txnid of bitcoin transaction (if successful)

Deposit Bitcoins

Enabled
cmd: deposit
url: https://www.havelockinvestments.com/r/deposit

Required Post Variables

key: Secret API Key


Return Data

status: Contains 'ok' or 'error'
message: Contains error message if applicable
apirate: API usage rate for the past 600 seconds
address: Contains bitcoin address to deposit bitcoins into


trading

Create Order

Enabled
cmd: ordercreate
url: https://www.havelockinvestments.com/r/ordercreate

Required Post Variables

key: Secret API Key
symbol: Symbol to order
action: Order type ('buy' or 'sell')
price: Price in bitcoins per unit
units: Quantity of units


Return Data

status: Contains 'ok' or 'error'
message: Contains error message if applicable
apirate: API usage rate for the past 600 seconds
id: Contains order ID if successful

Cancel Order

Enabled
cmd: ordercancel
url: https://www.havelockinvestments.com/r/ordercancel

Required Post Variables

key: Secret API Key
id: Order ID to cancel


Return Data

status: Contains 'ok' or 'error'
apirate: API usage rate for the past 600 seconds
message: Contains error message if applicable