Binance Connector JS
    Preparing search index...
    Index
    • Returns the trading rules of a single option contract, combining contract-level data (type, strike, expiration, multiplier, deliverables) with underlying-level configuration (price / quantity increments and limits).

      symbol is required. Unlike the stock exchangeInfo, listing all contracts is not supported. To browse contracts, use Option Expirations and Option Contracts.

      Price constraints*: a limit price must be a multiple of tickSize, and the order notional (price × quantity × multiplier, excluding fees) must fall within the closed interval [minNotional, maxNotional]. For a put SELL order, the limit price cannot exceed the strike price. All of these values are returned by this endpoint, so you can validate an order before placing it.

      *multiplier vs contractSize**: multiplier is used to calculate cost, contractSize is the number of shares delivered. Both are 100 for standard contracts and may differ for contracts adjusted by a corporate action (split, merger, special dividend). Always estimate cost with multiplier.

      Only the X-MBX-APIKEY header is required; this endpoint is not signed and takes no timestamp / recvWindow.

      Weight: 1

      Security Type: MARKET_DATA

      Parameters

      Returns Promise<RestApiResponse<OptionExchangeInfoResponse>>

    • Returns every expiration date currently tradable for an underlying, in ascending expirationDate order.

      When standard and corporate-action-adjusted contracts share an expiration date, multiple rows are returned with the same expirationDate and different rootSymbol. To list the adjusted set, pass that rootSymbol to Option Contracts.

      Reference data only — no market data.

      An unknown underlying, or one without listed options, returns -1121 Invalid symbol. An empty array is never returned.

      Only the X-MBX-APIKEY header is required; this endpoint is not signed and takes no timestamp / recvWindow.

      Weight: 1

      Security Type: MARKET_DATA

      Parameters

      Returns Promise<RestApiResponse<OptionExpirationsResponse>>

    • Query a single option order with its fills and an itemized fee breakdown.

      Provide at least one of orderId and clientOrderId; omitting both returns -1102. If both are provided, the order is looked up by orderId, and clientOrderId must belong to the same order, otherwise 486218 Order not found is returned.

      Only option orders are accepted: the orderId / clientOrderId of a stock order returns -2013 Order does not exist.; an unknown order ID returns 486218 Order not found.

      Example: a fully filled buy-to-open order — filledTotal = total = 1.48 × 1 × 100 = 148 (excluding fees); total fees fee = 0.65 (commission + cat + orf + occ). sec / taf are 0 for buy orders. For an order still in progress with no fills, fee and the itemized fees are not returned (platformFee is always "0"); for an order canceled or expired without any fill, each fee item is "0". canceledAt / expiredAt are returned only in the corresponding status; settlementDate is not returned for buy orders.

      Weight: 1

      Security Type: USER_DATA

      Parameters

      Returns Promise<RestApiResponse<OptionOrderDetailResponse>>

    • Returns all current option positions.

      One record per contract; see side for the direction.

      free / locked are signed: negative for short positions.* For example, with 3 short contracts of which 1 is reserved by an open order, free = "-2" and locked = "-1". When closing (SELL_TO_CLOSE / BUY_TO_CLOSE), the quantity you can order is the absolute value of free.

      Positions past the last trading time and awaiting settlement are not returned.

      Weight: 1

      Security Type: USER_DATA

      Parameters

      Returns Promise<RestApiResponse<OptionPositionsResponse>>

    • Place an option limit order.

      The server calculates the amount to lock based on positionIntent and the contract type: buy to open locks the premium plus fees; sell to open locks the underlying shares for a covered call, or the strike-equivalent cash for a cash-secured put. Fees are calculated by the server; callers do not pass payment details.

      *positionIntent**: may be omitted, in which case it is derived from side: BUY → BUY_TO_OPEN, SELL → SELL_TO_CLOSE. The derivation is unreliable in two cases, and an order without positionIntent is rejected (parameter error): a BUY while you hold a short position in the contract (it may be meant as BUY_TO_CLOSE), and a SELL while you hold no long position in the contract (it can only be SELL_TO_OPEN). Therefore always pass it for the short side (SELL_TO_OPEN / BUY_TO_CLOSE). When passed, it must match side (BUY_* with BUY, SELL_* with SELL), otherwise the order is rejected.

      Only LIMIT orders with timeInForce = DAY are supported, and quantity must be a whole number of contracts.

      Resubmitting with the same clientOrderId is idempotent: if the original order was accepted or is still processing, the original order is returned (S / P); if the original order failed, 497401 is returned.

      If the request returns 497001, 497301 or a broker-rejection error code after the order has already been submitted to the broker, the order may still be processing. Retry with the same clientOrderId (a replay then returns P) or query Option Order Detail by clientOrderId for the final status. Do not retry with a new clientOrderId.

      Rate limit: 200 requests / min (UID).

      Weight: 1

      Security Type: TRADE

      Parameters

      Returns Promise<RestApiResponse<PlaceOptionOrderResponse>>

    • Generic function to send a request.

      Type Parameters

      • T

      Parameters

      • endpoint: string

        The API endpoint to call.

      • method: "GET" | "POST" | "DELETE" | "PUT" | "PATCH"

        HTTP method to use (GET, POST, DELETE, etc.).

      • queryParams: Record<string, unknown> = {}

        Query parameters for the request.

      • bodyParams: Record<string, unknown> = {}

        Body parameters for the request.

      Returns Promise<RestApiResponse<T>>

      A promise resolving to the response data object.

    • Generic function to send a signed request.

      Type Parameters

      • T

      Parameters

      • endpoint: string

        The API endpoint to call.

      • method: "GET" | "POST" | "DELETE" | "PUT" | "PATCH"

        HTTP method to use (GET, POST, DELETE, etc.).

      • queryParams: Record<string, unknown> = {}

        Query parameters for the request.

      • bodyParams: Record<string, unknown> = {}

        Body parameters for the request.

      Returns Promise<RestApiResponse<T>>

      A promise resolving to the response data object.

    • Submit an exercise request for a long option position.

      Requires the TRADE permission, because exercising changes positions and balances.

      Exercise is asynchronous.* The request returns PROCESSING; delivery is handled by the broker. Poll Option Exercise Detail for the final status.

      quantity cannot exceed availableQty from Exercisable Options.

      Resubmitting with the same clientOrderId is idempotent: if the original exercise was accepted or is still processing, it is returned with its current status; if it failed, 497401 is returned. If the request returns 497001, 497301 or a broker-rejection error code, the exercise may still be processing: retry with the same clientOrderId or query Option Exercise Detail by clientOrderId. Do not resubmit with a new clientOrderId.

      Weight: 1

      Security Type: TRADE

      Parameters

      Returns Promise<RestApiResponse<SubmitOptionExerciseResponse>>