iMoose API
Learn about our Industry Leading API.

General Usage

  • The base endpoint is: https://api.imoose.com
  • All endpoints return either a JSON object or array.
  • Data is returned in ascending order. Oldest first, newest last.
  • All time and timestamp related fields are in milliseconds.
  • Public methods can use either GET or POST.
  • Private methods must use POST and be set up as follows

    HTTP header:
    X-API-Key = API key
    X-API-Sign = Message signature using HMAC-SHA512 of (URI path + SHA256(nonce + POST data)) and base64 decoded secret API key
    Post data:
    nonce = always increasing unsigned 64 bit integer 

    Note: There is no way to reset the nonce to a lower value so be sure to use a nonce generation method that won't generate numbers less than the previous nonce. A persistent counter or the current time in hundredths of a second precision or higher is suggested. Too many requests with nonces below the last valid nonce (EAPI:Invalid nonce) can result in temporary bans.

    Note: Sometimes requests can arrive out of order or NTP can cause your clock to rewind, resulting in nonce issues. If you encounter this issue, you can change the nonce window in your account API settings page. The amount to set it to depends upon how you increment the nonce. Depending on your connectivity, a setting that would accomodate 3-15 seconds of network issues is suggested.

  • Any endpoint can return an ERROR; the error payload is as follows:

    {
     "code": -1121,
     "msg": "Invalid symbol" 
    }

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 X-CALL-COUNTER 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.

Public Methods

Test connectivity

/api/v1/ping

Test connectivity to the API.

Weight: 1

Parameters: NONE

Response:

{}

Check server time

/api/v1/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:

{
 "serverTime": 1499827319559
}

Order book

/api/v1/depth

Weight: 1

Parameters:

Name Type Mandatory Description
symbol STRING YES
limit INT NO Default 100; max 1000. Valid limits:[5, 10, 20, 50, 100, 500, 1000]

Response:

{
 "bids": [ 
    [
     "4.00000000",   // PRICE
     "431.00000000"  // VOLUME
    ]
 ],
 "asks": [ 
    [
     "4.00002000",   // PRICE
     "12.00000000"  // VOLUME
    ]
 ]
}

Recent trades list

/api/v1/trades

Get recent trades (up to last 500).

Weight: 1

Parameters:

Name Type Mandatory Description
symbol STRING YES
limit INT NO Default 500; max 1000

Response:

[
 {
  "id": "7308f7f46c4e464d9bc6b11685db8222",
  "price":  "4.00000100"
  "qty":  "4.00000100"
  "time":  1499865549590
  "isBuyerMaker":  true
 }
]

Kline/Candlestick data

/api/v1/klines

Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.

Weight: 1

Parameters:

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

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

Response:

[
 [
  1499040000000       // Open Time,
  "0.01634790"        // Open,
  "0.80000000"        // High,
  "0.01575800"        // Low,
  "0.01577100"        // CLose,
  "148976.11427815"   // Volume,
  1499040000000       // Close Time,
 ]
]

Current average price

/api/v1/avgPrice

Current average price for a symbol

Weight: 1

Parameters:

Name Type Mandatory Description
symbol STRING YES

Response:

{
  "price": "9.35751834",
  "mins": 5
}

24hr ticker statistics

/api/v1/ticker/24hr

24 hour rolling window statistics

Weight: 1

Parameters:

Name Type Mandatory Description
symbol STRING YES

Response:

[
 {
  "symbol": "BTCUSDT",
  "priceChange":  "243.00"
  "priceChangePercent":  "+4.21%"
  "lastPrice":  "10050.00" 
  "bidPrice:  "10045.05"
  "askPrice":  "10053.14"
  "openPrice":  "9644.25"
  "highPrice":  "10050.0"
  "lowPrice":  "10010.0"
  "volume":  "39033"
  "openTime":  1499783499040
  "closeTime":  1499869899040   
 }
]

Symbol price ticker

/api/v1/ticker/price

Latest price for a symbol or symbols

Weight: 1

Parameters:

Name Type Mandatory Description
symbol STRING YES

Response:

[
 {
  "symbol": "BTCUSDT",
  "price":  "10047.42"  
 },
 {
  "symbol": "ETHUSDT",
  "price":  "243.00"  
 }
]

Private User Account Methods

Account information

/api/v1/account

Get current account information

Weight: 5

Parameters: NONE

Response:

{
  "canTrade": true,
  "canWithdraw": true,
  "canDeposit": true,
  "balances": [
     {
      "asset": "BTC",
      "free":  "2.45620000",
      "locked":  "0.00000000"
     },
     {
      "asset": "LTC",
      "free":  "4763368.68006011",
      "locked":  "0.00000000"
     }
  ]
}

Query order

/api/v1/order

Check an order's status

Weight: 1

Parameters:

Name Type Mandatory Description
orderId STRING YES

Response:

{
  "symbol": "BTCUSDT",
  "orderId":  "7308f7f46c4e464d9bc6b11685db8222",
  "price":  "9672.23",
  "origQty":  "1.0" ,
  "executedQty:  "0.0",
  status:  "NEW",
  "type":  "LIMIT",
  "side":  "BUY",
  "time":  1499827319559,
  "updateTime":  1499827319559
}

Current open orders

/api/v1/openOrders

Get all open orders on a symbol.

Weight: 2

Parameters:

Name Type Mandatory Description
symbol STRING NO

Response:

[
 {
   "symbol": "BTCUSDT",
   "orderId":  "7308f7f46c4e464d9bc6b11685db8222",
   "price":  "9672.23",
   "origQty":  "1.0" ,
   "executedQty:  "0.0",
   status:  "NEW",
   "type":  "LIMIT",
   "side":  "BUY",
   "time":  1499827319559,
   "updateTime":  1499827319559
 }
]

All orders

/api/v1/allOrders

Get all account orders; active, canceled, or filled.

Weight: 5

Parameters:

Name Type Mandatory Description
symbol STRING YES
startTime LONG NO
endTime LONG NO
limit INT NO Default 500; max 1000

Response:

[
 {
   "symbol": "BTCUSDT",
   "orderId":  "7308f7f46c4e464d9bc6b11685db8222",
   "price":  "9672.23",
   "origQty":  "1.0" ,
   "executedQty:  "0.0",
   status:  "NEW",
   "type":  "LIMIT",
   "side":  "BUY",
   "time":  1499827319559,
   "updateTime":  1499827319559
 }
]

Account trade list

/api/v1/myTrades

Get trades for a specific account and symbol.

Weight: 5

Parameters:

Name Type Mandatory Description
symbol STRING YES
startTime LONG NO
endTime LONG NO
fromId LONG NO TradeId to fetch from. Default gets most recent trades.
limit INT NO Default 500; max 1000

Response:

[
 {
  "id": "7308f7f46c4e464d9bc6b11685db8222",
  "price":  "4.00000100"
  "qty":  "4.00000100"
  "time":  1499865549590
  "isBuyerMaker":  true
 }
]

Private User Trading Methods

New order

/api/v1/order

Send in a new order

Weight: 1

Parameters:

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

Response:

{
  "symbol": "BTCUSDT",
  "orderId":  "7308f7f46c4e464d9bc6b11685db8222",
  "price":  "9672.23",
  "origQty":  "1.0" ,
  "executedQty:  "0.0",
  status:  "NEW",
  "type":  "LIMIT",
  "side":  "BUY",
  "time":  1499827319559,
  "updateTime":  1499827319559
}

Cancel order

/api/v1/cancelOrder

Cancel an active order.

Weight: 1

Parameters:

Name Type Mandatory Description
orderId STRING YES

Response:

{
  "symbol": "BTCUSDT",
  "orderId":  "7308f7f46c4e464d9bc6b11685db8222",
  "price":  "9672.23",
  "origQty":  "1.0" ,
  "executedQty:  "0.0",
  status:  "NEW",
  "type":  "LIMIT",
  "side":  "BUY",
  "time":  1499827319559,
  "updateTime":  1499827319559
}