iMoose API
Learn about our API.

General Usage

  • The base endpoint is: https://api.imoose.com
  • Data is returned in ascending order. Oldest first, newest last.
  • For GET endpoints, parameters must be sent as a query string
  • For POST, PUT, and DELETE endpoints, the parameters may be sent as a query string or in the request body with content type application/x-www-form-urlencoded. You may mix parameters between both the query string and request body if you wish to do so.
  • For any signed endpoints parameters and request body fields must be ordered alphabetical.
  • All endpoints return a JSON response in the following format
{
  "errors": [],
  "data": {},
  "code": 200
}

Error Messages

Any response with a status other then 200 will have the error array populated with one or more error strings.

{
  "errors": ["category:code:message"],
  "data": {},
  "code":405
}

Private Endpoint Security

Any private endpoint requires the inclusion of the following headers to authenticate your API key & secret.

Api-Key = API key
Api-Sign = Message signature using HMAC-SHA256 of (query string + request body)) and secret API key
  • The Api-Sign header is a HMAC SHA256 signature of the query string concatenated with the request body.
  • The parameter "timestamp" is required for all private endpoints containing the current UNIX time in milliseconds
  • An additional parameter, "recvWindow", may be sent to specify the number of milliseconds after timestamp the request is valid for. If recvWindow is not sent, it defaults to 5000.

API call rate limit

We have safeguards in place to protect against abuse/DoS attacks as well as order book manipulation caused by the rapid placing and canceling of orders.

  • Every user of our API has a "call counter" which starts at 0
  • Each call to the API will raise the counter by its 'weight'
  • Each response will include the header Api-Rate to indicate the users current counter value
  • The user's counter is reduced every couple of seconds, and if the counter exceeds the user's counter limit API access is suspended for 15 minutes
    Account Level Maximum Counter Reduce Rate
    Basic 15 1 every 3 seconds
    Intermediate 20 1 every 2 seconds
    Pro 25 1 every 1 seconds
  • NOTE: Repeatedly violating rate limits and/or failing to back off after receiving a rate limit error will result in an automated ban.

General Usage

The following API clients are currently available for use

Public Methods

Server Status

/api/v1/public/status

Test connectivity to the API.

Weight: 1

Parameters: NONE

Response:

{
  "errors": [] ,
  "data": {
   "status": "ok"
  },
  "code":200
}

Check server time

/api/v1/public/time

Test connectivity to the API and get the current server time. This is to aid in approximating the skew time between the server and client.

Weight: 1

Parameters: NONE

Response:

{
  "errors":  [],
  "data": {
  "unix_time": 1631890178,
  "unix_time_ms": 1631890178801,
  "rfc1123": "Fri, 17 Sep 2021 14:49:38 UTC"
  },
  "code": 200
}

Get Assets

/api/v1/asset

Weight: 1

Parameters:

Name Type Mandatory Description
id STRING NO Asset ID to get, if not provided will get all

Response:

{
  "errors":  [],
  "data": [ 
   {
    "id": "btc",
    "name": "Bitcoin",
    "precision": 5,
    "class": "currency",
    "state": "enabled",
    "subclass": "real"
   },
   {
    "id": "usdt",
    "name": "Tether",
    "precision": 2,
    "class": "currency",
    "state": "enabled",
    "subclass": "real"
   }
  ],
  "code":200
}

Response [with id provided]:

{
  "errors":  [],
  "data":  {
   "id": "btc",
   "name": "Bitcoin",
   "precision": 5,
   "class": "currency",
   "state": "enabled",
   "subclass": "real"
  },
  "code":200
}

Get Markets

/api/v1/market

Weight: 1

Parameters:

Name Type Mandatory Description
id STRING NO Market ID to get, if not provided will get all
type STRING NO Values: [spot,virtual]

Response:

{
  "errors":  [],
  "data": [ 
   {
    "id": "btcusdt",
    "name": "BTC/USDT",
    "base_id": btc,
    "quote_id": "usdt",
    "base_name": "Bitcoin",
    "qoute_name": "Tether",
    "type": "spot",
    "base_precision": "5",
    "quote_precision": "2",
    "status": "listed",
    "buy_min_volume": "0.001",
    "sell_min_volume": "0.001"
   },
   {
    "id": "ethbtc",
    "name": "ETH/BTC",
    "base_id": eth,
    "quote_id": "btc",
    "base_name": "Etherum",
    "qoute_name": "Bitcoin",
    "type": "spot",
    "base_precision": "5",
    "quote_precision": "5",
    "status": "listed",
    "buy_min_volume": "0.01",
    "sell_min_volume": "0.01"
   }
  ],
  "code":200
}

Response [with id provided]:

{
  "errors":  [],
  "data":  {
    "id": "btcusdt",
    "name": "BTC/USDT",
    "base_id": btc,
    "quote_id": "usdt",
    "base_name": "Bitcoin",
    "qoute_name": "Tether",
    "type": "spot",
    "base_precision": "5",
    "quote_precision": "2",
    "status": "listed",
    "buy_min_volume": "0.001",
    "sell_min_volume": "0.001"
  },
  "code":200
}

Order book

/api/v1/depth

Weight: 1

Parameters:

Name Type Mandatory Description
id STRING YES
limit INT NO Default 100; max 1000.

Response:

{
  "errors":  [],
  "data":  {
    "bids": [ 
      ["4.00000000","431.00000000"]
    ],
    "asks": [ 
      ["4.00002000","12.00000000"]
    ]
  },
  "code":200
}

Recent trades list

/api/v1/trades

Get recent trades (up to last 500).

Weight: 1

Parameters:

Name Type Mandatory Description
id STRING YES id of market to get trades for
limit INT NO max 1000

Response:

{
  "errors":  [],
  "data":  [
    ["47483.96","0.00085",1631893146],
    ["47483.97","0.04421",1631893146]
  ],
  "code":200
}

OHLC data

/v1/public/ohlc

OHLC/candlestick bars for a symbol. OHLC points are uniquely identified by their open time.

Weight: 1

Parameters:

Name Type Mandatory Description
interval STRING YES
from LONG NO
limit INT NO Default 500; max 1000

If startTime and endTime are not sent, the most recent OHLC points are returned.

Response:

{
  "errors": [],
  "data": [
    [
      1632091740,
      "46970.39",
      "47146.06",
      "46953.56",
      "47133.23",
      "27.6596"
    ],
    [
      1632091800,
      "47133.23",
      "47187.5",
      "47089.01",
      "47115.18",
      "26.2749"
    ],
    [
      1632091860,
      "47114.99",
      "47115.18",
      "47036.21",
      "47066.42",
      "14.3438"
    ]
  ]
}

24hr ticker statistics

/v1/public/ticker

24 hour market ticker statistics

Weight: 1

Parameters:

Name Type Mandatory Description
id STRING NO ID of market to get ticker for, if not provided will fetch all tickers.
type STRING NO Market type to get tickers for [spot,virtual]

Response:

{
 "errors": [],
  "data": [
    {
      "market_id": "btcusdt",
      "open": "47652.27",
      "volume": "25784",
      "low": "42500",
      "high": "42500",
      "last": "43905.99",
      "sell": "43912.25",
      "buy": "200"
    },
    {
      "market_id": "ethbtc",
      "open": "0.070418",
      "volume": "74214",
      "low": "0.068659",
      "high": "0.068659",
      "last": "0.070124",
      "sell": "0.070155",
      "buy": "0.069681"
    },
    {
      "market_id": "ethusdt",
      "open": "3355.24",
      "volume": "211450",
      "low": "2913.39",
      "high": "2913.39",
      "last": "3079.98",
      "sell": "3080.53",
      "buy": "3072.71"
    }
  ],
  "result": "success",
  "status": 200
}

Private User Account Methods

Get Portfolios

GET /v1/private/portfolio

Gets all active portfolios for account

Weight: 1

Parameters: NONE

Response:

{
  "errors": [],
  "data": [
    {
      "id": "fd143e32-ea7c-48de-8f1c-6f73f1521db6",
      "type": "spot",
      "status": "enabled",
      "balance": "0",
      "CreatedAt": 1631540194,
      "UpdatedAt": 1631540194,
      "name": "Spot 1"
    }
  ],
  "result": "success",
  "status": 200
}

Get Portfolio Balances

GET /v1/private/balance

Gets account balance for portfolio

Weight: 1

Parameters: NONE

Name Type Mandatory Description
id STRING YES Portfolio ID to get balances for

Response:

{
  "errors": [],
  "data": {
    "btc": "0.5678",
    "eth": "1.34",
    "usdt": "1234.56"
  },
  "result": "success",
  "status": 200
}

Query order

GET /v1/private/order

Check an order's status

Weight: 1

Parameters:

Name Type Mandatory Description
id STRING YES

Response:

{
  "errors": [],
  "data": {
    "id": "00265be4-8f84-42b6-a1a4-9e61ceaf143c",
    "market_id": "btcusdt",
    "side": "buy",
    "state": "live",
    "type": "limit",
    "created_at": 1631713539,
    "updated_at": 1631713539,
    "price": "200",
    "volume": "0.1",
    "portfolio_id": "fd143e32-ea7c-48de-8f1c-6f73f1521db6",
    "balance": "20",
    "balance_origional": "20",
    "received": "0",
    "trade_count": 0,
    "fee": "0",
    "trades": [],
    "version": 0
  },
  "result": "success",
  "status": 200
}

Current open orders

/v1/private/order/open

Get all open orders on a symbol.

Weight: 2

Parameters:

Name Type Mandatory Description
id STRING YES Portfolio ID
from STRING NO Pagingation code returned in NEXT paramter from previous call

Response:

{
  "errors": [],
  "data": {
	  "next": "",
	  "orders": [
	    {
	      "id": "00265be4-8f84-42b6-a1a4-9e61ceaf143c",
	      "market_id": "btcusdt",
	      "side": "buy",
	      "state": "live",
	      "type": "limit",
	      "created_at": 1631713539,
	      "updated_at": 1631713539,
	      "price": "200",
	      "volume": "0.1",
	      "portfolio_id": "fd143e32-ea7c-48de-8f1c-6f73f1521db6",
	      "balance": "20",
	      "balance_origional": "20",
	      "received": "0",
	      "trade_count": 0,
	      "fee": "0",
	      "trades": []
	    },
	    {
	      "id": "38b66ffe-89c6-42ef-b44f-78402b105d8d",
	      "market_id": "btcusdt",
	      "side": "buy",
	      "state": "live",
	      "type": "limit",
	      "created_at": 1631713547,
	      "updated_at": 1631713547,
	      "price": "200",
	      "volume": "0.1",
	      "portfolio_id": "fd143e32-ea7c-48de-8f1c-6f73f1521db6",
	      "balance": "20",
	      "balance_origional": "20",
	      "received": "0",
	      "trade_count": 0,
	      "fee": "0",
	      "trades": [],
	    }]},
  "result": "success",
  "status": 200
}    

Closed orders

/v1/private/order/closed

Get all closed orders for portfolio

Weight: 5

Parameters:

Name Type Mandatory Description
id STRING YES Portfolio ID
from STRING NO Pagingation code returned in NEXT paramter from previous call

Response:

{
  "errors": [],
  "data": {
	  "next": "",
	  "orders": [
	    {
	      "id": "00265be4-8f84-42b6-a1a4-9e61ceaf143c",
	      "market_id": "btcusdt",
	      "side": "buy",
	      "state": "done",
	      "type": "limit",
	      "created_at": 1631713539,
	      "updated_at": 1631713539,
	      "price": "200",
	      "volume": "0.1",
	      "portfolio_id": "fd143e32-ea7c-48de-8f1c-6f73f1521db6",
	      "balance": "0",
	      "balance_origional": "20",
	      "received": "0.1",
	      "trade_count": 1,
	      "fee": "0",
	      "trades": ["200,0.1,1631713539"]
	    },
	    {
	      "id": "38b66ffe-89c6-42ef-b44f-78402b105d8d",
	      "market_id": "btcusdt",
	      "side": "buy",
	      "state": "canceled",
	      "type": "limit",
	      "created_at": 1631713547,
	      "updated_at": 1631713547,
	      "price": "200",
	      "volume": "0.1",
	      "portfolio_id": "fd143e32-ea7c-48de-8f1c-6f73f1521db6",
	      "balance": "20",
	      "balance_origional": "20",
	      "received": "0",
	      "trade_count": 0,
	      "fee": "0",
	      "trades": [],
	    }]},
  "result": "success",
  "status": 200
}    

Private User Trading Methods

New order

/api/v1/order

Send in a new order

Weight: 1

Parameters:

Name Type Mandatory Description
portfolio_id STRING YES
market STRING YES
side STRING YES bid,ask
type STRING YES market,limit
volume DECIMAL YES
price DECIMAL NO Only optional for market

Response:

{
  "errors": [],
  "data": {
    "id": "00265be4-8f84-42b6-a1a4-9e61ceaf143c",
    "market_id": "btcusdt",
    "side": "buy",
    "state": "live",
    "type": "limit",
    "created_at": 1631713539,
    "updated_at": 1631713539,
    "price": "200",
    "volume": "0.1",
    "portfolio_id": "fd143e32-ea7c-48de-8f1c-6f73f1521db6",
    "balance": "20",
    "balance_origional": "20",
    "received": "0",
    "trade_count": 0,
    "fee": "0",
    "trades": [],
    "version": 0
  },
  "result": "success",
  "status": 200
}

Cancel order

DELETE /v1/private/order

Cancel a open order.

Weight: 1

Parameters:

Name Type Mandatory Description
id STRING YES

Response:

{
  "errors": [],
  "data": {
    "canceled": 1
  },
  "result": "success",
  "status": 200
}