The base url of broker open API can be found here
Current broker trading rules and symbol information.
0
GET /openapi/v1/brokerInfo
None
name | type | example | description |
| string |
| Timezone of timestamp |
| long |
| Retrieves the current time on server (in ms). |
In the symbols
field, the endpoint will return information on current actively trading cryptos. You can ignore this section.
In the options
field: All actively trading options will be displayed.
name | type | example | description |
| string |
| Name of the option |
| string |
| Status of the option |
| string |
| Underlying asset for the option |
| float |
| Precision of the option quantity |
| string |
| Quote asset for the option |
| float |
| Precision of the option price |
| string |
| Whether iceberg orders are allowed. |
For filters
in options
field:
name | type | example | description |
| string |
| Type of the filter. |
| float |
| Precision of the option price。 |
| float |
| |
| float |
| Precision of the option price. |
| float |
| Minimal trading quantity of the option |
| float |
| |
| float |
| Precision of the option quantity |
| float |
| Precision of the option order size (quantity * price) |
{'timezone': 'UTC','serverTime': '1555048558151','brokerFilters': [],'symbols': [{...}],'options': [{'filters': [{'minPrice': '0.01','maxPrice': '100000.00000000','tickSize': '0.01','filterType': 'PRICE_FILTER'},{'minQty': '0.01','maxQty': '100000.00000000','stepSize': '0.001','filterType': 'LOT_SIZE'},{'minNotional': '1','filterType': 'MIN_NOTIONAL'}],'exchangeId': '301','symbol': 'BTC0412PS5100','status': 'TRADING','baseAsset': 'BTC0412PS5100','baseAssetPrecision': '0.001','quoteAsset': 'USDT','quotePrecision': '0.01','icebergAllowed': False},...]}
Retrieves available trading and expired options. Expired options will be returned if expired
is set true
.
1
GET /openapi/v1/getOptions
name | type | required | default | description |
| string |
|
| Set to |
name | type | example | description |
| string |
| Name of the option. 'underlying - expiration date - option type(CS is call spread and PS is put spread) - strike' |
| float |
| The strike price of the option. |
| long |
| Unix timestamp when the option was first created (ms). |
| long |
| Unix timestamp when the option will expire (ms) |
| integer |
|
|
| float |
| The maximum payoff of the option. |
| string |
| The underlying price index name of the option |
| string |
| The settlement interval. |
[{'symbol': 'BTC0412PS5100','strike': '5100.0','created': '1554710400000','expiration': '1555055400000','optionType': 0,'maxPayOff': '500.0','underlying': 'BTCUSDT','settlement': 'weekly'},...]
Retrieves the current index price and EDP. This API endpoint does not take any Parameters.
0
GET /openapi/quote/v1/option/index
None
name | type | example | description |
| float |
| The currency index price. |
| float |
| Estimated delivery price (Average index price in the last 10 minutes). |
{'BTCUSDT':{'index':3795.77,'edp': 3652.81},...}
Retrieves the options order book.
Adjusted based on the limit:
Limit | Weight |
5, 10, 20, 50, 100 | 1 |
500 | 5 |
1000 | 10 |
GET /openapi/quote/v1/option/depth
parameter | type | required | default | description |
| string |
| | The option name for which to retrieve the order book, use |
| integer |
|
| The number of entries to return for bids and asks. |
name | type | example | description |
| long |
| Current timestamp (ms) |
| list | (see below) | List of all bids, best bids first. See below for entry details. |
| list | (see below) | List of all asks, best asks first. See below for entry details. |
The fields bids
and asks
are lists of order book price level entries, sorted from best to worst.
name | type | example | description |
| float |
| price level |
| float |
| The total quantity of orders for this price level |
{'time': 1555049455783,'bids': [['78.82', '0.526'],//[Price, Quantity]['77.24', '1.22'],['76.65', '1.043'],['76.58', '1.34'],['75.67', '1.52'],['75.12', '0.635'],['75.02', '0.72'],['75.01', '0.672'],['73.73', '1.282'],['73.58', '1.116'],['73.45', '0.471'],['73.44', '0.483'],['72.32', '0.383'],['72.26', '1.283'],['72.11', '0.703'],['70.61', '0.454']],'asks': [['122.96', '0.381'],//[Price, Quantity]['144.46', '1'],['155.55', '0.065'],['160.16', '0.052'],['200', '0.775'],['249', '0.17'],['250', '1'],['300', '1'],['400', '1'],['499', '1']]}
Retrieve the latest trades that have occurred for a specific option.
1
GET /openapi/quote/v1/option/trades
Parameter | type | required | default | description |
| string |
| | The name of the option. |
| integer |
|
| The number of trades returned |
name | type | example | description |
| float |
| The price of the trade |
| long |
| Current timestamp (ms) |
| float |
| The quantity traded |
| string |
| Maker or taker of the trade. |
[{'price': '1.21','time': 1555034474064,'qty': '0.725','isBuyerMaker': False},...]
Retrieves the kline information (open, high, trade volume, etc.) for a specific option.
1
GET /openapi/quote/v1/option/klines
Parameter | type | required | default | description |
| string |
| | Name of the option. |
| string |
| | Interval of the kline. Possible values include: |
| integer |
|
| Number of entries returned. Max is capped at 1000. |
| integer |
| | timestamp of the last datapoint |
name | type | example | description |
| long |
| Open Time |
| float |
| Open |
| float |
| High |
| float |
| Low |
| float |
| Close |
| float |
| Trade volume amount |
| long |
| Close time |
| float |
| Quote asset volume |
| integer |
| Number of trades |
| float |
| Taker buy base asset volume |
| float |
| Taker buy quote asset volume |
[[1538728740000, //'opentime''36.000000000000000000', //'open''36.000000000000000000', //'high''36.000000000000000000', //'low':'36.000000000000000000', //'close''148976.11427815', // Volume1499644799999, // Close time'2434.19055334', // Quote asset volume308, // Number of trades'1756.87402397', // Taker buy base asset volume'28.46694368' // Taker buy quote asset volume],...]
base asset
refers to the asset that is the quantity of a symbol.
quote asset
refers to the asset that is the price of a symbol.
Places a buy order for an option. This API endpoint requires your request to be signed.
1
POST /openapi/openapi/option/order
Parameter | type | required | example | description |
| string |
|
| Name of option |
| string/long |
|
| A unique ID of the order. Automatically generated if not sent. |
| string |
|
| Direction of the order. Possible values include |
| string |
|
| The order type, possible types: |
| string |
|
| Time in force. Possible values include |
| float |
|
| Price of the order |
| float |
|
| The number of contracts to buy |
You can get options' price, quantity configuration data in the brokerInfo
endpoint.
Name | type | example | description |
| long |
| Timestamp when the order is created. |
| long |
| Last time this order was updated |
| integer |
| ID of the order. |
| integer |
| A unique ID of the order. |
| string |
| Name of the option. |
| float |
| Price of the order. |
| float |
| Quantity ordered |
| float |
| Quantity of orders that has been executed |
| float |
| Average price of filled orders. |
| string |
| The order type, possible types: |
| string |
| Direction of the order. Possible values include |
| string |
| The state of the order.Possible values include |
| string |
| Time in force. Possible values include |
| | | Fees incurred for this order. |
In the fees
field:
Name | type | example | description |
| string |
| Fee token kind. |
| float |
| Actual transaction fees occurred. |
{'time':1541161088303,'updateTime': 1541161088303,'orderId': 28,'clientOrderId': 213443,'symbol': 'BTC0412CS4200','price': 102.32,'origQty': 21.3,'executedQty': 10.2,'avgPrice': 3121.13'type': 'LIMIT','side': 'SELL','status': 'NEW','timeInForce': 'GTC','fees':[]}
Cancels an order, specified by orderId
or clientOrderId
. This API endpoint requires your request to be signed.
1
DELETE /openapi/option/v1/order/cancel
Parameter | type | required | default | description |
| integer |
|
| The order ID of the order to be canceled |
| string/long |
| | Unique ID of the order. |
One MUST be provided of these two parameters.
Name | type | example | description |
| long |
| Timestamp when order request is submitted (ms). |
| long |
| Last time this order was updated (ms) |
| integer |
| ID of the order |
| string |
| Unique ID of the order. |
| string |
| name of the option |
| float | | Price of the order. |
| float |
| Quantity ordered |
| float |
| Quantity of orders that has been executed |
| float |
| Average price of filled orders. |
| string |
| The order type, possible types: |
| string |
| Direction of the order. Possible values include |
| string |
| The state of the order.Possible values include |
| string |
| Time in force. Possible values include |
| | | Fees incurred for this order. |
In the fees
field:
Name | type | example | description |
| string |
| Fee token kind. |
| float |
| Actual transaction fees occurred. |
{'time':1541161088303,'updateTime': 1541161088303,'orderId': 713637304,'clientOrderId': 213443,'symbol': 'BTC0412CS4200','price': 102.32,'origQty': 21.3,'executedQty': 10.2,'avgPrice': 3121.13'type': 'LIMIT','side': 'SELL','status': 'CANCELED', //status will always be `CANCELED` for cancel request'timeInForce': 'GTC','fees': []}
Retrieves open orders. This API endpoint requires your request to be signed.
1
GET /openapi/option/v1/openOrders
Parameter | type | required | default | description |
| string |
| | Symbol to return open orders for. If not sent, orders of all options will be returned. |
| integer |
| | Order ID |
| string |
| | Direction of the order, possible values include |
| string |
| | Order types to return, possible values include |
| integer |
|
| Number of entries to return. |
If orderId
is set, it will get orders < that orderId
. Otherwise most recent orders are returned.
Name | type | example | description |
| long |
| Timestamp when order request is submitted (ms). |
| long |
| Last time this order was updated (ms) |
| integer |
| ID of the order |
| string |
| Unique ID of the order. |
| string |
| name of the option |
| float |
| Price of the order. |
| float |
| Quantity ordered |
| float |
| Quantity of orders that has been executed |
| float |
| Average price of filled orders. |
| string |
| The order type, possible types: |
| string |
| Direction of the order. Possible values include |
| string |
| The state of the order.Possible values include |
| string |
| Time in force. Possible values include |
| | | Fees incurred for this order. |
In the fees
field:
Name | type | example | description |
| string |
| Fee token kind. |
| float |
| Actual transaction fees occurred. |
[{'time': '1554948456641','updateTime': '0','orderId': '337326535438529024','clientOrderId': '19524737','symbol': 'BTC0412CS4200','price': '1.98','origQty': '1','executedQty': '0','avgPrice': '0','type': 'LIMIT','side': 'BUY','status': 'NEW','timeInForce': 'GTC','fees': []},...]
Retrieves current positions. This API endpoint requires your request to be signed.
1
GET /openapi/option/v1/positions
Parameter | type | required | default | description |
| string |
| | Name of the option. If not sent, positions for all options will be returned. |
For each unique symbol
, this endpoint will return the following information.
name | type | example | description |
| string |
| Name of the option. |
| float |
| The position of the option. Can be negative (short) or positive (long) |
| float |
| Total margin amount for position held. |
| integer |
| Settlement timestamp of the option. |
| float |
| Strike price of the option. |
| float |
| Current option price |
| float |
| Number of option contracts that can be closed. |
| float |
| Average price for the position |
| float |
| Profit or loss for holding the position. |
| float |
| Long Position: |
| float |
| Current index price of the underlying asset. |
[{'symbol': 'BTC0412CS4200','position': '-10.760','margin': '5380','settlementTime': '1555056000000','strikePrice': '4200','price': '500.00','availablePosition': '10.76','averagePrice': '126.56','changedRate': '-100.00','changed': '-4018.21','index': '5012.28666667'},...]
Retrieves history of orders that have been partially or fully filled or canceled. This API endpoint requires your request to be signed.
1
GET /openapi/option/v1/historyOrders
Parameter | type | required | efault | description |
| string |
| | Name of the option. If not sent, orders of all options will be returned. |
| string |
| Direction of the order. Possible values include | |
| string | | Order Type. Possible values include | |
| string | | Status of the order. Possible values include | |
| integer |
| Number of items to be returned | |
Name | type | example | description |
| long |
| Timestamp when order request is submitted (ms). |
| long |
| Last time this order was updated |
| integer |
| ID of the order |
| string |
| Unique ID of the order. |
| string |
| Name of the option |
| float | | Price of the order. |
| float |
| Quantity ordered |
| float |
| Quantity of orders that has been executed |
| float |
| Average price of filled orders. |
| string |
| The order type, possible types: |
| string |
| Direction of the order. Possible values include |
| string |
| The state of the order.Possible values include |
| string |
| Time in force. Possible values include |
| | | Fees incurred for this order. |
In the fees
field:
Name | type | example | description |
| string |
| Fee token kind. |
| float |
| Actual transaction fees occurred. |
{[{'time':1541161088303,'updateTime': 1541161088303,'orderId': 28,'clientOrderId': 213443,'symbol': 'BTC0412CS4200','price': 102.32,'origQty': 21.3,'executedQty': 10.2,'avgPrice': 3121.13'type': 'LIMIT','side': 'SELL','status': 'NEW','timeInForce': 'GTC','fees':[]},...]}
Get details on a specific order, regardless of order state.
1
GET /openapi/option/v1/getOrder
Parameter | type | required | default | description |
| integer |
| | Order ID. Either |
| string |
| | Unique client customized ID of the order. Either |
Name | type | example | description |
| long |
| Timestamp when order request is submitted (ms). |
| long |
| Last time this order was updated |
| integer |
| ID of the order |
| string |
| Unique ID of the order. |
| string |
| Name of the option |
| float | | Price of the order. |
| float |
| Quantity ordered |
| float |
| Quantity of orders that has been executed |
| float |
| Average price of filled orders. |
| string |
| The order type, possible types: |
| string |
| Direction of the order. Possible values include |
| string |
| The state of the order.Possible values include |
| string |
| Time in force. Possible values include |
| | | Fees incurred for this order. |
In the fees
field:
Name | type | example | description |
| string |
| Fee token kind. |
| float |
| Actual transaction fees occurred. |
{'time':1541161088303,'updateTime': 1541161088303,'orderId': 28,'clientOrderId': 213443,'symbol': 'BTC0412CS4200','price': 102.32,'origQty': 21.3,'executedQty': 10.2,'avgPrice': 3121.13'type': 'LIMIT','side': 'SELL','status': 'NEW','timeInForce': 'GTC','fees':[]}
Retrieve the trade history of the account. This API endpoint requires your request to be signed.
1
GET /openapi/option/v1/myTrades
Parameter | type | required | default | description |
| string |
| | Name of the option. If not sent, trades for all symbols will be returned. |
| integer |
|
| The number of trades returned (clamped to max 1000) |
| string |
| | Direction of the order. |
| integer |
| | TradeId to fetch from. |
| integer |
| | TradeId to fetch to. |
Name | type | example | description |
| long |
| The timestamp of the trade(ms) |
| long |
| The ID for the trade |
| long |
| ID of the order |
| long |
| ID of the match order |
| float |
| The price of the trade. |
| float |
| Quantity of the trade. |
| string |
| Fee token name |
| float |
| Fee of the trade. |
| string |
| Trade side from the user's point of view. Possible values include |
| string |
| The order type, possible types: |
| string |
| The name of the option |
[{'time': '1554897921663','tradeId': '336902617393292032','orderId': '336902617267462912',"matchOrderId": 336002617267469062,'price': '99','quantity': '11.414','feeTokenName': 'BUSDT','fee': '0.1129986','type': 'LIMIT','side': 'BUY','symbol': 'BTC0412PS3900'},...]
Retrieves settlement events that have affected your account. This API endpoint requires your request to be signed.
1
GET /openapi/option/v1/settlements
None
Name | type | example | description |
| string |
| Name of the option. |
| string |
| Type of the option. Possible values include: 'call' and 'put' |
| float |
| Margin for the position |
| integer |
| The timestamp of the settlement. |
| float |
| Strike price of the option |
| float |
| Settlement price (EDP, which is the average index price in the last 10 minutes) at time of settlement. |
| float |
| Maximum payoff of the option |
| float |
| Average price for the position |
| string |
| Position quantity |
| float |
| Settlement payoff of the option |
| float |
| Long Position: |
[{'symbol': 'BTC0405PS3850','optionType': 'put','margin': '0','timestamp': '1554451200000','strikePrice': '3850','settlementPrice': '4956.54','maxPayOff': '500','averagePrice': '119.27','position': '0','changed': '0','changedRate': '0'},...]
This endpoint is used to retrieve options account balance. This endpoint requires you to be signed.
1
GET /openapi/option/v1/account
None
Name | type | example | description |
| float |
| Total asset value in option account quoted in USDT. |
| float |
| Total option value quoted in USDT |
| float | | Show balance details. |
In the balances
field:
Name | type | example | description |
| string |
| Name of the asset |
| float |
| Amount available for use |
| float |
| Amount locked (for open orders) |
| float |
| Amount used for margin (for short positions) |
{'totalAsset': '8533.0606762','optionAsset': '558.1832','balances': [{'tokenName': 'USDT','free': '0.0','locked': '0.0','margin': '0.0'},{'tokenName': 'BUSDT','free': '7961.9951881','locked': '12.8822881','margin': '5798.0'},...]}