Skip to content

Latest commit

 

History

History
731 lines (489 loc) · 34 KB

StockOptionsApi.md

File metadata and controls

731 lines (489 loc) · 34 KB

StockOptionsApi

All URIs are relative to https://api.gateio.ws/api/v4

Method HTTP request Description
queryOptionFeeRate GET /stock_options/fee-rate Get option trading fee rates
queryOptionSymbols GET /stock_options/underlyings List option underlyings
queryOptionContracts GET /stock_options/contracts List option contracts
queryOptionExpirations GET /stock_options/market/expirations List option expiration dates
queryOptionChain GET /stock_options/market/chain Get the option chain
queryOptionOrderBook GET /stock_options/market/{symbol}/orderbook Get the option order book
queryOptionPositions GET /stock_options/positions List current option positions
closeOptionPosition POST /stock_options/positions/close Close an option position
queryOptionOrderList GET /stock_options/orders List current option orders
createOptionOrder POST /stock_options/orders Create an option order
cancelAllOptionOrders DELETE /stock_options/orders Cancel all option limit orders
queryOptionOrderDetail GET /stock_options/orders/{order_id} Get option order details
updateOptionOrder PUT /stock_options/orders/{order_id} Amend an option limit order
cancelOptionOrder DELETE /stock_options/orders/{order_id} Cancel an option limit order
queryOptionOrderHistory GET /stock_options/orders/history List historical option orders

queryOptionFeeRate

Promise<{ response: http.IncomingMessage; body: StockOptionConfigResponse; }> queryOptionFeeRate()

Get option trading fee rates

Query the fee configuration for options trading before placing an order. Returns the rates and applicable minimum and maximum fees for SEC, TAF, OCC, ORF and CAT charges.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"

const api = new GateApi.StockOptionsApi(client);
api.queryOptionFeeRate()
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

This endpoint does not need any parameter.

Return type

Promise<{ response: AxiosResponse; body: StockOptionConfigResponse; }> StockOptionConfigResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

queryOptionSymbols

Promise<{ response: http.IncomingMessage; body: StockOptionSymbolListResponse; }> queryOptionSymbols(opts)

List option underlyings

Query available option underlyings before looking up contracts, expiration dates and option chains. Returns underlying symbols, names, multilingual descriptions, icons, price precision and order quantity limits. `underlyings` accepts multiple comma-separated symbols; omit it to query all available underlyings.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"

const api = new GateApi.StockOptionsApi(client);
const opts = {
  'underlyings': "AAPL,TSLA" // string | Comma-separated option underlying symbols, for example AAPL,TSLA. Omit to query all available underlyings.
};
api.queryOptionSymbols(opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
underlyings string Comma-separated option underlying symbols, for example AAPL,TSLA. Omit to query all available underlyings. [optional] [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: StockOptionSymbolListResponse; }> StockOptionSymbolListResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

queryOptionContracts

Promise<{ response: http.IncomingMessage; body: StockOptionContractListResponse; }> queryOptionContracts(underlying, opts)

List option contracts

Query option contracts for an underlying, including contract symbols, strike prices, expiration dates and trading rules. `underlying` is required. Filter by expiration date and call or put type; only US market (`us`) contracts are currently available. Results are paginated in ascending contract symbol order, with total records, total pages and the current page. The default and maximum `page_size` are both 1000. Use price precision and minimum and maximum order quantities to check an order before submission.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"

const api = new GateApi.StockOptionsApi(client);
const underlying = "AAPL"; // string | Option underlying symbol, for example AAPL. This is one underlying symbol, not an option contract symbol.
const opts = {
  'exchange': "us", // 'us' | Trading market filter. Only US market (us) contracts are currently available. Omitted or empty values use us. - us: US market.
  'expirationDate': new Date("2026-08-14"), // string | Option expiration date in YYYY-MM-DD format. Omit to disable expiration date filtering.
  'optionType': new StockOptionOptionType(), // StockOptionOptionType | Option type filter for the contract list. Omit for both types. - call: Call option. - put: Put option.
  'page': 1, // number | Page number, starting from 1. Defaults to 1 when omitted.
  'pageSize': 1000 // number | Contracts per page. Defaults to 1000 when omitted; values above 1000 are capped at 1000.
};
api.queryOptionContracts(underlying, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
underlying string Option underlying symbol, for example AAPL. This is one underlying symbol, not an option contract symbol. [default to undefined]
exchange Exchange Trading market filter. Only US market (us) contracts are currently available. Omitted or empty values use us. - us: US market. [optional] [default to undefined]
expirationDate string Option expiration date in YYYY-MM-DD format. Omit to disable expiration date filtering. [optional] [default to undefined]
optionType StockOptionOptionType Option type filter for the contract list. Omit for both types. - call: Call option. - put: Put option. [optional] [default to undefined]
page number Page number, starting from 1. Defaults to 1 when omitted. [optional] [default to 1]
pageSize number Contracts per page. Defaults to 1000 when omitted; values above 1000 are capped at 1000. [optional] [default to 1000]

Return type

Promise<{ response: AxiosResponse; body: StockOptionContractListResponse; }> StockOptionContractListResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

queryOptionExpirations

Promise<{ response: http.IncomingMessage; body: StockOptionExpirationListResponse; }> queryOptionExpirations(underlying)

List option expiration dates

Query expiration dates for an option underlying before selecting a contract expiration. `underlying` is required. Returns dates and their Unix timestamps; use the selected date to query the option chain.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"

const api = new GateApi.StockOptionsApi(client);
const underlying = "AAPL"; // string | Option underlying symbol, for example AAPL. This is one underlying symbol, not an option contract symbol.
api.queryOptionExpirations(underlying)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
underlying string Option underlying symbol, for example AAPL. This is one underlying symbol, not an option contract symbol. [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: StockOptionExpirationListResponse; }> StockOptionExpirationListResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

queryOptionChain

Promise<{ response: http.IncomingMessage; body: StockOptionOptionChainResponse; }> queryOptionChain(underlying, expirationDate, opts)

Get the option chain

Query option quotes at different strike prices for the same underlying and expiration date to compare call and put contracts. `underlying` and `expiration_date` are required. Set `option_type` to `call` or `put` to filter; omit it or use `all` for both types. Returns contract symbols, strike prices, bid and ask quotes, last prices, mark prices, implied volatility and Greeks.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"

const api = new GateApi.StockOptionsApi(client);
const underlying = "AAPL"; // string | Option underlying symbol, for example AAPL. This is one underlying symbol, not an option contract symbol.
const expirationDate = new Date("2026-08-14"); // string | Required option expiration date in YYYY-MM-DD format, obtained from the expiration date list.
const opts = {
  'optionType': "optionType_example" // 'call' | 'put' | 'all' | Option type filter for the option chain. - call: Call options only. - put: Put options only. - all: Both types, equivalent to omitting this parameter.
};
api.queryOptionChain(underlying, expirationDate, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
underlying string Option underlying symbol, for example AAPL. This is one underlying symbol, not an option contract symbol. [default to undefined]
expirationDate string Required option expiration date in YYYY-MM-DD format, obtained from the expiration date list. [default to undefined]
optionType OptionType Option type filter for the option chain. - call: Call options only. - put: Put options only. - all: Both types, equivalent to omitting this parameter. [optional] [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: StockOptionOptionChainResponse; }> StockOptionOptionChainResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

queryOptionOrderBook

Promise<{ response: http.IncomingMessage; body: StockOptionOrderBookResponse; }> queryOptionOrderBook(symbol)

Get the option order book

Query the best bid and ask for an option contract. `symbol` is the option contract symbol. Each of `bids` and `asks` contains at most one price level, without order quantities. A side without an available quote is an empty array. Both sides are empty arrays when the contract is not found.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"

const api = new GateApi.StockOptionsApi(client);
const symbol = "AAPL260814P00130000"; // string | Option contract symbol
api.queryOptionOrderBook(symbol)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
symbol string Option contract symbol [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: StockOptionOrderBookResponse; }> StockOptionOrderBookResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

queryOptionPositions

Promise<{ response: http.IncomingMessage; body: StockOptionPositionListResponse; }> queryOptionPositions(opts)

List current option positions

Query the current user&#39;s option positions, market values and profit and loss. Filter by `underlying` or `symbol`. A specified `symbol` must identify an existing option contract; no position returns an empty list. `price_type` selects the price for market value, unrealized PnL and today&#39;s PnL: `latest` (default) uses the last traded price; `mark` uses the mark price. Aggregate `today_pnl` includes current positions and contracts fully closed today. Results are sorted by `open_time` descending, then `symbol` ascending.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.StockOptionsApi(client);
const opts = {
  'underlying': "AAPL", // string | Option underlying symbol, for example AAPL. Omit to disable underlying filtering. Current orders support only one underlying.
  'symbol': "AAPL260814P00130000", // string | Full option contract symbol, for example AAPL260814P00130000. Omit to disable contract filtering.
  'priceType': new StockOptionPositionPnlPriceType() // StockOptionPositionPnlPriceType | Valuation price type for position market value, unrealized PnL, and daily PnL. Options: `latest` (last traded price) or `mark` (mark price). Defaults to `latest` when omitted or empty.
};
api.queryOptionPositions(opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
underlying string Option underlying symbol, for example AAPL. Omit to disable underlying filtering. Current orders support only one underlying. [optional] [default to undefined]
symbol string Full option contract symbol, for example AAPL260814P00130000. Omit to disable contract filtering. [optional] [default to undefined]
priceType StockOptionPositionPnlPriceType Valuation price type for position market value, unrealized PnL, and daily PnL. Options: `latest` (last traded price) or `mark` (mark price). Defaults to `latest` when omitted or empty. [optional] [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: StockOptionPositionListResponse; }> StockOptionPositionListResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

closeOptionPosition

Promise<{ response: http.IncomingMessage; body: StockOptionClosePositionResponse; }> closeOptionPosition(stockOptionClosePositionRequest)

Close an option position

Submit a closing order for part or all of an option position. `symbol` and `quantity` are required. The positive quantity must not exceed the available position and must satisfy the contract&#39;s minimum, maximum and quantity increment rules. Omit `order_type` or pass an empty value for a `market` order. A `limit` order requires a positive `price`; a market order ignores `price`. The closing side is derived from the position and time in force is fixed to `day`. The response returns the closing `order_id`; query the order for its subsequent status.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.StockOptionsApi(client);
const stockOptionClosePositionRequest = new StockOptionClosePositionRequest(); // StockOptionClosePositionRequest | 
api.closeOptionPosition(stockOptionClosePositionRequest)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
stockOptionClosePositionRequest StockOptionClosePositionRequest

Return type

Promise<{ response: AxiosResponse; body: StockOptionClosePositionResponse; }> StockOptionClosePositionResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

queryOptionOrderList

Promise<{ response: http.IncomingMessage; body: StockOptionOrderListResponse; }> queryOptionOrderList(opts)

List current option orders

Query the current user&#39;s unfinished option orders, including open and partially filled orders. Filter by `underlying`, `symbol` or `side`. `underlying` accepts only one symbol, not a comma-separated list. `status` includes only 1 (new) and 2 (partially filled). Query order history for terminal orders. Matching orders are sorted by creation time `time_setup` descending. This endpoint has no pagination parameters.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.StockOptionsApi(client);
const opts = {
  'underlying': "AAPL", // string | Option underlying symbol, for example AAPL. Omit to disable underlying filtering. Current orders support only one underlying.
  'symbol': "AAPL260814P00130000", // string | Full option contract symbol, for example AAPL260814P00130000. Omit to disable contract filtering.
  'side': new StockOptionOrderListSide() // StockOptionOrderListSide | Order side filter. Omit to query both sides. - 1: Sell orders only. - 2: Buy orders only.
};
api.queryOptionOrderList(opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
underlying string Option underlying symbol, for example AAPL. Omit to disable underlying filtering. Current orders support only one underlying. [optional] [default to undefined]
symbol string Full option contract symbol, for example AAPL260814P00130000. Omit to disable contract filtering. [optional] [default to undefined]
side StockOptionOrderListSide Order side filter. Omit to query both sides. - 1: Sell orders only. - 2: Buy orders only. [optional] [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: StockOptionOrderListResponse; }> StockOptionOrderListResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

createOptionOrder

Promise<{ response: http.IncomingMessage; body: StockOptionPutOrderResponse; }> createOptionOrder(stockOptionPutOrderRequest)

Create an option order

Submit a buy or sell order for an option contract and return the order ID on success. `symbol`, `side`, `order_type`, `time_in_force` and `quantity` are required. `side` is 1 (sell) or 2 (buy). Limit orders require a positive `price` and support `day` or `gtc`. Market orders ignore `price` and support only `day`. Quantity is a positive decimal string within the contract&#39;s minimum and maximum order quantities. Sell orders require sufficient available long positions. `client_order_id` is optional and is generated automatically when omitted or whitespace-only. Query current orders or order details to track the returned order ID.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.StockOptionsApi(client);
const stockOptionPutOrderRequest = new StockOptionPutOrderRequest(); // StockOptionPutOrderRequest | 
api.createOptionOrder(stockOptionPutOrderRequest)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
stockOptionPutOrderRequest StockOptionPutOrderRequest

Return type

Promise<{ response: AxiosResponse; body: StockOptionPutOrderResponse; }> StockOptionPutOrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

cancelAllOptionOrders

Promise<{ response: http.IncomingMessage; body: StockOptionCancelAllOrdersResponse; }> cancelAllOptionOrders(opts)

Cancel all option limit orders

Cancel all or a filtered set of the current user&#39;s option limit orders. The request body may be omitted or an empty object. Without filters, all limit orders are cancelled. Filter by `underlying`, `symbol` or `side`. `side` supports 1 (sell) and 2 (buy); omit it to include both sides. The response reports the cancellation request result. Query the orders to confirm their subsequent status.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.StockOptionsApi(client);
const opts = {
  'stockOptionCancelAllOrdersRequest': new StockOptionCancelAllOrdersRequest() // StockOptionCancelAllOrdersRequest | 
};
api.cancelAllOptionOrders(opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
stockOptionCancelAllOrdersRequest StockOptionCancelAllOrdersRequest [optional]

Return type

Promise<{ response: AxiosResponse; body: StockOptionCancelAllOrdersResponse; }> StockOptionCancelAllOrdersResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

queryOptionOrderDetail

Promise<{ response: http.IncomingMessage; body: StockOptionOrderDetailResponse; }> queryOptionOrderDetail(orderId)

Get option order details

Query one of the current user&#39;s orders by ID to track its status, filled quantity and average fill price. `order_id` is required and must be a positive integer represented as a string. Both current and finished orders can be queried, without filtering by terminal status. Returns price, quantity, filled quantity, status description, average fill price, fees and timestamps.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.StockOptionsApi(client);
const orderId = "8000000001"; // string | Option order ID as a positive integer string, obtained from order submission or query results.
api.queryOptionOrderDetail(orderId)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
orderId string Option order ID as a positive integer string, obtained from order submission or query results. [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: StockOptionOrderDetailResponse; }> StockOptionOrderDetailResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

updateOptionOrder

Promise<{ response: http.IncomingMessage; body: StockOptionUpdateOrderResponse; }> updateOptionOrder(orderId, stockOptionUpdateOrderRequest)

Amend an option limit order

Update the price and total quantity of one of the current user&#39;s option limit orders. The path `order_id` and body `price` and `quantity` are required. Market orders cannot be amended. `quantity` is the new total order quantity, not the remaining unfilled quantity, and must be at least `filled_quantity`. Amending a sell order also requires sufficient available positions for the new unfilled quantity. Returns the order ID; query the order for its subsequent status.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.StockOptionsApi(client);
const orderId = "72057594037983901"; // string | Option order ID as a positive integer string, obtained from order submission or query results.
const stockOptionUpdateOrderRequest = new StockOptionUpdateOrderRequest(); // StockOptionUpdateOrderRequest | 
api.updateOptionOrder(orderId, stockOptionUpdateOrderRequest)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
orderId string Option order ID as a positive integer string, obtained from order submission or query results. [default to undefined]
stockOptionUpdateOrderRequest StockOptionUpdateOrderRequest

Return type

Promise<{ response: AxiosResponse; body: StockOptionUpdateOrderResponse; }> StockOptionUpdateOrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

cancelOptionOrder

Promise<{ response: http.IncomingMessage; body: StockOptionCancelOrderResponse; }> cancelOptionOrder(orderId)

Cancel an option limit order

Cancel one of the current user&#39;s option limit orders by ID. `order_id` is required. Only limit orders can be cancelled; already filled quantities are unaffected. Returns the order ID. Query order details or order history for the final status.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.StockOptionsApi(client);
const orderId = "72057594037983901"; // string | Option order ID as a positive integer string, obtained from order submission or query results.
api.cancelOptionOrder(orderId)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
orderId string Option order ID as a positive integer string, obtained from order submission or query results. [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: StockOptionCancelOrderResponse; }> StockOptionCancelOrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

queryOptionOrderHistory

Promise<{ response: http.IncomingMessage; body: StockOptionOrderHistoryResponse; }> queryOptionOrderHistory(opts)

List historical option orders

Query the current user&#39;s finished option orders with pagination to check orders, fills and fees. `status` includes only 3 (filled), 4 (cancelled) and 5 (rejected). Filter by underlying, contract, side or order creation time. `begin_time` and `end_time` are Unix timestamps in seconds; when both are provided, the start must not be later than the end. Returns total records, total pages and the current page. The default and maximum `page_size` are both 100.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.StockOptionsApi(client);
const opts = {
  'underlying': "AAPL", // string | Option underlying symbol, for example AAPL. Omit to disable underlying filtering. Current orders support only one underlying.
  'symbol': "AAPL260814P00130000", // string | Full option contract symbol, for example AAPL260814P00130000. Omit to disable contract filtering.
  'beginTime': BigInt('56'), // number | Order creation time filter start, as a Unix timestamp in seconds. Omit for no lower bound; must not exceed end_time when both are provided.
  'endTime': BigInt('56'), // number | Order creation time filter end, as a Unix timestamp in seconds. Omit for no upper bound; must not precede begin_time when both are provided.
  'side': new StockOptionOrderListSide(), // StockOptionOrderListSide | Order side filter. Omit to query both sides. - 1: Sell orders only. - 2: Buy orders only.
  'page': 1, // number | Page number, starting from 1. Defaults to 1 when omitted.
  'pageSize': 100 // number | Number of items per page, up to 100. Defaults to 100 when omitted; values above 100 are capped at 100.
};
api.queryOptionOrderHistory(opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
underlying string Option underlying symbol, for example AAPL. Omit to disable underlying filtering. Current orders support only one underlying. [optional] [default to undefined]
symbol string Full option contract symbol, for example AAPL260814P00130000. Omit to disable contract filtering. [optional] [default to undefined]
beginTime number | bigint Order creation time filter start, as a Unix timestamp in seconds. Omit for no lower bound; must not exceed end_time when both are provided. [optional] [default to undefined]
endTime number | bigint Order creation time filter end, as a Unix timestamp in seconds. Omit for no upper bound; must not precede begin_time when both are provided. [optional] [default to undefined]
side StockOptionOrderListSide Order side filter. Omit to query both sides. - 1: Sell orders only. - 2: Buy orders only. [optional] [default to undefined]
page number Page number, starting from 1. Defaults to 1 when omitted. [optional] [default to 1]
pageSize number Number of items per page, up to 100. Defaults to 100 when omitted; values above 100 are capped at 100. [optional] [default to 100]

Return type

Promise<{ response: AxiosResponse; body: StockOptionOrderHistoryResponse; }> StockOptionOrderHistoryResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json