MOBI logo

API Introduction Edit

Welcome to MOBI API!

This is the official MOBI API document, and will be continue updating, please follow us to get latest news.

The example of request and response is showing in the right hand side.

API Key Authentication Edit

Making a request

All REST requests must contain the following headers:

ACCESS-KEY API key as a string

SIGNATURE Message signature (see below)

TIMESTAMP Timestamp for your request

The SIGNATURE header is generated by creating a sha256 HMAC using the secret key on the prehash string timestamp + method + requestPath + body (where + represents string concatenation). The timestamp value is the same as the TIMESTAMP header.

The body is the request body string. It is omitted if there is no request body (typically for GET requests).

The method should be UPPER CASE.

The requestPath is the full path and query parameters of the URL, e.g.: /v1.0/markets/symbols?coin_symbol=ETH.

The TIMESTAMP header MUST be number of seconds since Unix Epoch in UTC.

Your timestamp must be within 60 seconds of the API service time, or your request will be considered expired and rejected.

Success Edit

A successful response is indicated by HTTP status code 200 and may contain an optional body. If the response has a body it will be documented under each resource below.

Errors Edit

Unless otherwise stated, errors to bad requests will respond with HTTP 4xx or status codes. The body will also contain a message parameter indicating the cause. Your language's http library should be configured to provide message bodies for non-2xx requests so that you can read the message field from the body.

Common error codes

Status Code Reason
400 Bad Request -- Invalid request format
401 Unauthorized -- Invalid API Key
403 Forbidden -- You do not have access to the requested resource
404 Not Found
500 Internal Server Error -- We had a problem with our server
{
  "data": null,
  "code": 400,
  "message": "error message here"
}

Wallets withdrawal api Edit

API Key Permission:Wallet

Parameters
symbol
coin symbol example:USDT, ETH , All

The parameters must use RequestBody JSON

RequestBody:

  {
    "withdrawal_amount": "10", 
    "address": "0x8a9fcb56aabe5d828c23477b7b60e6e5b481a108",
    "memo":"E3JS",
    "symbol": "USDT",
    "network":"OMNI"
  }

The withdrawal api.

POST  /v1.0/wallets/coins/{symbol}/withdrawal
 {
   "data": null,      
   "code": "200", 
   "message": "success"
 }
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Wallets withdraw info details Edit

API Key Permission:Wallet

Parameters
symbol
coin symbol example:USDT, ETH , All

Gets information about the amount of money that can be transferred out in a given currency.

GET  /v1.0/wallets/coins/{symbol}/withdrawal
 {
     "data": {
         "symbol": "USDT",
         "network_list": [
             {
                 "network_name": "ERC20",
                 "min_withdraw_amount": "10",
                 "transaction_fee": "5",
                 "network_type": "address",     
                 "withdraw_scale": 6,               
                 "can_withdrawal": true         
             },
             {
                 "network_name": "OMNI",
                 "min_withdraw_amount": "200",
                 "transaction_fee": "5",
                 "network_type": "address",
                 "withdraw_scale": 6,
                 "can_withdrawal": true
             }
         ]
     },
     "code": "200",
     "message": "success"
 }
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Wallets deposit details Edit

API Key Permission:Wallet

Parameters
symbol
coin symbol example:USDT, ETH , All

Get the user’s inbound address information.

GET  /v1.0/wallets/coins/{symbol}/deposit
 {
   "data": {
     "symbol": "USDT", 
     "network_list": [
       {
         "address": "address", 
         "memo": "E3JS", 
         "min_deposit_amount": "1", 
         "network": "ERC20", 
         "confirmation": 12, 
         "can_deposit": true
       }, 
       {
         "address": "address", 
         "memo": "E3JS", 
         "min_deposit_amount": "0.1", 
         "network": "OMNI", 
         "confirmation": 12, 
         "can_deposit": false
       }
     ]
   }, 
   "code": "200", 
   "message": "success"
 }
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Wallets transaction history Edit

API Key Permission:Wallet

Parameters
symbol
coin symbol example:USDT, ETH , All
transaction_type
The transaction_type Example:all, deposit, withdrawal, transfer
start_time
The start timestamp
end_time
The end timestamp
limit
Default 500; max 1000.

The transaction history of the wallet can be searched according to different currencies and different types.

GET /v1.0/wallets/transaction-history
 {
   "data": {
     "transaction_history_list": [
       {
         "transaction_id": "M03130427093419294720", 
         "type": "withdrawal", 
         "time": "2020-12-07 20:51:04", 
         "symbol": "USDT", 
         "amount": "100000000", 
         "address": "0xcc7dc3f8cf73916005439e22ce269a718b3a03cd", 
         "txid": "0xc0851f97dcc49e3cc7153ec7cdaeecf209392936f971a7f42cd4c8db70c94536", 
         "status": "Completed", 
         "network_confirmation": "12/12", 
         "network": "ERC20", 
         "transaction_fee": "0"
       }
     ], 
     "total_page": 3, 
     "total_number": 48
   }, 
   "code": "200", 
   "message": "success"
 }
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Wallets get coin balance Edit

API Key Permission:Wallet

Get user coin balance.

GET  /v1.0/wallets/coins
 {
   "data": [
     {
       "symbol": "ETH", 
       "available_amount": "17485388032.4", 
       "locked_amount": "0"
     }
   ], 
   "code": "200", 
   "message": "success"
 }
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Wallets support coin list Edit

API Key Permission:Wallet

Get supported coins.

GET  /v1.0/coins
 {
   "data": [
     {
       "symbol": "ETH", 
       "icon_url": "url"
     }
   ], 
   "code": "200", 
   "message": "success"
 }
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Place a New Order Edit

API Key Permission:Trade

Parameters
type
limit_price or market_price (default is limit_price )
direction
buy or sell
symbol
A valid symbol:BTC-USDT
price
Price per bitcoin (not available for market order)
amount
Amount of base currency to buy or sell

The parameters must use RequestBody JSON

You can place two types of orders: limit and market. Orders can only be placed if your account has sufficient funds.

POST /v1.0/trades/spot/orders
{
  "data": "T08128123000582660096",
  "code": "200",
  "message": "success"
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Get an Order Edit

API Key Permission:Read

Open orders may change state between the request and the response depending on market conditions.

Get a single order by order id from the profile that the API key belongs to.

GET /v1.0/trades/spot/orders/{orderId}
{
  "data": {
     "order_id":"T08128123000582660096",
     "member_id":"1",
     "type":"LIMIT_PRICE",
     "amount":"100.0"
     "symbol":"BTC-USDT",
     "symbol_display_name":"BTC/USDT",
     "trade_amount":"100.0",
     "trunover":"100.0",
     "coin_symbol":"BTC",
     "base_symbol":"USDT",
     "status":"TRADING",
     "direction":"BUY",
     "price":"1.0",
     "time":"1605166008",
     "completed_time":"1605166008",
     "canceled_time":"1605166008",
     "use_discount":"0",
     "order_detail":[{
           "order_id":"T08128123000582660096",
           "price":"1.0",
           "amount":"100.0",
           "tunover":"100.0",
           "fee":"0.1",
           "time":"1605166008"
     }]
   }, 
  "code": "200", 
  "message": "success"
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Cancel an Order Edit

API Key Permission:Trade

If the order could not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.

Cancel a previously placed order. Order must belong to the profile that the API key belongs to.

DELETE /v1.0/trades/spot/orders/{orderId}
{
  "data": 1,
  "code": "200",
  "message": "success"
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Cancel all Edit

API Key Permission:Trade

Parameters
symbol
The trading symbol

The response was the number of cancellations.

With best effort, cancel all open orders from the profile that the API key belongs to.

DELETE /v1.0/trades/spot/orders
{
  "data": {success:3,failure:1},
  "code": "200",
  "message": "success"
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

List Open Orders Edit

API Key Permission:Read

Parameters
symbol
The trading symbol to trade
type
market_price|limit_price|all
start_time
the start timestamp
end_time
the end timestamp
direction
sell|buy|all,Filter on the direction of the trade
limit
Default 500; max 1000.

List your current open orders from the profile that the API key belongs to. Only open or un-settled orders are returned. As soon as an order is no longer open and settled, it will no longer appear in the default request.

GET /v1.0/trades/spot/orders/open-orders
{
  "data": {
      "total_pages": 1, 
      "total_elememts":10
      "content": [
      {
       "order_id":"T08128123000582660096",
         "member_id":"1",
         "type":"LIMIT_PRICE",
         "amount":"100.0"
         "symbol":"BTC-USDT",
         "symbol_display_name":"BTC/USDT",
         "trade_amount":"100.0",
         "trunover":"100.0",
         "coin_symbol":"BTC",
         "base_symbol":"USDT",
         "status":"TRADING",
         "direction":"BUY",
         "price":"1.0",
         "time":"1605166008",
         "completed_time":"1605166008",
         "canceled_time":"1605166008",
         "use_discount":"0",
         "order_detail":
           [{
            "order_id":"T08128123000582660096",
            "price":"1.0",
            "amount":"100.0",
            "tunover":"100.0",
            "fee":"0.1",
            "time":"1605166008"
           }]
      }
    ]
  }, 
  "code": "200", 
  "message": "success"
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

List Historical Orders Edit

API Key Permission:Read

Parameters
symbol
The trading symbol to trade
type
market_price|limit_price|all
start_time
the start timestamp
end_time
the end timestamp
direction
sell|buy|all,Filter on the direction of the trade
limit
Default 500; max 1000.

List your historical orders from the profile that the API key belongs to. Only completed or canceled orders are returned.

GET /v1.0/trades/spot/orders/order-history
{
  "data": {
      "total_pages": 1, 
      "total_elememts":10
      "content": [
      {
       "order_id":"T08128123000582660096",
         "member_id":"1",
         "type":"LIMIT_PRICE",
         "amount":"100.0"
         "symbol":"BTC-USDT",
         "symbol_display_name":"BTC/USDT",
         "trade_amount":"100.0",
         "trunover":"100.0",
         "coin_symbol":"BTC",
         "base_symbol":"USDT",
         "status":"TRADING",
         "direction":"BUY",
         "price":"1.0",
         "time":"1605166008",
         "completed_time":"1605166008",
         "canceled_time":"1605166008",
         "use_discount":"0",
         "order_detail":
           [{
            "order_id":"T08128123000582660096",
            "price":"1.0",
            "amount":"100.0",
            "tunover":"100.0",
            "fee":"0.1",
            "time":"1605166008"
           }]
      }
    ]
  }, 
  "code": "200", 
  "message": "success"
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

List Trade History Orders Edit

API Key Permission:Read

Parameters
symbol
The trading symbol to trade
type
market_price|limit_price|all
start_time
the start timestamp
end_time
the end timestamp
direction
sell|buy|all,Filter on the direction of the trade
limit
Default 500; max 1000.

List your trade historical orders from the profile that the API key belongs to. Only completed orders are returned.

GET /v1.0/trades/spot/orders/trade-history
{
  "data": {
      "total_pages": 1, 
      "total_elememts":10
      "content": [
      {
       "order_id":"T08128123000582660096",
         "member_id":"1",
         "type":"LIMIT_PRICE",
         "amount":"100.0"
         "symbol":"BTC-USDT",
         "symbol_display_name":"BTC/USDT",
         "trade_amount":"100.0",
         "trunover":"100.0",
         "coin_symbol":"BTC",
         "base_symbol":"USDT",
         "status":"TRADING",
         "direction":"BUY",
         "price":"1.0",
         "time":"1605166008",
         "completed_time":"1605166008",
         "canceled_time":"1605166008",
         "use_discount":"0",
         "order_detail":
           [{
            "order_id":"T08128123000582660096",
            "price":"1.0",
            "amount":"100.0",
            "tunover":"100.0",
            "fee":"0.1",
            "time":"1605166008"
           }]
      }
    ]
  }, 
  "code": "200", 
  "message": "success"
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Get Order Match-results Edit

API Key Permission:Read

The return data contains a list and each item in the list represents a match result.

This endpoint returns the match results of past and open orders based on specific search criteria.

GET /v1.0/trades/spot/orders/{orderId}/match-results
{
   "code": "200",
   "message": "success",
   "data": [{
      order_id:"T08128123000582660096",
      amount:"1000.0",
      price:"10.0",
      turnover:"100.0",
      fee:"0.2",
      time:"1605164996"
    }]
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Get Symbols Edit

Symbol ID will not change once assigned to a product but all other fields ares subject to change.

Get a list of available currency pairs for trading.

GET /v1.0/markets/symbols
{
  "data": [
   {
     symbol:"ETH-USDT",                
     display_name:"ETH/USDT",          
     coin_symbol:"ETH",                
     base_symbol:"USDT",              
     enable:1,                        
     fee:0.01,                        
     sort:1,                           
     coin_scale:1,                     
     base_coin_scale:1,               
     min_sell_price:0.1,               
     max_buy_price:0.2,                
     enable_market_sell:1,           
     enable_market_buy:1,           
     max_trading_time:1605787212,     
     max_trading_order:10001,          
     robot_type:0,                     
     flag:0,
     min_turnover:0,                   
     zone:1,                          
     min_volume:100.0,                 
     max_volume:100.0,                 
     publish_type:1,                   
     start_time:"2000-01-01 01:00:00", 
     end_time:"2000-01-01 01:00:00",  
     clear_time:"2000-01-01 01:00:00",
     publish_price:0.01,              
     publish_amount:0.01,              
     visible:1,                       
     exchangeable:1                   
    }
   ],
   "code": 200, 
  "message": "success"
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Get Single Symbol Edit

Get market data for a specific currency pair.

GET /v1.0/markets/symbols/{symbol}
{
  "data": {
     symbol:"ETH-USDT",                
     display_name:"ETH/USDT",          
     coin_symbol:"ETH",                
     base_symbol:"USDT",              
     enable:1,                        
     fee:0.01,                        
     sort:1,                           
     coin_scale:1,                     
     base_coin_scale:1,               
     min_sell_price:0.1,               
     max_buy_price:0.2,                
     enable_market_sell:1,           
     enable_market_buy:1,           
     max_trading_time:1605787212,     
     max_trading_order:10001,          
     robot_type:0,                     
     flag:0,
     min_turnover:0,                   
     zone:1,                          
     min_volume:100.0,                 
     max_volume:100.0,                 
     publish_type:1,                   
     start_time:"2000-01-01 01:00:00", 
     end_time:"2000-01-01 01:00:00",  
     clear_time:"2000-01-01 01:00:00",
     publish_price:0.01,              
     publish_amount:0.01,              
     visible:1,                       
     exchangeable:1                   
    },
   "code": 200, 
  "message": "success"
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Get Order Book Edit

Parameters
type
Select response detail. Valid types are documented below.
scale
the scale default is 0.00000001
Type Description
all Only the best bid and ask
mini Top 50 bids and asks (aggregated)
full Full order book (non aggregated)

Get a list of open orders for a symbol.

GET /v1.0/markets/{symbol}/order-book
{
"data": {
    "ask": {
        "symbol": "ETH-USDT",
        "symbol_display_name": "ETH/USDT",
        "min_amount": 2.00000000,
        "lowest_price": 0.04000000,
        "max_amount": 10.00000000,
        "highest_price": 0.06000000,
        "items": [
            {
                "amount": 10.00000000,
                "price": 0.04000000
            }
        ],
        "direction": "SELL"
    },
    "bid": {
        "symbol": "ETH-USDT",
        "symbol_display_name": "ETH/USDT",
        "min_amount": 1733.00000000,
        "lowest_price": 0.01000000,
        "max_amount": 1733.00000000,
        "highest_price": 0.01000000,
        "items": [
            {
                "amount": 1733.00000000,
                "price": 0.01000000
            }
        ],
        "direction": "BUY"
    }
    },
    "code": "200",
    "message": "success"
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Get Trades Edit

Parameters
size
The number of data returns

List the latest trades for a symbol.

GET /v1.0/markets/{symbol}/trades
{
  "data": [
   {
    "symbol":"ETH-USDT", 
    "price":"1.0",
    "amount":"100.0"
    "buy_turnover":"100.0",
    "sell_turnover":"100.0",
    "direction":"BUY",
    "buy_order_id":"T08128123000582660096",
    "sell_order_id":"T08128123000582660098",
    "time":"1605166008"
   }],
  "code": 200,
  "message": "success"
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Get Klines Edit

Parameters
from
The start time.
to
The end time.
resolution
min,hour,day,week,month
example:
50,24h,1d,1w,1m
Minutes don't need units

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

This endpoint retrieves all klines in a specific range.

GET /v1.0/markets/{symbol}/klines
{
   "data":[
    {
      "0":"1605787212",//time
      "1":0.2,         //open
      "2":0.3,         //heigh
      "3":0.1,         //low
      "4":0.1,         //close
      "5":0.5          //volume
     }
    ], 
   "code": "200", 
   "message": "success"
}
{
  "data": null,
  "code": "400",
  "message": "error message here"
}

Protocol overview Edit

The websocket feed uses a bidirectional protocol, which encodes all messages as JSON objects. All messages have a type attribute that can be used to handle the message appropriately.
Please note that new message types can be added at any point in time. Clients are expected to ignore messages they do not support.

The websocket feed provides real-time market data updates for orders and trades.

wss://ws-feed.powx.io/ws

Subscribe Edit

To begin receiving feed messages, you must first send a subscribe message to the server indicating which channels and products to receive. This message is mandatory — you will be disconnected if no subscribe has been received within 5 seconds.

  // Request
  {
    "type": "subscribe",
    "channels": [
        "heartbeat",
        {
          "name": "kline",
          "symbols": "ETH-USDT"
        }
    ]
  }
// Request
{
  "type": "unsubscribe",
  "symbols": [
      "ETH-USDT"
  ],
  "channels": ["kline"]
}

The Kline Channel Edit

This topic sends a new candlestick whenever it is available.

  {
    "type": "subscribe",
    "channels": [
        {
          "name": "kline",
          "symbol": "ETH-USDT",
          "period": "1h" //min,hour,day,week,month
        }
    ]
  }
  {
    "symbol": "ETH-USDT",
    "time": "1605787212",
    "open_price":"0.2",
    "highest_price":0.2,
    "lowest_price":0.3,
    "close_price":0.1, 
    "period":0.1,
    "count":0.5,
    "volume":1.0,
    "turnover": 10.0
  }

The Depth Channel Edit

This topic sends the latest market by price order book in snapshot mode at 1-minute interval.

  {
    "type": "subscribe",
    "channels": [
        {
          "name": "depth",
          "symbol": "ETH-USDT",
          "scale": "0.01"
        }
    ]
  }
{
    "symbol": "ETH-USDT",
    "symbol_display_name": "ETH/USDT",
    "min_amount": 2.00000000,
    "lowest_price": 0.04000000,
    "max_amount": 10.00000000,
    "highest_price": 0.06000000,
    "items": [
        {
            "amount": 10.00000000,
            "price": 0.04
        }
    ],
    "direction": "SELL"
}

The Trade Channel Edit

This topic sends the latest completed trade. It updates in tick by tick mode.

  {
    "type": "subscribe",
    "channels": [
        {
          "name": "trade",
          "symbol": "ETH-USDT"
        }
    ]
  }
{
  "symbol":"ETH-USDT", 
  "price":"1.0",
  "amount":"100.0"
  "buy_turnover":"100.0",
  "sell_turnover":"100.0",
  "direction":"BUY",//BUY,SELL
  "buy_order_id":"T08128123000582660096",
  "sell_order_id":"T08128123000582660098",
  "time":"1605166008"
}

The Ticker Channel Edit

Pushes any update to the best bid or ask’s price or quantity in real-time for all symbols.

  {
    "type": "subscribe",
    "channels": [
        {
          "name": "ticker",
          "symbol": "ETH-USDT",
          "scale": "0.01"
        }
    ]
  }
{
    "ask": {
        "symbol": "ETH-USDT",
        "symbol_display_name": "ETH/USDT",
        "min_amount": 2.00000000,
        "lowest_price": 0.04000000,
        "max_amount": 10.00000000,
        "highest_price": 0.06000000,
        "items": [
            {
                "amount": 10.00000000,
                "price": 0.04
            }
        ],
        "direction": "SELL"
    },
    "bid": {
        "symbol": "ETH-USDT",
        "symbol_display_name": "ETH/USDT",
        "min_amount": 1733.00000000,
        "lowest_price": 0.01000000,
        "max_amount": 1733.00000000,
        "highest_price": 0.01000000,
        "items": [
            {
                "amount": 1733.00000000,
                "price": 0.01
            }
        ],
        "direction": "BUY"
    }
}