Base URL
The base url of open API can be found here
Public Options Endpoints
exchange
Current trading rules and symbol information.
Request Weight:
0
Request Url:
GET /openapi/v1/exchange
Parameters:
None
Response:
name | type | example | description |
---|
| | | |
| | | |
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.
For filters
in options
field:
Example:
{
'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
},...
]
}
getOptions
Retrieves available trading and expired options. Expired options will be returned if expired
is set true
.
Request Weight:
1
Request URL:
GET /openapi/v1/getOptions
Parameters:
Response:
Example:
[
{'symbol': 'BTC0412PS5100',
'strike': '5100.0',
'created': '1554710400000',
'expiration': '1555055400000',
'optionType': 0,
'maxPayOff': '500.0',
'underlying': 'BTCUSDT',
'settlement': 'weekly'
},...
]
index
Retrieves the current index price and EDP. This API endpoint does not take any Parameters.
Request Weight:
0
Request URL:
GET /openapi/quote/v1/option/index
Parameters:
None
Response:
Example:
{
'BTCUSDT':{
'index':3795.77,
'edp': 3652.81
},
...
}
depth
Retrieves the options order book.
Request Weight:
Adjusted based on the limit:
Request Url:
GET /openapi/quote/v1/option/depth
Parameters:
Response:
The fields bids
and asks
are lists of order book price level entries, sorted from best to worst.
Example:
{
'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']]
}
trades
Retrieve the latest trades that have occurred for a specific option.
Request Weight:
1
Request URL:
GET /openapi/quote/v1/option/trades
Parameters:
Response:
Example:
[
{
'price': '1.21',
'time': 1555034474064,
'qty': '0.725',
'isBuyerMaker': False
},...
]
klines
Retrieves the kline information (open, high, trade volume, etc.) for a specific option.
Request Weight:
1
Request URL:
GET /openapi/quote/v1/option/klines
Parameters:
Response:
Example:
[
[
1538728740000, //'opentime'
'36.000000000000000000', //'open'
'36.000000000000000000', //'high'
'36.000000000000000000', //'low':
'36.000000000000000000', //'close'
'148976.11427815', // Volume
1499644799999, // Close time
'2434.19055334', // Quote asset volume
308, // 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.
Private Options Endpoints
order
Places a buy order for an option. This API endpoint requires your request to be signed.
Request Weight:
1
Request URL:
POST /openapi/openapi/option/order
Parameters:
You can get options' price, quantity configuration data in the exchange
endpoint.
Response:
In the fees
field:
Example:
{
'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':[]
}
cancel
Cancels an order, specified by orderId
or clientOrderId
. This API endpoint requires your request to be signed.
Request Weight:
1
Request Url:
DELETE /openapi/option/v1/order/cancel
Parameter:
One MUST be provided of these two parameters.
Response:
In the fees
field:
Example:
{
'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': []
}
openOrders
Retrieves open orders. This API endpoint requires your request to be signed.
Request Weight:
1
Request Url:
GET /openapi/option/v1/openOrders
Parameters:
If orderId
is set, it will get orders < that orderId
. Otherwise most recent orders are returned.
Response:
In the fees
field:
Example:
[
{
'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': []
},...
]
positions
Retrieves current positions. This API endpoint requires your request to be signed.
Request Weight:
1
Request Url:
GET /openapi/option/v1/positions
Parameters:
Response:
For each unique symbol
, this endpoint will return the following information.
Example:
[
{
'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'
},...
]
historyOrders
Retrieves history of orders that have been partially or fully filled or canceled. This API endpoint requires your request to be signed.
Request Weight:
1
Request Url:
GET /openapi/option/v1/historyOrders
Parameters:
Response:
In the fees
field:
Example:
{
[
{
'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':[]
},...
]
}
getOrder
Get details on a specific order, regardless of order state.
Request Weight:
1
Request Url:
GET /openapi/option/v1/getOrder
Parameters:
Response:
In the fees
field:
Example:
{
'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':[]
}
myTrades
Retrieve the trade history of the account. This API endpoint requires your request to be signed.
Request Weight:
1
Request Url:
GET /openapi/option/v1/myTrades
Parameters:
Response:
Example:
[
{
'time': '1554897921663',
'tradeId': '336902617393292032',
'orderId': '336902617267462912',
"matchOrderId": 336002617267469062,
'price': '99',
'quantity': '11.414',
'feeTokenName': 'BUSDT',
'fee': '0.1129986',
'type': 'LIMIT',
'side': 'BUY',
'symbol': 'BTC0412PS3900'
},...
]
settlements
Retrieves settlement events that have affected your account. This API endpoint requires your request to be signed.
Request Weight:
1
Request Url:
GET /openapi/option/v1/settlements
Parameters:
None
Responses:
Examples:
[
{'symbol': 'BTC0405PS3850',
'optionType': 'put',
'margin': '0',
'timestamp': '1554451200000',
'strikePrice': '3850',
'settlementPrice': '4956.54',
'maxPayOff': '500',
'averagePrice': '119.27',
'position': '0',
'changed': '0',
'changedRate': '0'},...
]
account
This endpoint is used to retrieve options account balance. This endpoint requires you to be signed.
Request Weight:
1
Request Url:
GET /openapi/option/v1/account
Parameters:
None
Response:
In the balances
field:
Examples:
{
'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'
},...
]
}