{
"basePath": "/v1/api",
"definitions": {
"account": {
"description": "account information",
"properties": {
"accountAlias": {
"description": "User customizable account alias. Refer to [Configure Account Alias](https://guides.interactivebrokers.com/cp/cp.htm#am/settings/accountalias.htm) for details.",
"type": "string"
},
"accountId": {
"description": "The account number",
"example": "U12345678 for Individual Live Accounts, DU12345678 for Individual Paper Accounts",
"type": "string"
},
"accountStatus": {
"description": "When the account was opened in unix time.",
"type": "number"
},
"accountTitle": {
"description": "Title of the account",
"type": "string"
},
"accountVan": {
"description": "The accountAlias",
"type": "string"
},
"clearingStatus": {
"description": "Status of the Account\n * O = Open\n * P or N = Pending\n * A = Abandoned\n * R = Rejected\n * C = Closed\n",
"enum": [
"O",
"P",
"N",
"A",
"R",
"C"
],
"type": "string"
},
"covestor": {
"description": "Is a Covestor Account",
"type": "boolean"
},
"currency": {
"description": "Base currency of the account.",
"enum": [
"AUD",
"GBP",
"CAD",
"CNH",
"CZK",
"DKK",
"EUR",
"HKD",
"HUF",
"INR",
"ILS",
"JPY",
"MXN",
"NOK",
"NZD",
"PLN",
"RUB",
"SGD",
"SEK",
"CHF",
"USD"
],
"type": "string"
},
"desc": {
"description": "Formatted \"accountId - accountAlias\"",
"type": "string"
},
"displayName": {
"description": "Whichever value is not null in this priority",
"enum": [
"accountTitle",
"accountVan",
"accountId"
],
"type": "string"
},
"faclient": {
"description": "If an account is a sub-account to a Financial Advisor.",
"type": "boolean"
},
"id": {
"description": "The account identification value",
"type": "string"
},
"parent": {
"properties": {
"accountId": {
"description": "Account Number for Money Manager Client",
"type": "string"
},
"isMChild": {
"description": "Is MM a Child Account",
"type": "boolean"
},
"isMParent": {
"description": "Is MM a Parent Account",
"type": "boolean"
},
"isMultiplex": {
"description": "Is a Multiplex Account. These are account models with individual account being parent and managed account being child.",
"type": "boolean"
},
"mmc": {
"items": {
"description": "Money Manager Client (MMC) Account",
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"tradingType": {
"description": "UNI - Deprecated property",
"type": "string"
},
"type": {
"description": "Account Type",
"enum": [
"INDIVIDUAL",
"JOINT",
"ORG",
"TRUST",
"DEMO"
],
"type": "string"
}
},
"type": "object"
},
"accounts": {
"items": {
"$ref": "#/definitions/account"
},
"type": "array"
},
"alert-request": {
"properties": {
"alertMessage": {
"description": "The message you want to receive via email or text message",
"type": "string"
},
"alertName": {
"description": "name of alert",
"type": "string"
},
"alertRepeatable": {
"description": "whether alert is repeatable or not, so value can only be 0 or 1, this has to be 1 for MTA alert",
"type": "integer"
},
"conditions": {
"items": {
"properties": {
"conidex": {
"description": "conid and exchange. Format supports conid or conid@exchange",
"example": "8314@SMART",
"type": "string"
},
"logicBind": {
"description": "\"a\" means \"AND\", \"o\" means \"OR\", \"n\" means \"END\",\nthe last one condition in the condition array should \"n\"\n",
"type": "string"
},
"operator": {
"description": "optional, operator for the current condition, can be >= or <=",
"example": ">=",
"type": "string"
},
"timeZone": {
"description": "only needed for some MTA alert condition",
"type": "string"
},
"triggerMethod": {
"description": "optional, only some type of conditions have triggerMethod",
"example": "0",
"type": "string"
},
"type": {
"description": "Types: 1-Price, 3-Time, 4-Margin, 5-Trade, 6-Volume, 7: MTA market 8: MTA Position, 9: MTA Acc. Daily PN&\n",
"type": "integer"
},
"value": {
"description": "can not be empty, can pass default value \"*\"",
"example": "220",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"email": {
"description": "email address to receive alert",
"type": "string"
},
"expireTime": {
"description": "format, YYYYMMDD-HH:mm:ss, please NOTE this will only work when tif is GTD\n",
"example": "20201105-19:51:14",
"type": "string"
},
"iTWSOrdersOnly": {
"description": "value can only be 0 or 1, set to 1 to enable the alert only in IBKR mobile\n",
"type": "integer"
},
"orderId": {
"description": "orderId is required when modifying alert. You can get it from /iserver/account/:accountId/alerts\n",
"type": "integer"
},
"outsideRth": {
"description": "value can only be 0 or 1, set to 1 if the alert can be triggered outside regular trading hours.\n",
"type": "integer"
},
"playAudio": {
"description": "audio message to play when alert is triggered",
"type": "string"
},
"sendMessage": {
"description": "whether allowing to send email or not, so value can only be 0 or 1,\n",
"type": "integer"
},
"showPopup": {
"description": "value can only be 0 or 1, set to 1 to allow to show alert in pop-ups",
"type": "integer"
},
"tif": {
"description": "time in force, can only be GTC or GTD",
"type": "string"
},
"toolId": {
"description": "for MTA alert only, each user has a unique toolId and it will stay the same, do not send for normal alert\n",
"type": "integer"
}
},
"type": "object"
},
"alert-response": {
"properties": {
"account": {
"description": "account id",
"type": "string"
},
"alert_active": {
"description": "whether alert is active or not, so value can only be 0 or 1",
"type": "integer"
},
"alert_default_type": {
"description": "MTA alert only",
"type": "string"
},
"alert_email": {
"description": "email address to receive alert",
"type": "string"
},
"alert_message": {
"description": "The message you want to receive via email or text message",
"type": "string"
},
"alert_mta_currency": {
"description": "MTA alert only",
"type": "string"
},
"alert_mta_defaults": {
"description": "MTA alert only",
"type": "string"
},
"alert_name": {
"description": "name of alert",
"type": "string"
},
"alert_play_audio": {
"description": "audio message to play when alert is triggered",
"type": "string"
},
"alert_repeatable": {
"description": "whether alert is repeatable or not, so value can only be 0 or 1",
"type": "integer"
},
"alert_send_message": {
"description": "whether allowing to send email or not, so value can only be 0 or 1,\n",
"type": "integer"
},
"alert_show_popup": {
"description": "value can only be 0 or 1, set to 1 to allow to show alert in pop-ups",
"type": "integer"
},
"alert_triggered": {
"description": "whether the alert has been triggered",
"type": "boolean"
},
"condition_outside_rth": {
"description": "whether allowing the condition can be triggered outside of regular trading hours, 1 means allow",
"type": "integer"
},
"condition_size": {
"description": "size of conditions array",
"type": "integer"
},
"conditions": {
"items": {
"properties": {
"condition_logic_bind": {
"description": "Condition array should end with \"n\"\n * a - AND\n * o - OR\n * n - END\n",
"type": "string"
},
"condition_operator": {
"description": "optional, operator for the current condition\n * >= Greater than or equal to\n * <= Less than or equal to\n",
"example": "- >= - <=\n",
"type": "string"
},
"condition_time_zone": {
"description": "only needed for some MTA alert condition",
"type": "string"
},
"condition_trigger_method": {
"description": "optional, only some type of conditions have triggerMethod",
"example": "0",
"type": "string"
},
"condition_type": {
"description": "Types: 1-Price, 3-Time, 4-Margin, 5-Trade, 6-Volume, 7: MTA market 8: MTA Position, 9: MTA Acc. Daily PN&\n",
"type": "integer"
},
"condition_value": {
"description": "can not be empty, can pass default value \"*\"",
"example": "220",
"type": "string"
},
"conidex": {
"description": "conid and exchange. Format supports conid or conid@exchange",
"example": "8314@SMART",
"type": "string"
},
"contract_description_1": {
"description": "Format contract name",
"example": "FB Stock (NASDAQ.NMS)",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"expire_time": {
"description": "format, YYYYMMDD-HH:mm:ss\n",
"example": "20201105-19:51:14",
"type": "string"
},
"itws_orders_only": {
"description": "value can only be 0 or 1, set to 1 to enable the alert only in IBKR mobile\n",
"type": "integer"
},
"order_id": {
"type": "integer"
},
"order_not_editable": {
"description": "whether the alert can be edited",
"type": "boolean"
},
"order_status": {
"description": "status of alert",
"example": "Submitted",
"type": "string"
},
"outsideRth": {
"description": "value can only be 0 or 1, set to 1 if the alert can be triggered outside regular trading hours.\n",
"type": "integer"
},
"tif": {
"description": "time in force, can only be GTC or GTD",
"type": "string"
},
"time_zone": {
"description": "MTA alert only",
"type": "string"
},
"tool_id": {
"description": "for MTA alert only, each user has a unique toolId and it will stay the same, do not send for normal alert\n",
"type": "integer"
}
},
"type": "object"
},
"allocation": {
"items": {
"description": "allocation",
"properties": {
"assetClass": {
"description": "portfolio allocation by asset class",
"properties": {
"long": {
"description": "long positions allocation",
"properties": {
"BOND": {
"type": "number"
},
"CASH": {
"type": "number"
},
"FUT": {
"type": "number"
},
"OPT": {
"type": "number"
},
"STK": {
"type": "number"
},
"WAR": {
"type": "number"
}
},
"type": "object"
},
"short": {
"description": "short positions allocation",
"properties": {
"BOND": {
"type": "number"
},
"CASH": {
"type": "number"
},
"FUT": {
"type": "number"
},
"OPT": {
"type": "number"
},
"STK": {
"type": "number"
},
"WAR": {
"type": "number"
}
},
"type": "object"
}
},
"type": "object"
},
"group": {
"description": "portfolio allocation by group",
"properties": {
"long": {
"description": "long positions allocation",
"properties": {
"Apparel": {
"type": "number"
},
"Chemicals": {
"type": "number"
},
"Communications": {
"type": "number"
},
"Computers": {
"type": "number"
},
"Others": {
"type": "number"
},
"Semiconductors": {
"type": "number"
}
},
"type": "object"
},
"short": {
"description": "short positions allocation",
"properties": {
"Airlines": {
"type": "number"
},
"Banks": {
"type": "number"
},
"Internet": {
"type": "number"
}
},
"type": "object"
}
},
"type": "object"
},
"sector": {
"description": "portfolio allocation by sector",
"properties": {
"long": {
"description": "long positions allocation",
"properties": {
"Communications": {
"type": "number"
},
"Energy": {
"type": "number"
},
"Financial": {
"type": "number"
},
"Others": {
"type": "number"
},
"Technology": {
"type": "number"
},
"Utilities": {
"type": "number"
}
},
"type": "object"
},
"short": {
"description": "short positions allocation",
"properties": {
"Consumer": {
"type": "number"
},
"Diversified": {
"type": "number"
},
"Industrial": {
"type": "number"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
},
"type": "array"
},
"authStatus": {
"properties": {
"authenticated": {
"description": "Brokerage session is authenticated",
"type": "boolean"
},
"competing": {
"description": "Brokerage session is competing, e.g. user is logged in to IBKR Mobile, WebTrader, TWS or other trading platforms.",
"type": "boolean"
},
"connected": {
"description": "Connected to backend",
"type": "boolean"
},
"fail": {
"description": "Authentication failed, why.",
"type": "string"
},
"message": {
"description": "System messages that may affect trading",
"type": "string"
},
"prompts": {
"description": "Prompt messages that may affect trading or the account",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"calendar_request": {
"properties": {
"date": {
"properties": {
"end": {
"description": "end date of a period. for example 20180808-0400",
"type": "string"
},
"start": {
"description": "start date of a period. for example 20180808-0400",
"type": "string"
}
},
"type": "object"
},
"filters": {
"properties": {
"DivExDates": {
"description": "value can be 'true' or 'false'.",
"type": "string"
},
"corporate_earnings": {
"description": "value can be 'true' or 'false'.",
"type": "string"
},
"corporate_events": {
"description": "value can be 'true' or 'false'.",
"type": "string"
},
"country": {
"description": "default is 'All'.",
"type": "string"
},
"economic_events": {
"description": "value can be 'true' or 'false'.",
"type": "string"
},
"ipo": {
"description": "value can be 'true' or 'false'.",
"type": "string"
},
"limit": {
"description": "default is '250'.",
"type": "string"
},
"limit_region": {
"description": "default is '50'.",
"type": "string"
},
"option_show_monthly": {
"description": "value can be 'true' or 'false'.",
"type": "string"
},
"option_show_weekly": {
"description": "value can be 'true' or 'false'.",
"type": "string"
},
"recently_held": {
"description": "value can be 'true' or 'false'.",
"type": "string"
},
"splits": {
"description": "value can be 'true' or 'false'.",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"contract": {
"description": "Contains all details of the contract, including rules you can use when placing orders",
"properties": {
"category": {
"type": "string"
},
"company_name": {
"description": "Contracts company name",
"type": "string"
},
"con_id": {
"description": "same as that in request",
"type": "string"
},
"currency": {
"type": "string"
},
"exchange": {
"type": "string"
},
"industry": {
"type": "string"
},
"instrument_type": {
"description": "for example STK",
"type": "string"
},
"local_symbol": {
"description": "for exmple FB",
"type": "string"
},
"r_t_h": {
"description": "true means you can trade outside RTH(regular trading hours)",
"type": "boolean"
},
"rules": {
"properties": {
"defaultSize": {
"description": "default quantity you can use to place an order",
"type": "number"
},
"displaySize": {
"type": "string"
},
"increment": {
"type": "string"
},
"limitPrice": {
"description": "default limit price you can use to prefill your order",
"type": "number"
},
"orderTypes": {
"items": {
"description": "store available order types for this contract",
"type": "string"
},
"type": "array"
},
"orderTypesOutside": {
"items": {
"description": "store available order types for this contract outside regular hours",
"type": "string"
},
"type": "array"
},
"preview": {
"description": "if you can preview the order or not with the whatif endpoint",
"type": "boolean"
},
"sizeIncrement": {
"type": "number"
},
"stopprice": {
"description": "default stop price you can use to prefill your order",
"type": "number"
},
"tifTypes": {
"items": {
"description": "store available time-in-force types",
"type": "string"
},
"type": "array"
}
},
"type": "object"
}
},
"type": "object"
},
"events": {
"description": "events",
"items": {
"properties": {
"conids": {
"items": {
"description": "conid in string",
"type": "string"
},
"type": "array"
},
"data": {
"description": "will be different for different event types",
"type": "object"
},
"event_key": {
"description": "for example 11662135",
"type": "string"
},
"event_type": {
"type": "string"
},
"index_date": {
"description": "for exmple 20180817T040000+0000",
"type": "string"
},
"index_date_type": {
"type": "string"
},
"source": {
"description": "for example RSE",
"type": "string"
},
"status": {
"type": "string"
},
"tooltips": {
"type": "object"
}
},
"type": "object"
},
"type": "array"
},
"futures": {
"items": {
"description": "future contract information",
"properties": {
"conid": {
"description": "conid of the future contract",
"type": "integer"
},
"expirationDate": {
"type": "string"
},
"ltd": {
"description": "last trading day",
"type": "string"
},
"symbol": {
"type": "string"
},
"underlyingConid": {
"type": "integer"
}
},
"type": "object"
},
"type": "array"
},
"history-data": {
"properties": {
"barLength": {
"description": "The number of seconds in a bar",
"type": "integer"
},
"data": {
"items": {
"properties": {
"c": {
"description": "close price",
"type": "number"
},
"h": {
"description": "high price",
"type": "number"
},
"l": {
"description": "low price",
"type": "number"
},
"o": {
"description": "open price",
"type": "number"
},
"t": {
"description": "unix time stamp",
"type": "number"
},
"v": {
"description": "volume",
"type": "number"
}
},
"type": "object"
},
"type": "array"
},
"high": {
"description": "High value during this time series with format %h/%v/%t. %h is the high price (scaled by priceFactor), %v is volume\n(volume factor will always be 100 (reported volume = actual volume/100)) and %t is minutes from start time of the chart\n",
"type": "string"
},
"low": {
"description": "Low value during this time series with format %l/%v/%t. %l is the low price (scaled by priceFactor), %v is volume\n(volume factor will always be 100 (reported volume = actual volume/100)) and %t is minutes from start time of the chart\n",
"type": "string"
},
"mdAvailability": {
"description": "Market Data Availability. The field may contain two chars. The first char is the primary code: S = Streaming, R = Realtime, D = Delayed,\nZ = Frozen, Y = Frozen Delayed. The second char is the secondary code: P = Snapshot Available, p = Consolidated.\n",
"type": "string"
},
"messageVersion": {
"type": "integer"
},
"mktDataDelay": {
"description": "The time it takes, in milliseconds, to process the historical data request",
"type": "integer"
},
"negativeCapable": {
"type": "boolean"
},
"outsideRth": {
"description": "The historical data returned includes outside of regular trading hours\n",
"type": "boolean"
},
"points": {
"description": "total number of points",
"type": "integer"
},
"priceDisplayRule": {
"type": "integer"
},
"priceDisplayValue": {
"type": "string"
},
"priceFactor": {
"description": "priceFactor is price increment obtained from display rule",
"example": 100,
"type": "integer"
},
"startTime": {
"description": "start date time in the format YYYYMMDD-HH:mm:ss",
"type": "string"
},
"symbol": {
"description": "Underlying symbol",
"type": "string"
},
"text": {
"description": "companyName",
"type": "string"
},
"timePeriod": {
"description": "The duration for the historical data request",
"type": "string"
},
"tradingDayDuration": {
"description": "The number of seconds in the trading day",
"type": "integer"
},
"travelTime": {
"type": "integer"
},
"volumeFactor": {
"type": "integer"
}
},
"type": "object"
},
"history-result": {
"properties": {
"bars": {
"properties": {
"close": {
"type": "number"
},
"count": {
"type": "number"
},
"endTime": {
"type": "string"
},
"high": {
"type": "number"
},
"low": {
"type": "number"
},
"open": {
"type": "number"
},
"time": {
"type": "string"
},
"volume": {
"type": "number"
},
"weightedAvg": {
"type": "number"
}
},
"type": "object"
}
},
"type": "object"
},
"inds": {
"items": {
"properties": {
"conid": {
"type": "number"
}
},
"type": "object"
},
"type": "array"
},
"ledger": {
"properties": {
"acctcode": {
"type": "string"
},
"cashbalance": {
"type": "number"
},
"commoditymarketvalue": {
"type": "number"
},
"corporatebondsmarketvalue": {
"type": "number"
},
"currency": {
"type": "string"
},
"exchangerate": {
"type": "number"
},
"funds": {
"type": "number"
},
"futuremarketvalue": {
"type": "number"
},
"interest": {
"type": "number"
},
"issueroptionsmarketvalue": {
"type": "number"
},
"key": {
"type": "string"
},
"moneyfunds": {
"type": "number"
},
"netliquidationvalue": {
"type": "number"
},
"realizedpnl": {
"type": "number"
},
"sessionid": {
"type": "integer"
},
"settledcash": {
"type": "number"
},
"severity": {
"type": "integer"
},
"stockmarketvalue": {
"type": "number"
},
"timestamp": {
"type": "integer"
},
"unrealizedpnl": {
"type": "number"
},
"warrantsmarketvalue": {
"type": "number"
}
},
"type": "object"
},
"market-data": {
"properties": {
"Ask": {
"type": "number"
},
"AskSize": {
"type": "number"
},
"Bid": {
"type": "number"
},
"BidSize": {
"type": "number"
},
"Conid": {
"description": "IBKR Contract ID",
"type": "number"
},
"Exchange": {
"description": "Exchange",
"type": "string"
},
"Last": {
"type": "number"
},
"LastSize": {
"type": "number"
},
"minTick": {
"type": "number"
}
},
"type": "object"
},
"modify-order": {
"properties": {
"acctId": {
"type": "string"
},
"auxPrice": {
"type": "number"
},
"conid": {
"type": "integer"
},
"deactivated": {
"description": "Set to true if you want to pause a working order.\nFor details refer to the [TWS Users' Guide:](https://guides.interactivebrokers.com/tws/twsguide.html#usersguidebook/getstarted/pause_execution.htm)\n",
"type": "boolean"
},
"listingExchange": {
"description": "optional, not required",
"type": "string"
},
"orderType": {
"description": "for example LMT",
"type": "string"
},
"outsideRTH": {
"type": "boolean"
},
"price": {
"type": "number"
},
"quantity": {
"description": "usually integer, for some special cases can be float numbers",
"type": "number"
},
"side": {
"description": "SELL or BUY",
"type": "string"
},
"ticker": {
"description": "The ticker symbol of the original place order",
"type": "string"
},
"tif": {
"description": "Specify a time in force to change how long your order will continue to work in the market",
"example": "tif = DAY to tif = GTC",
"type": "string"
}
},
"type": "object"
},
"notifications": {
"items": {
"description": "notification",
"properties": {
"D": {
"description": "notification date",
"type": "string"
},
"FC": {
"description": "FYI code, we can use it to find whether the disclaimer is accepted or not in settings",
"type": "string"
},
"ID": {
"description": "unique way to reference this notification",
"type": "string"
},
"MD": {
"description": "content of notification",
"type": "string"
},
"MS": {
"description": "title of notification",
"type": "string"
},
"R": {
"description": "0-unread, 1-read",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"order": {
"description": "contains all the order related info",
"properties": {
"acct": {
"description": "account id",
"type": "string"
},
"bgColor": {
"description": "back-ground color",
"type": "string"
},
"companyName": {
"type": "string"
},
"conid": {
"type": "integer"
},
"description1": {
"type": "string"
},
"fgColor": {
"type": "string"
},
"filledQuantity": {
"type": "string"
},
"listingExchange": {
"description": "for example NASDAQ.NMS",
"type": "string"
},
"orderDesc": {
"type": "string"
},
"orderId": {
"type": "integer"
},
"order_ref": {
"description": "User defined string used to identify the order. Value is set using \"cOID\" field while placing an order.",
"type": "string"
},
"origOrderType": {
"description": "for example Limit",
"type": "string"
},
"parentId": {
"description": "Only exists in child order of bracket",
"type": "integer"
},
"price": {
"type": "number"
},
"remainingQuantity": {
"type": "string"
},
"secType": {
"description": "for example STK",
"type": "string"
},
"side": {
"description": "BUY or SELL",
"type": "string"
},
"status": {
"description": "* PendingSubmit - Indicates the order was sent, but confirmation has not been received that it has been received by the destination.\n Occurs most commonly if an exchange is closed.\n* PendingCancel - Indicates that a request has been sent to cancel an order but confirmation has not been received of its cancellation. * PreSubmitted - Indicates that a simulated order type has been accepted by the IBKR system and that this order has yet to be elected.\n The order is held in the IBKR system until the election criteria are met. At that time the order is transmitted to the order destination as specified.\n* Submitted - Indicates that the order has been accepted at the order destination and is working. * Cancelled - Indicates that the balance of the order has been confirmed cancelled by the IB system.\n This could occur unexpectedly when IB or the destination has rejected the order.\n* Filled - Indicates that the order has been completely filled. * Inactive - Indicates the order is not working, for instance if the order was invalid and triggered an error message,\n or if the order was to short a security and shares have not yet been located.\n",
"type": "string"
},
"ticker": {
"description": "for example FB",
"type": "string"
}
},
"type": "object"
},
"order-data": {
"properties": {
"account": {
"description": "Account number",
"type": "string"
},
"avgPrice": {
"description": "Average fill price",
"type": "string"
},
"clientOrderId": {
"type": "string"
},
"commCurr": {
"description": "Commission currency",
"type": "string"
},
"comms": {
"description": "Commissions",
"type": "string"
},
"conid": {
"description": "Contract identifier from IBKR's database.",
"type": "string"
},
"cumQty": {
"description": "Cumulative fill quantity",
"type": "string"
},
"currency": {
"description": "Trading currency",
"type": "string"
},
"exchange": {
"description": "Exchange or venue",
"type": "string"
},
"execId": {
"type": "string"
},
"execType": {
"enum": [
"-1 \"Invalid\"",
"0 \"New\"",
"1 \"Partially Filled\"",
"2 \"Filled\"",
"3 \"Done for the Day\"",
"4 \"Canceled\"",
"5 \"Replaced\"",
"6 \"Pending Cancel\"",
"7 \"Stopped\"",
"8 \"Rejected\"",
"9 \"Suspended\"",
"A \"Pending New\"",
"B \"Calculated\"",
"C \"Expired\"",
"D \"Restated\"",
"E \"Pending Replace\"",
"F \"Trade\"",
"G \"Trade Correct\"",
"H \"Trade Cancel\"",
"I \"Order Status\""
],
"type": "string"
},
"lastPrice": {
"description": "Price of the last partial fill",
"type": "string"
},
"lastShares": {
"description": "Quantity of the last partial fill",
"type": "string"
},
"leavesQty": {
"description": "Remaining quantity to be filled",
"type": "string"
},
"listingExchange": {
"description": "Listing Exchange",
"type": "string"
},
"orderId": {
"description": "Order identifier",
"type": "string"
},
"orderQty": {
"description": "Quantity of active order",
"type": "string"
},
"orderStatus": {
"enum": [
"-1 \"Invalid Order Status\"",
"0 \"New\"",
"1 \"Partially Filled\"",
"2 \"Filled\"",
"3 \"Done for the Day\"",
"4 \"Canceled\"",
"5 \"Replaced\"",
"6 \"Pending Cancel\"",
"7 \"Stopped\"",
"8 \"Rejected\"",
"9 \"Suspended\"",
"A \"Pending New\"",
"B \"Calculated\"",
"C \"Expired\"",
"D \"Restated\"",
"E \"Pending Replace\""
],
"type": "string"
},
"orderType": {
"enum": [
"1 \"Market\"",
"2 \"Limit\"",
"3 \"Stop\"",
"4 \"Stop Limit\"",
"5 \"Market on Close\"",
"6 \"With or Without\"",
"7 \"Limit or Better\"",
"8 \"Limit With or Without\"",
"9 \"On Basis\"",
"A \"On Close\"",
"B \"Limit On Close\"",
"C \"Forex Market\"",
"D \"Previously Quoted\"",
"E \"Previously Indicated\"",
"F \"Forex Limit\"",
"G \"Forex Swap\"",
"H \"Forex Previously Quoted\"",
"I \"Funari\"",
"K \"Market To Limit\"",
"P \"Pegged\""
],
"type": "string"
},
"price": {
"description": "Price of active order",
"type": "string"
},
"rcptTime": {
"description": "Time of receipt in GMT, format YYYYMMDD-hh:mm:ss",
"type": "string"
},
"realizedPnl": {
"description": "Realized PnL",
"type": "string"
},
"secType": {
"description": "Contracts asset class",
"enum": [
"CS \"Stock\"",
"CASH \"Forex\"",
"CFD \"Contract for Difference\"",
"FUT \"Future\"",
"OPT \"Option\""
],
"type": "string"
},
"side": {
"enum": [
"1 \"Buy\"",
"2 \"Sell\"",
"3 \"Buy Minus\"",
"4 \"Sell Plus\"",
"5 \"Sell Short\"",
"6 \"Sell Short Exempt\""
],
"type": "string"
},
"symbol": {
"description": "Underlying symbol for contract",
"type": "string"
},
"text": {
"description": "error message",
"type": "number"
},
"tif": {
"description": "Time in Force",
"enum": [
"0 \"Day\"",
"1 \"GTC\"",
"2 \"At the Opening\""
],
"type": "string"
},
"txTime": {
"description": "Time of transaction in GMT, format YYYYMMDD-hh:m:ss",
"type": "string"
},
"warnings": {
"properties": {
"PRICECAP": {
"type": "string"
},
"TIME": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"order-request": {
"properties": {
"acctId": {
"description": "acctId is optional. It should be one of the accounts returned by\n/iserver/accounts. If not passed, the first one in the list is selected.\n",
"type": "string"
},
"allocationMethod": {
"description": "Set the allocation method when placing an order using an FA account for a group\nPossible allocation methods are \"NetLiquidity\", \"AvailableEquity\", \"EqualQuantity\" and \"PctChange\".\n",
"type": "string"
},
"auxPrice": {
"description": "optional if order is STOP_LIMIT, this is the stop price. You must specify both price and auxPrice for STOP_LIMIT orders.\n"
},
"cOID": {
"description": "Customer Order ID. An arbitrary string that can be used to identify the order, e.g \"my-fb-order\". The\nvalue must be unique for a 24h span. Please do not set this value for child orders when placing a bracket order.\n",
"type": "string"
},
"conid": {
"description": "conid is the identifier of the security you want to trade, you can find the\nconid with /iserver/secdef/search.\n",
"type": "integer"
},
"fxQty": {
"description": "double number, this is the cash quantity field which can only be used for FX conversion order. When using 'fxQty' you don't need to specify 'quantity'.\n",
"type": "number"
},
"isCcyConv": {
"description": "set to true if the order is a FX conversion order\n",
"type": "boolean"
},
"isSingleGroup": {
"description": "set to true if you want to place a single group orders(OCA)\n",
"type": "boolean"
},
"listingExchange": {
"description": "listingExchange is optional. By default we use \"SMART\" routing. Possible values are available via this end\npoint: /v1/portal/iserver/contract/{conid}/info, see valid_exchange: e.g: SMART,AMEX,NYSE,\nCBOE,ISE,CHX,ARCA,ISLAND,DRCTEDGE,BEX,BATS,EDGEA,CSFBALGO,JE FFALGO,BYX,IEX,FOXRIVER,TPLUS1,NYSENAT,PSX\n",
"type": "string"
},
"orderType": {
"description": "The order-type determines what type of order you want to send.\nLMT - A limit order is an order to buy or sell at the specified price or better.\nMKT - A market order is an order to buy or sell at the markets current NBBO.\nSTP - A stop order becomes a market order once the specified stop price is attained or penetrated.\nSTOP_LIMIT - A stop limit order becomes a limit order once the specified stop price is attained or penetrated.\nMIDPRICE - A MidPrice order attempts to fill at the current midpoint of the NBBO or better.\n",
"type": "string"
},
"outsideRTH": {
"description": "set to true if the order can be executed outside regular trading hours.\n",
"type": "boolean"
},
"parentId": {
"description": "Only specify for child orders when placing bracket orders. The parentId for the child order(s) must be equal to the cOId (customer order id) of the parent.\n",
"type": "string"
},
"price": {
"description": "optional if order is LMT, or STOP_LIMIT, this is the limit price. For STP this is the stop price. For MIDPRICE this is the option price cap.\n",
"type": "number"
},
"quantity": {
"description": "usually integer, for some special cases can be float numbers",
"type": "number"
},
"referrer": {
"description": "Custom order reference\n",
"example": "QuickTrade",
"type": "string"
},
"secType": {
"description": "The contract-identifier (conid) and security type (type) specified as a concatenated value, conid:type",
"example": "secType = 265598:STK",
"type": "string"
},
"side": {
"description": "SELL or BUY",
"type": "string"
},
"strategy": {
"description": "Specify which IB Algo algorithm to use for this order.\n",
"type": "string"
},
"strategyParameters": {
"description": "The IB Algo parameters for the specified algorithm.\n",
"type": "object"
},
"ticker": {
"description": "This is the underlying symbol for the contract.\n",
"type": "string"
},
"tif": {
"description": "The Time-In-Force determines how long the order remains active on the market.\n * GTC - use Good-Till-Cancel for orders to remain active until it executes or cancelled.\n * OPG - use Open-Price-Guarantee for Limit-On-Open (LOO) or Market-On-Open (MOO) orders.\n * DAY - if not executed a Day order will automatically cancel at the end of the markets regular trading hours.\n * IOC - any portion of an Immediate-or-Cancel order that is not filled as soon as it becomes available in the market is cancelled.\n",
"type": "string"
},
"useAdaptive": {
"description": "If true, the system will use the Price Management Algo to submit the order.\nhttps://www.interactivebrokers.com/en/index.php?f=43423\n",
"type": "boolean"
}
},
"type": "object"
},
"order-status": {
"description": "contains all the details of an order",
"properties": {
"account": {
"description": "account id",
"type": "string"
},
"alert_active": {
"type": "integer"
},
"allowed_duplicate_opposite": {
"description": "Returns true if contract supports duplicate/opposite side order.",
"type": "boolean"
},
"available_chart_periods": {
"description": "List of available chart periods",
"type": "string"
},
"bg_color": {
"description": "Background color in hex format",
"type": "string"
},
"cannot_cancel_order": {
"description": "If true not allowed to cancel order",
"type": "boolean"
},
"child_order_type": {
"description": "type of the child order",
"example": "A=attached, B=beta-hedge, etc",
"type": "string"
},
"company_name": {
"description": "Contracts company name",
"example": "APPLE INC",
"type": "string"
},
"conidex": {
"description": "conid and exchange. Format supports conid or conid@exchange",
"type": "string"
},
"contract_description_1": {
"description": "Format contract name",
"example": "FB Stock (NASDAQ.NMS)",
"type": "string"
},
"cum_fill": {
"description": "Cumulative fill",
"type": "string"
},
"currency": {
"description": "Contract traded currency",
"type": "string"
},
"deactivate_order": {
"description": "If true order is de-activated",
"type": "boolean"
},
"editable_fields": {
"description": "Fields that can be edited in escaped unicode characters",
"example": "\\u001E",
"type": "string"
},
"exit_strategy_chart_description": {
"description": "Position description to display on chart",
"type": "string"
},
"exit_strategy_display_price": {
"description": "Position display price",
"type": "string"
},
"exit_strategy_tool_availability": {
"description": "* 1: If your account has position or order for contract * 0: If your account has no position or order for contract\n",
"enum": [
1,
0
],
"type": "string"
},
"fg_color": {
"description": "Foreground color in hex format",
"type": "string"
},
"limit_price": {
"description": "Limit price",
"type": "string"
},
"listing_exchange": {
"description": "Trading Exchange or Venue",
"example": "NASDAQ.NMS",
"type": "string"
},
"oca_group_id": {
"description": "only exists for oca orders, oca orders in same group will have same id",
"type": "string"
},
"option_acct": {
"type": "string"
},
"order_description": {
"description": "Format description of order",
"example": "BUY 100 LIMIT 125.0 DAY",
"type": "string"
},
"order_description_with_contract": {
"description": "order_description with the symbol",
"example": "BUY 100 AAPL LIMIT 125.0 DAY",
"type": "string"
},
"order_id": {
"description": "system generated order id, unique per account",
"type": "integer"
},
"order_not_editable": {
"description": "If true not allowed to modify order",
"type": "boolean"
},
"order_status": {
"description": "* PendingSubmit - Indicates the order was sent, but confirmation has not been received that it has been received by the destination.\n Occurs most commonly if an exchange is closed.\n* PendingCancel - Indicates that a request has been sent to cancel an order but confirmation has not been received of its cancellation. * PreSubmitted - Indicates that a simulated order type has been accepted by the IBKR system and that this order has yet to be elected.\n The order is held in the IBKR system until the election criteria are met. At that time the order is transmitted to the order destination as specified.\n* Submitted - Indicates that the order has been accepted at the order destination and is working. * Cancelled - Indicates that the balance of the order has been confirmed cancelled by the IB system.\n This could occur unexpectedly when IB or the destination has rejected the order.\n* Filled - Indicates that the order has been completely filled. * Inactive - Indicates the order is not working, for instance if the order was invalid and triggered an error message,\n or if the order was to short a security and shares have not yet been located.\n",
"type": "string"
},
"order_status_description": {
"description": "Description of the order status",
"type": "string"
},
"order_time": {
"description": "Time of status update in unix time",
"type": "string"
},
"order_type": {
"description": "Types of orders",
"example": "LIMIT",
"type": "string"
},
"outside_rth": {
"description": "If true order trades outside regular trading hours",
"type": "boolean"
},
"request_id": {
"description": "order request id",
"type": "string"
},
"sec_type": {
"description": "Asset class",
"example": "STK",
"type": "string"
},
"side": {
"description": "The side of the market of the order.\n * B - Buy contract near posted ask price\n * S - Sell contract near posted bid price\n * X - Option expired\n",
"enum": [
"B",
"S",
"X"
],
"type": "string"
},
"size": {
"description": "Quantity updated",
"type": "string"
},
"size_and_fills": {
"description": "Format fillQuantity\\totalQuantity",
"example": "0/9",
"type": "string"
},
"stop_price": {
"description": "Stop price",
"type": "string"
},
"sub_type": {
"description": "order sub-type",
"type": "string"
},
"symbol": {
"description": "Underlying symbol",
"type": "string"
},
"tif": {
"description": "Time-in-Force - length of time order will continue working before it is canceled.",
"type": "string"
},
"total_size": {
"description": "Total quantity",
"type": "string"
},
"use_price_mgmt_algo": {
"description": "If true price management algo is enabled, refer to https://www.interactivebrokers.com/en/index.php?f=43423",
"type": "boolean"
}
},
"type": "object"
},
"performance": {
"properties": {
"cps": {
"description": "Cumulative performance data",
"properties": {
"data": {
"items": {
"properties": {
"baseCurrency": {
"type": "string"
},
"end": {
"description": "end date-- yyyyMMdd",
"type": "string"
},
"id": {
"type": "string"
},
"idType": {
"description": "for example-- acctid",
"type": "string"
},
"returns": {
"description": "each value stands for price change percent of corresponding date in dates array",
"items": {
"type": "number"
},
"type": "array"
},
"start": {
"description": "start date-- yyyyMMdd",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"dates": {
"description": "array of dates, the length should be same as the length of returns inside data.",
"items": {
"description": "format-- yyyyMMdd",
"type": "string"
},
"type": "array"
},
"freq": {
"description": "D means Day",
"type": "string"
}
},
"type": "object"
},
"currencyType": {
"type": "string"
},
"id": {
"type": "string"
},
"included": {
"items": {
"description": "account id",
"type": "string"
},
"type": "array"
},
"nav": {
"description": "Net asset value data for the account or consolidated accounts. NAV data is not applicable to benchmarks.",
"properties": {
"data": {
"items": {
"properties": {
"baseCurrency": {
"type": "string"
},
"end": {
"description": "end date-- yyyyMMdd",
"type": "string"
},
"id": {
"type": "string"
},
"idType": {
"description": "for example-- acctid",
"type": "string"
},
"returns": {
"description": "each value stands for price change percent of corresponding date in dates array",
"items": {
"type": "number"
},
"type": "array"
},
"start": {
"description": "start date-- yyyyMMdd",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"dates": {
"description": "array of dates, the length should be same as the length of returns inside data.",
"items": {
"description": "format--yyyyMMdd",
"type": "string"
},
"type": "array"
},
"freq": {
"description": "D means Day",
"type": "string"
}
},
"type": "object"
},
"pm": {
"type": "string"
},
"rc": {
"type": "integer"
},
"tpps": {
"description": "Time period performance data",
"properties": {
"data": {
"items": {
"properties": {
"baseCurrency": {
"type": "string"
},
"end": {
"description": "end date-- yyyyMMdd",
"type": "string"
},
"id": {
"type": "string"
},
"idType": {
"description": "for example-- acctid",
"type": "string"
},
"returns": {
"description": "each value stands for price change percent of corresponding date in dates array",
"items": {
"type": "number"
},
"type": "array"
},
"start": {
"description": "start date-- yyyyMMdd",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"dates": {
"description": "array of dates, the length should be same as the length of returns inside data.",
"items": {
"description": "format-- yyyyMMdd",
"type": "string"
},
"type": "array"
},
"freq": {
"description": "M means Month",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"position": {
"items": {
"description": "Account Information",
"properties": {
"acctId": {
"type": "string"
},
"assetClass": {
"type": "string"
},
"avgCost": {
"type": "number"
},
"avgPrice": {
"type": "number"
},
"baseAvgCost": {
"type": "number"
},
"baseAvgPrice": {
"type": "number"
},
"baseMktPrice": {
"type": "number"
},
"baseMktValue": {
"type": "number"
},
"baseRealizedPnl": {
"type": "number"
},
"baseUnrealizedPnl": {
"type": "number"
},
"conExchMap": {
"items": {
"type": "string"
},
"type": "array"
},
"conid": {
"type": "integer"
},
"contractDesc": {
"type": "string"
},
"currency": {
"type": "string"
},
"exchs": {
"type": "string"
},
"exerciseStyle": {
"type": "string"
},
"expiry": {
"type": "string"
},
"fullName": {
"type": "string"
},
"group": {
"type": "string"
},
"lastTradingDay": {
"type": "string"
},
"mktPrice": {
"type": "number"
},
"mktValue": {
"type": "number"
},
"model": {
"type": "string"
},
"multiplier": {
"type": "number"
},
"name": {
"type": "string"
},
"pageSize": {
"type": "integer"
},
"position": {
"type": "number"
},
"putOrCall": {
"type": "string"
},
"realizedPnl": {
"type": "number"
},
"sector": {
"type": "string"
},
"sectorGroup": {
"type": "string"
},
"strike": {
"type": "number"
},
"ticker": {
"type": "string"
},
"undComp": {
"type": "string"
},
"undConid": {
"type": "integer"
},
"undSym": {
"type": "string"
},
"unrealizedPnl": {
"type": "number"
}
},
"type": "object"
},
"type": "array"
},
"position-data": {
"properties": {
"avgCost": {
"description": "Average cost of the position.",
"type": "number"
},
"conid": {
"description": "Contract identifier from IBKR's database.",
"type": "number"
},
"position": {
"description": "Number of shares or quantity of the position.",
"type": "number"
}
},
"type": "object"
},
"scanner-params": {
"properties": {
"FilterList": {
"description": "Contains list of filters supported for the scanner",
"items": {
"description": "Contains list of supported filters. The code of the filter along with user-specified value has to be sued to apply a filter to scanner query.",
"type": "object"
},
"type": "array"
},
"InstrumentList": {
"description": "Contains list of instruments for which scanner can be ran",
"properties": {
"Instrument": {
"description": "Contains information like name, supported filters, etc. for an instrument",
"items": {
"properties": {
"filters": {
"description": "Supported filters for the instrument separated by a comma",
"type": "string"
},
"name": {
"description": "Display name for the instrument",
"type": "string"
},
"secType": {
"description": "Sec Type of the instrument. This field is not provided if its value is same as 'type'",
"type": "string"
},
"shortName": {
"type": "string"
},
"type": {
"description": "Type of the asset",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"LocationTree": {
"description": "Contains list of instruments for which scanner can be ran",
"properties": {
"Location": {
"description": "Contains information like name, supported filters, etc. for an instrument. A location can contain more locations forming a tree-like structure which allows user to control the lcoation at more granular level. locationCode has to be used to specify lcoations while querying a scanner.",
"items": {
"properties": {
"displayName": {
"type": "string"
},
"instruments": {
"type": "string"
},
"locationCode": {
"type": "string"
},
"routeExchange": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"ScanTypeList": {
"description": "Contains list of scan types for which scanner can be ran",
"properties": {
"ScanType": {
"items": {
"properties": {
"displayName": {
"type": "string"
},
"instruments": {
"description": "Instrument types separated by a comma which are supported for this scan type",
"type": "string"
},
"scanCode": {
"description": "scan code which ahs to be provided while querying scanner with this scan type",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
},
"type": "object"
},
"scanner-result": {
"properties": {
"Contracts": {
"description": "Contains list of contracts matching the scanner query",
"properties": {
"Contract": {
"items": {
"properties": {
"contractID": {
"type": "integer"
},
"distance": {
"type": "integer"
},
"inScanTime": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"id": {
"type": "number"
},
"offset": {
"type": "integer"
},
"position": {
"type": "string"
},
"scanTime": {
"type": "string"
},
"size": {
"type": "integer"
},
"total": {
"type": "integer"
}
},
"type": "object"
},
"secdef": {
"items": {
"description": "security definition information.",
"properties": {
"allExchanges": {
"description": "List of exchanges and venues contract trades.",
"type": "string"
},
"assetClass": {
"description": "Group of financial instruments which have similar financial characteristics and behave similar in the marketplace.",
"type": "string"
},
"chineseName": {
"description": "HTML encoded company description in Chinese.",
"type": "string"
},
"conid": {
"description": "IBKR contract identifier.",
"type": "integer"
},
"crossCurrency": {
"description": "Defines if a derivative contract has a different currency.",
"type": "boolean"
},
"currency": {
"description": "Currency contract trades in.",
"type": "string"
},
"expiry": {
"description": "Specific data contract expires.",
"type": "string"
},
"fullName": {
"description": "Formatted company name with underlying symbol, expiration, strike, right.",
"type": "string"
},
"group": {
"description": "Potential characteristic of each product.",
"type": "string"
},
"hasOptions": {
"description": "If contract has an option.",
"type": "boolean"
},
"incrementRules": {
"description": "Price increment value contract trades.",
"properties": {
"increment": {
"description": "The minimum increment value for contract price.",
"type": "number"
},
"lowerEdge": {
"description": "The minimum contract price on the market that supports the specified increment.",
"type": "number"
}
},
"type": "object"
},
"isUS": {
"description": "If contract is a US contract. Currently supported for stocks, options and warrants.",
"type": "boolean"
},
"lastTradingDay": {
"description": "Final day derivative contract can be traded before delivery of the underlying asset or cash settlement.",
"type": "string"
},
"listingExchange": {
"description": "Main trading venue.",
"type": "string"
},
"multiplier": {
"description": "Multiplier for total premium paid or received for derivative contract.",
"type": "integer"
},
"name": {
"description": "Company Name.",
"type": "string"
},
"putOrCall": {
"description": "Defines the right to buy or sell of the underlying security.",
"type": "string"
},
"sector": {
"description": "The category of the economy.",
"type": "string"
},
"sectorGroup": {
"description": "Stock Group contract belongs too.",
"type": "string"
},
"strike": {
"description": "Set price at which a derivative contract can be bought or sold.",
"type": "number"
},
"ticker": {
"description": "Contract symbol.",
"type": "string"
},
"time": {
"type": "integer"
},
"type": {
"description": "Stock type.",
"type": "string"
},
"undComp": {
"description": "Company name for underlying contract.",
"type": "string"
},
"undConid": {
"description": "Underlying contract identifier.",
"type": "integer"
},
"undSym": {
"description": "IBKR Symbol for underlying contract.",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"secdef-info": {
"description": "Contains some basic info of contract",
"properties": {
"conid": {
"type": "number"
},
"coupon": {
"description": "Annual interest rate paid on a bond",
"type": "string"
},
"currency": {
"description": "Currency the contract trades in",
"type": "string"
},
"cusip": {
"description": "Committee on Uniform Securities Identification Procedures number",
"type": "string"
},
"desc1": {
"description": "Formatted symbol",
"type": "string"
},
"desc2": {
"description": "Formatted expiration, strike and right",
"type": "string"
},
"exchange": {
"type": "string"
},
"listingExchange": {
"type": "string"
},
"maturityDate": {
"description": "Format YYYYMMDD, the date on which the underlying transaction settles if the option is exercised",
"type": "string"
},
"multiplier": {
"description": "total premium paid or received for an option contract",
"type": "string"
},
"right": {
"description": "C = Call Option, P = Put Option",
"type": "string"
},
"secType": {
"type": "string"
},
"strike": {
"description": "The strike price also known as exercise price",
"type": "string"
},
"symbol": {
"description": "Underlying symbol",
"type": "string"
},
"tradingClass": {
"type": "string"
},
"validExchanges": {
"type": "string"
}
},
"type": "object"
},
"set-account": {
"properties": {
"acctId": {
"description": "Account ID",
"type": "string"
}
},
"type": "object"
},
"stats-data": {
"properties": {
"Conid": {
"type": "number"
},
"Exchange": {
"type": "string"
},
"P": {
"description": "Object, payload depends on event type. See confluence page for IGEvntUpd.",
"type": "string"
},
"T": {
"type": "number"
},
"TT": {
"type": "number"
},
"V": {
"type": "number"
}
},
"type": "object"
},
"stocks": {
"description": "This is an array of object(s), there could be multiple results under same symbol\n",
"items": {
"description": "future contract information",
"properties": {
"assetClass": {
"example": "STK",
"type": "string"
},
"chineseName": {
"description": "company name in Chinese",
"type": "string"
},
"contracts": {
"description": "array of contracts from different exchanges",
"items": {
"properties": {
"conid": {
"description": "conid of the stock contract",
"type": "integer"
},
"exchange": {
"example": "NYSE",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"name": {
"description": "company name",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"summary": {
"description": "account information",
"properties": {
"accountSummaries": {
"items": {
"properties": {
"accountTypeCode": {
"type": "string"
},
"accountTypeName": {
"type": "string"
},
"chg": {
"type": "string"
},
"endVal": {
"type": "string"
},
"hasAccounts": {
"type": "boolean"
},
"rtn": {
"type": "string"
},
"startVal": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"balanceByDate": {
"properties": {
"series": {
"items": {
"properties": {
"date": {
"items": {
"items": {
"type": "number"
},
"type": "array"
},
"type": "array"
},
"groupId": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"currency": {
"type": "string"
},
"endDate": {
"type": "string"
},
"excludedAccounts": {
"items": {
"properties": {
"acctId": {
"type": "string"
},
"acctNumAtFI": {
"type": "string"
},
"acctTitle": {
"type": "string"
},
"fiName": {
"type": "string"
},
"harvestCode": {
"type": "integer"
},
"lastUpdate": {
"type": "string"
},
"lastUpdateAttempt": {
"type": "string"
},
"lastUpdateStatusCode": {
"type": "string"
},
"rc": {
"type": "integer"
}
},
"type": "object"
},
"type": "array"
},
"hasExternalAccounts": {
"description": "indicator of user having configured any external accounts",
"type": "boolean"
},
"lastSuccessfulUpdate": {
"type": "string"
},
"pm": {
"type": "string"
},
"rc": {
"type": "integer"
},
"startDate": {
"description": "date format-- yyyy-MM-dd",
"type": "string"
},
"total": {
"properties": {
"chg": {
"description": "total change amount",
"type": "string"
},
"endVal": {
"type": "string"
},
"incompleteData": {
"description": "set to true if any external account data is not available for starting or ending date, resulting in potentially unusual total values.",
"type": "boolean"
},
"rtn": {
"description": "change percent",
"type": "string"
},
"startVal": {
"type": "string"
}
},
"type": "object"
},
"userId": {
"type": "string"
},
"view": {
"type": "string"
}
},
"type": "object"
},
"system-error": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
},
"trade": {
"properties": {
"account": {
"description": "accountCode",
"type": "string"
},
"acountCode": {
"description": "Account Number",
"type": "string"
},
"clearing_id": {
"description": "Firm which will settle the trade. For IBExecution customers only.",
"type": "string"
},
"clearing_name": {
"description": "Specifies the true beneficiary of the order. For IBExecution customers only.",
"type": "string"
},
"commission": {
"description": "Commission of the order",
"type": "number"
},
"company_name": {
"description": "Contracts company name",
"type": "string"
},
"conid": {
"description": "IBKR's contract identifier",
"type": "string"
},
"conidex": {
"description": "conid and exchange. Format supports conid or conid@exchange",
"type": "string"
},
"contract_description_1": {
"description": "Format contract name",
"example": "FB Stock (NASDAQ.NMS)",
"type": "string"
},
"exchange": {
"description": "Exchange or venue of order",
"type": "string"
},
"execution_id": {
"description": "execution identifier for the order",
"type": "string"
},
"liquidation_trade": {
"description": "If order adds liquidity to the market.",
"type": "number"
},
"net_amount": {
"description": "Net cost of the order, including contract multiplier and quantity.",
"type": "number"
},
"order_description": {
"description": "Formatted description of the order \"%side% %size% @ %price% on %exchange%\".",
"type": "string"
},
"order_ref": {
"description": "User defined string used to identify the order. Value is set using \"cOID\" field while placing an order.",
"type": "string"
},
"position": {
"description": "Total quantity owned for this contract",
"type": "string"
},
"price": {
"description": "Average Price",
"type": "string"
},
"sec_type": {
"description": "Asset class",
"example": "STK, FUT, OPT",
"type": "string"
},
"side": {
"description": "The side of the market of the order.\n * B - Buy contract near posted ask price\n * S - Sell contract near posted bid price\n * X - Option expired\n",
"enum": [
"B",
"S",
"X"
],
"type": "string"
},
"size": {
"description": "Quantity of the order",
"type": "string"
},
"submitter": {
"description": "User that submitted order",
"type": "string"
},
"symbol": {
"description": "Underlying Symbol",
"type": "string"
},
"trade_time": {
"description": "Time of Status update in format \"YYYYMMDD-hh:mm:ss\".",
"type": "string"
},
"trade_time_r": {
"description": "Time of status update in format unix time.",
"type": "number"
}
},
"type": "object"
},
"transactions": {
"description": "account transactions",
"properties": {
"currency": {
"description": "same as request",
"type": "string"
},
"from": {
"description": "Period start date. Epoch time, GMT",
"type": "number"
},
"id": {
"description": "will always be getTransactions",
"type": "string"
},
"includesRealTime": {
"description": "Indicates whether current day and realtime data is included in the result",
"type": "boolean"
},
"to": {
"description": "Period end date. Epoch time, GMT",
"type": "number"
},
"transactions": {
"description": "Sorted by date descending",
"items": {
"properties": {
"acctid": {
"type": "string"
},
"amt": {
"description": "Raw value, no formatting. Transaction amount. For trades does not include commission.\nIn asset currency",
"type": "number"
},
"conid": {
"type": "number"
},
"cur": {
"description": "currency code",
"type": "string"
},
"date": {
"description": "Date of transaction. Epoch time, GMT",
"type": "string"
},
"desc": {
"description": "Transaction description",
"type": "string"
},
"fxRate": {
"description": "Conversion rate from asset currency to response currency",
"type": "number"
},
"pr": {
"description": "In asset currency. Not be applicable for all transaction types.",
"type": "number"
},
"qty": {
"description": "Not applicable for all transaction types",
"type": "number"
},
"type": {
"description": "Transaction Type Name: Examples: \"Sell\", \"Buy\", \"Corporate Action\",\n\"Dividend Payment\", \"Transfer\", \"Payment in Lieu\"\nDividends and Transfers do not have price and quantity in response\n",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"wagers": {
"items": {
"description": "List of wagers",
"properties": {
"conid": {
"type": "number"
},
"curr": {
"type": "string"
},
"desc": {
"type": "string"
},
"part": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"host": "localhost:5000",
"info": {
"description": "Client Poral Web API",
"title": "Client Portal Web API",
"version": "1.0.0"
},
"name": "swagger",
"paths": {
"/ccp/account": {
"get": {
"description": "Provides the list of tradeable accounts",
"responses": {
"200": {
"description": "An array of accounts",
"schema": {
"properties": {
"acctList": {
"description": "List of tradeable or Sub Accounts",
"items": {
"properties": {
"0": {
"description": "For multi-account structures each trading account will numbered from 0 to ...",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"mainAcct": {
"description": "The primary or parent account.",
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Brokerage Accounts",
"tags": [
"CCP (Beta)"
]
}
},
"/ccp/auth/init": {
"post": {
"consumes": [
"application/x-www-form-urlencoded"
],
"description": "Initiate a brokerage session to CCP. Only one brokerage session type can run at a time. If an existing brokerage session to iServer is running then call the endpoint /logout first. Note at this time only order management is possible from CCP session, market data and scanner endpoints can't be used since they are only available from iServer session. Work is in progress to provide new CCP endpoints for market data and scanners.",
"parameters": [
{
"description": "Allow competing CCP session to run",
"in": "formData",
"name": "compete",
"type": "boolean"
},
{
"description": "Concatenate value for language and region, set to \"en_US\"",
"in": "formData",
"name": "locale",
"type": "string"
},
{
"description": "Local MAC Address",
"in": "formData",
"name": "mac",
"type": "string"
},
{
"description": "Local machine ID",
"in": "formData",
"name": "machineId",
"type": "string"
},
{
"description": "Login user, set to dash \"-\"",
"in": "formData",
"name": "username",
"type": "string"
}
],
"responses": {
"200": {
"description": "Returns challenge for connection",
"schema": {
"properties": {
"challenge": {
"description": "Challenge in hex format"
}
},
"type": "object"
}
},
"401": {
"description": "Access denied"
},
"500": {
"description": "System error"
}
},
"summary": "Start CCP Session",
"tags": [
"CCP (Beta)"
]
}
},
"/ccp/auth/response": {
"post": {
"description": "Session Token Authentication",
"parameters": [
{
"in": "body",
"name": "auth",
"schema": {
"properties": {
"response": {
"type": "string"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "Valid result",
"schema": {
"properties": {
"authenticated": {
"description": "If connection is authenticated",
"type": "boolean"
},
"competing": {
"description": "If user already has an existing brokerage session running.",
"type": "boolean"
},
"connected": {
"description": "Connected to CCP session",
"type": "boolean"
},
"passed": {
"description": "If sso authentication completed",
"type": "boolean"
}
},
"type": "object"
}
},
"401": {
"description": "Access denied"
},
"500": {
"description": "System error"
}
},
"summary": "Complete CCP Session",
"tags": [
"CCP (Beta)"
]
}
},
"/ccp/order": {
"delete": {
"consumes": [
"application/json"
],
"description": "Sends an Order cancellation request. The status of the order can be queried through /ccp/order. Passing arguments as GET is also supported (requires passing action=delete) (GET is meant for development only)\n",
"parameters": [
{
"description": "Account Number",
"in": "query",
"name": "acct",
"required": true,
"type": "string"
},
{
"description": "Order Identifier of original submit order",
"in": "query",
"name": "id",
"required": true,
"type": "number"
}
],
"responses": {
"200": {
"description": "An Object",
"schema": {
"$ref": "#/definitions/order-data"
}
},
"401": {
"description": "Access denied"
},
"500": {
"description": "System error, for example when connection to CCP failed"
}
},
"summary": "Delete Order",
"tags": [
"CCP (Beta)"
]
},
"post": {
"consumes": [
"application/json"
],
"description": "Submits an Order.\n",
"parameters": [
{
"description": "User Account",
"in": "query",
"name": "acct",
"required": true,
"type": "string"
},
{
"description": "Contract identifier from IBKR's database.",
"in": "query",
"name": "conid",
"required": true,
"type": "number"
},
{
"description": "Contract Currency",
"enum": [
"USD",
"GBP",
"EUR"
],
"in": "query",
"name": "ccy",
"required": true,
"type": "string"
},
{
"description": "Exchange",
"enum": [
"NYSE",
"CBOE",
"NYMEX"
],
"in": "query",
"name": "exchange",
"required": true,
"type": "string"
},
{
"description": "Order Quantity",
"in": "query",
"name": "qty",
"required": true,
"type": "number"
},
{
"description": "Order Price; required if order type is limit",
"enum": [
"limit",
"market"
],
"in": "query",
"name": "type",
"required": false,
"type": "string"
},
{
"description": "Side",
"enum": [
"sell",
"buy"
],
"in": "query",
"name": "side",
"required": false,
"type": "string"
},
{
"description": "Order Price; required if order type is limit",
"in": "query",
"name": "price",
"required": false,
"type": "number"
},
{
"description": "Time in Force",
"enum": [
"IOC",
"GTC"
],
"in": "query",
"name": "tif",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "An Object",
"schema": {
"$ref": "#/definitions/order-data"
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Access denied"
},
"500": {
"description": "System error, for example when connection to CCP failed"
}
},
"summary": "Submit Order",
"tags": [
"CCP (Beta)"
]
},
"put": {
"consumes": [
"application/json"
],
"description": "Updates an Order. Updating an order requires the same arguments as placing an order besides the conid. Note: The status of the order can be queried through GET /ccp/order.\n",
"parameters": [
{
"description": "User Account",
"in": "query",
"name": "acct",
"required": true,
"type": "string"
},
{
"description": "Order ID to be modified",
"in": "query",
"name": "id",
"required": true,
"type": "number"
}
],
"responses": {
"200": {
"description": "An Object",
"schema": {
"$ref": "#/definitions/order-data"
}
},
"401": {
"description": "Access denied"
},
"500": {
"description": "System error, for example when connection to CCP failed"
}
},
"summary": "Update Order",
"tags": [
"CCP (Beta)"
]
}
},
"/ccp/orders": {
"get": {
"description": "Get status for all orders",
"parameters": [
{
"description": "User Account",
"in": "query",
"name": "acct",
"required": true,
"type": "string"
},
{
"description": "Return only Rejected or Cancelled orders since today midnight",
"in": "query",
"name": "cancelled",
"required": false,
"type": "boolean"
}
],
"responses": {
"200": {
"description": "An Object",
"schema": {
"properties": {
"orders": {
"items": {
"$ref": "#/definitions/order-data"
},
"type": "array"
}
},
"type": "object"
}
},
"400": {
"description": "Bad request"
},
"401": {
"description": "Access denied"
},
"500": {
"description": "System error"
}
},
"summary": "Order Status",
"tags": [
"CCP (Beta)"
]
}
},
"/ccp/positions": {
"get": {
"description": "List of positions",
"responses": {
"200": {
"description": "Valid result",
"schema": {
"$ref": "#/definitions/position-data"
}
},
"401": {
"description": "Access denied"
},
"500": {
"description": "System error"
}
},
"summary": "Positions",
"tags": [
"CCP (Beta)"
]
}
},
"/ccp/status": {
"get": {
"description": "Provide the current CCP session status. When using the Gateway this endpoint will also initiate a brokerage session to CCP by sending /auth/init and response.",
"responses": {
"200": {
"description": "Valid result",
"schema": {
"properties": {
"authenticated": {
"description": "Login session is authenticated to the CCP.",
"type": "boolean"
},
"connected": {
"description": "Login session is connected",
"type": "boolean"
},
"name": {
"description": "server name",
"type": "string"
}
},
"type": "object"
}
},
"401": {
"description": "Access denied"
},
"500": {
"description": "System error"
}
},
"summary": "CCP Status",
"tags": [
"CCP (Beta)"
]
}
},
"/ccp/trades": {
"get": {
"description": "Get a list of Trades, by default, the list is from today midnight to Date.now().\n",
"parameters": [
{
"description": "From Date (YYYYMMDD-HH:mm:ss) or offset (-1,-2,-3..)",
"in": "query",
"name": "from",
"required": false,
"type": "string"
},
{
"description": "To Date (YYYYMMDD-HH:mm:ss) or offset (-1,-2,-3..). To value should be bigger than from value.\n",
"in": "query",
"name": "to",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "An Object",
"schema": {
"properties": {
"orders": {
"items": {
"$ref": "#/definitions/order-data"
},
"type": "array"
}
},
"type": "object"
}
},
"400": {
"description": "Bad request"
},
"401": {
"description": "Access denied"
},
"500": {
"description": "System error"
}
},
"summary": "Trades",
"tags": [
"CCP (Beta)"
]
}
},
"/fyi/deliveryoptions": {
"get": {
"description": "options for sending fyis to email and other devices\n",
"responses": {
"200": {
"description": "An object",
"schema": {
"properties": {
"E": {
"items": {
"description": "device",
"properties": {
"A": {
"description": "device is enabled or not 0-true, 1-false.",
"type": "string"
},
"I": {
"description": "device id",
"type": "string"
},
"NM": {
"description": "device name",
"type": "string"
},
"UI": {
"description": "unique device id",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"M": {
"description": "Email option is enabled or not 0-off, 1-on.",
"type": "integer"
}
},
"type": "object"
}
}
},
"summary": "Get delivery options",
"tags": [
"FYI"
]
}
},
"/fyi/deliveryoptions/device": {
"post": {
"parameters": [
{
"description": "device info",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"deviceId": {
"type": "string"
},
"devicename": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"uiName": {
"type": "string"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "200 means successful",
"schema": {
"properties": {
"T": {
"type": "integer"
},
"V": {
"type": "integer"
}
},
"type": "object"
}
}
},
"summary": "Enable/Disable device option",
"tags": [
"FYI"
]
}
},
"/fyi/deliveryoptions/email": {
"put": {
"parameters": [
{
"description": "true/false",
"in": "query",
"name": "enabled",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "200 means successful",
"schema": {
"properties": {
"T": {
"type": "integer"
},
"V": {
"type": "integer"
}
},
"type": "object"
}
}
},
"summary": "Enable/Disable email option",
"tags": [
"FYI"
]
}
},
"/fyi/deliveryoptions/{deviceId}": {
"delete": {
"parameters": [
{
"description": "device ID",
"in": "path",
"name": "deviceId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "200 means successful",
"schema": {
"type": "object"
}
}
},
"summary": "Delete a device",
"tags": [
"FYI"
]
}
},
"/fyi/disclaimer/{typecode}": {
"get": {
"parameters": [
{
"description": "fyi code, for example --M8, EA",
"in": "path",
"name": "typecode",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "receives the disclaimer message",
"schema": {
"properties": {
"DT": {
"description": "disclaimer message",
"type": "string"
},
"FC": {
"description": "fyi code",
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Get disclaimer for a certain kind of fyi",
"tags": [
"FYI"
]
},
"put": {
"parameters": [
{
"description": "fyi code, for example --M8, EA",
"in": "path",
"name": "typecode",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "200 means successful",
"schema": {
"properties": {
"T": {
"type": "integer"
},
"V": {
"type": "integer"
}
},
"type": "object"
}
}
},
"summary": "Mark disclaimer read",
"tags": [
"FYI"
]
}
},
"/fyi/notifications": {
"get": {
"parameters": [
{
"description": "if set, don't set include",
"in": "query",
"name": "exclude",
"type": "string"
},
{
"description": "if set, don't set exclude",
"in": "query",
"name": "include",
"type": "string"
},
{
"description": "max number of fyis in response",
"in": "query",
"name": "max",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "An array",
"schema": {
"$ref": "#/definitions/notifications"
}
}
},
"summary": "Get a list of notifications",
"tags": [
"FYI"
]
}
},
"/fyi/notifications/more": {
"get": {
"parameters": [
{
"description": "id of last notification in the list",
"in": "query",
"name": "id",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "An array",
"schema": {
"$ref": "#/definitions/notifications"
}
}
},
"summary": "Get more notifications based on a certain one",
"tags": [
"FYI"
]
}
},
"/fyi/notifications/{notificationId}": {
"put": {
"parameters": [
{
"description": "mark a notification read",
"in": "path",
"name": "notificationId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "when 200 receives, it means successful",
"schema": {
"type": "object"
}
}
},
"summary": "Get a list of notifications",
"tags": [
"FYI"
]
}
},
"/fyi/settings": {
"get": {
"description": "Return the current choices of subscriptions, we can toggle the option\n",
"responses": {
"200": {
"description": "An array",
"schema": {
"items": {
"properties": {
"A": {
"description": "optional, if A doesn't exist, it means user can't toggle this option. 0-off, 1-on.",
"type": "integer"
},
"FC": {
"description": "fyi code",
"type": "string"
},
"FD": {
"description": "detailed description",
"type": "string"
},
"FN": {
"description": "title",
"type": "string"
},
"H": {
"description": "disclaimer read, 1 = yes, = 0 no.",
"type": "integer"
}
},
"type": "object"
},
"type": "array"
}
}
},
"summary": "Get a list of subscriptions",
"tags": [
"FYI"
]
}
},
"/fyi/settings/{typecode}": {
"post": {
"description": "Configure which typecode you would like to enable/disable.\n",
"parameters": [
{
"description": "fyi code",
"in": "path",
"name": "typecode",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"enabled": {
"type": "boolean"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "200 means successful",
"schema": {
"type": "object"
}
}
},
"summary": "Enable/Disable certain subscription",
"tags": [
"FYI"
]
}
},
"/fyi/unreadnumber": {
"get": {
"description": "Returns the total number of unread fyis\n",
"responses": {
"200": {
"description": "An object",
"schema": {
"properties": {
"BN": {
"description": "unread number",
"type": "integer"
}
},
"type": "object"
}
}
},
"summary": "Get unread number of fyis. The HTTP method POST is also supported.",
"tags": [
"FYI"
]
}
},
"/ibcust/entity/info": {
"get": {
"description": "Returns Applicant Id with all owner related entities",
"responses": {
"200": {
"description": "Search result",
"schema": {
"items": {
"properties": {
"applicantId": {
"type": "number"
},
"entities": {
"items": {
"properties": {
"address": {
"properties": {
"city": {
"type": "string"
},
"compact": {
"type": "string"
},
"country": {
"type": "string"
},
"countryCode": {
"type": "string"
},
"postalCode": {
"type": "string"
},
"state": {
"type": "string"
},
"street": {
"type": "string"
},
"street2": {
"type": "string"
}
},
"type": "object"
},
"canSign": {
"type": "boolean"
},
"canTrade": {
"type": "boolean"
},
"identDocs": {
"items": {
"items": {
"properties": {
"country": {
"type": "string"
},
"state": {
"type": "string"
},
"type": {
"type": "string"
},
"value": {
"type": "string"
}
},
"type": "object"
},
"type": "object"
},
"type": "array"
},
"name": {
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"salutation": {
"type": "string"
}
},
"type": "object"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
}
}
},
"summary": "IBCust Entity Info",
"tags": [
"IBCust"
]
}
},
"/iserver/account": {
"post": {
"description": "If an user has multiple accounts, and user wants to get orders, trades, etc. of an account other than currently selected account, then user can update the currently selected account using this API and then can fetch required information for the newly updated account.",
"parameters": [
{
"description": "account id",
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/set-account"
}
}
],
"responses": {
"200": {
"description": "an object containing updated account ID",
"schema": {
"properties": {
"acctId": {
"type": "string"
},
"set": {
"type": "boolean"
}
},
"type": "object"
}
}
},
"summary": "Switch Account",
"tags": [
"Account"
]
}
},
"/iserver/account/:accountId/alert/:alertId": {
"delete": {
"description": "Please be careful, if alertId is 0, it will delete all alerts",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
},
{
"description": "alert id",
"in": "path",
"name": "alertId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an object",
"schema": {
"properties": {
"failure_list": {
"type": "string"
},
"order_id": {
"type": "integer"
},
"order_status": {
"type": "string"
},
"request_id": {
"type": "integer"
},
"success": {
"type": "boolean"
},
"text": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Delete an alert",
"tags": [
"Alert"
]
}
},
"/iserver/account/:accountId/alert/activate": {
"post": {
"description": "Please note, if alertId is 0, it will activate/deactivate all alerts",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
},
{
"description": "order request info",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"alertActive": {
"description": "1 to activate, 0 to deactivate",
"type": "integer"
},
"alertId": {
"description": "alert id(order id)",
"type": "integer"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "returns an object",
"schema": {
"properties": {
"failure_list": {
"type": "string"
},
"order_id": {
"type": "integer"
},
"order_status": {
"type": "string"
},
"request_id": {
"type": "integer"
},
"success": {
"type": "boolean"
},
"text": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Activate or deactivate an alert",
"tags": [
"Alert"
]
}
},
"/iserver/account/:accountId/alerts": {
"get": {
"description": "The response will contain both active and inactive alerts, but it won't have MTA alert",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an array of objects",
"schema": {
"items": {
"properties": {
"account": {
"description": "account id",
"type": "string"
},
"alert_active": {
"description": "Value can only be 0 or 1, 1 means active",
"type": "integer"
},
"alert_name": {
"type": "string"
},
"alert_repeatable": {
"description": "whether the alert can be repeatable or not, value can be 1 or 0. 1 means true",
"type": "integer"
},
"alert_triggered": {
"description": "whether the alert has been triggered or not",
"type": "boolean"
},
"order_id": {
"type": "integer"
},
"order_time": {
"description": "format, YYYYMMDD-HH:mm:ss, the time when you created the alert\n",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
}
},
"summary": "Get a list of available alerts",
"tags": [
"Alert"
]
}
},
"/iserver/account/alert/:id": {
"get": {
"description": "Use the endpoint /iserver/account/:accountId/alerts to receive the alert id.\nThe order_id in the response is the alert id.\n",
"parameters": [
{
"description": "alert id",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an object",
"schema": {
"$ref": "#/definitions/alert-response"
}
}
},
"summary": "Get details of an alert",
"tags": [
"Alert"
]
}
},
"/iserver/account/mta": {
"get": {
"description": "Each login user only has one mobile trading assistant (MTA) alert with it's own unique tool id.\nThe tool id cannot be changed. When modified a new order Id is generated. MTA alerts can not\nbe created or deleted. If you call delete /iserver/account/:accountId/alert/:alertId,\nit will reset MTA to default. See [here](https://www.interactivebrokers.com/en/software/mobileiphonemobile/mobileiphone.htm#monitor/trading-assistant.htm) for more information on MTA alerts.\n",
"responses": {
"200": {
"description": "returns an object",
"schema": {
"$ref": "#/definitions/alert-response"
}
}
},
"summary": "Get MTA alert",
"tags": [
"Alert"
]
}
},
"/iserver/account/order/status/{orderId}": {
"get": {
"parameters": [
{
"description": "Customer order id, use /iservers/account/orders endpoint to query orderId.",
"in": "path",
"name": "orderId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an object",
"schema": {
"$ref": "#/definitions/order-status"
}
}
},
"summary": "Order Status",
"tags": [
"Order"
]
}
},
"/iserver/account/orders": {
"get": {
"description": "The endpoint is meant to be used in polling mode, e.g. requesting every x seconds.\nThe response will contain two objects, one is notification, the other is orders.\nOrders is the list of live orders (cancelled, filled, submitted).\nNotifications contains information about execute orders as they happen, see status field.\nTo receive streaming live orders the endpoint /ws can be used. Refer to [Streaming WebSocket Data](https://interactivebrokers.github.io/cpwebapi/RealtimeSubscription.html) for details.\n",
"parameters": [
{
"description": "an array of filters",
"in": "body",
"name": "body",
"schema": {
"properties": {
"filters": {
"items": {
"description": "Only return list of orders for filter value. More than one filter can be specified comma separated.\n * inactive: Order was received by the system but is no longer active because it was rejected or cancelled.\n * pending_submit: Order has been transmitted but have not received confirmation yet that order accepted by destination exchange or venue.\n * pre_submitted: Simulated order transmitted but the order has yet to be elected. Order is held by IB system until election criteria are met.\n * submitted: Order has been accepted by the system.\n * filled: Order has been completely filled.\n * pending_cancel: Sent an order cancellation request but have not yet received confirmation order cancelled by destination exchange or venue.\n * cancelled: The balance of your order has been confirmed canceled by the system.\n * warn_state: Order has a specific warning message such as for basket orders.\n * sort_by_time: There is an initial sort by order state performed so active orders are always above inactive and filled then orders are sorted chronologically.\n",
"enum": [
"inactive",
"pending_submit",
"pre_submitted",
"submitted",
"filled",
"pending_cancel",
"cancelled",
"warn_state",
"sort_by_time"
],
"type": "string"
},
"type": "array"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "An object contains two arrays",
"schema": {
"properties": {
"orders": {
"items": {
"properties": {
"acct": {
"description": "Account number",
"type": "string"
},
"bgColor": {
"description": "Background color in hex format",
"type": "string"
},
"cashCcy": {
"description": "Cash currency",
"type": "string"
},
"companyName": {
"description": "Company Name",
"type": "string"
},
"conid": {
"description": "Contract identifier",
"type": "number"
},
"conidex": {
"description": "conid and exchange. Format supports conid or conid@exchange",
"type": "string"
},
"description1": {
"description": "Formatted ticker description",
"type": "string"
},
"fgColor": {
"description": "Foreground color in hex format",
"type": "string"
},
"filledQuantity": {
"description": "Quantity filled",
"type": "number"
},
"lastExecutionTime": {
"description": "Last status update in format YYMMDDhhmms based in GMT",
"type": "number"
},
"lastExecutionTime_r": {
"description": "Last status update unix time in ms",
"type": "number"
},
"listingExchange": {
"description": "Listing Exchange",
"type": "string"
},
"orderDesc": {
"description": "Order description",
"type": "string"
},
"orderId": {
"description": "Order identifier",
"type": "string"
},
"orderType": {
"description": "Order type",
"type": "string"
},
"order_ref": {
"description": "Order reference",
"type": "string"
},
"origOrderType": {
"description": "Original order type",
"type": "string"
},
"price": {
"description": "Price of order",
"type": "number"
},
"remainingQuantity": {
"description": "Quantity remaining",
"type": "number"
},
"secType": {
"description": "Asset class",
"type": "string"
},
"side": {
"description": "The side of the market of the order.\n * BUY: Buy contract near posted ask price\n * SELL: Sell contract near posted bid price\n * ASSN: Option Assignment, if BUYSELL=BUY and OptionType=PUT or BUYSELL=SELL and OptionType=CALL\n * EXER: Option Exercise, if BUYSELL=SELL and OptionType=PUT or BUYSELL=BUY and OptionType=CALL\n",
"enum": [
"BUY",
"SELL",
"ASSN",
"EXER"
],
"type": "string"
},
"sizeAndFills": {
"description": "Quantity outstanding and total quantity concatenated with forward slash separator",
"type": "number"
},
"status": {
"description": "Status of the order",
"type": "string"
},
"supportsTaxOpt": {
"description": "Supports Tax Optimization with 0 for no and 1 for yes",
"type": "number"
},
"ticker": {
"description": "Underlying symbol",
"type": "string"
},
"timeInForce": {
"description": "Time in force",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"snapshot": {
"description": "If live order update is a snapshot",
"type": "boolean"
}
},
"type": "object"
}
}
},
"summary": "Live Orders",
"tags": [
"Order"
]
}
},
"/iserver/account/orders/{faGroup}": {
"post": {
"description": "Financial Advisors can use this endpoint to place an order for a specified group. To place an order for a specified account use the endpoint /iserver/account/{accountId}/order.\nMore information about groups can be found in the [TWS Users' Guide:](https://guides.interactivebrokers.com/twsguide/twsguide.htm#usersguidebook/financialadvisors/create_an_account_group_for_share_allocation.htm).\n",
"parameters": [
{
"description": "financial advisor group",
"in": "path",
"name": "faGroup",
"required": true,
"type": "string"
},
{
"description": "order request info",
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/order-request"
}
}
],
"responses": {
"200": {
"description": "returns an array",
"schema": {
"items": {
"properties": {
"id": {
"type": "string"
},
"message": {
"description": "Please note here, if the message is a question, you have to reply to question in order to submit\nthe order successfully. See more in the \"/iserver/reply/{replyid}\" endpoint.\n",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
}
}
},
"summary": "Place Orders for FA",
"tags": [
"Order"
]
}
},
"/iserver/account/pnl/partitioned": {
"get": {
"description": "Returns an object containing PnL for the selected account and its models (if any).\nTo receive streaming PnL the endpoint /ws can be used. Refer to [Streaming WebSocket Data](https://interactivebrokers.github.io/cpwebapi/RealtimeSubscription.html) for details.\n",
"responses": {
"200": {
"description": "An object containing account and model(s) pnl",
"schema": {
"properties": {
"acctId": {
"type": "object"
}
},
"type": "object"
}
}
},
"summary": "PnL for the selected account",
"tags": [
"PnL",
"Account"
]
}
},
"/iserver/account/trades": {
"get": {
"description": "Returns a list of trades for the currently selected account for current day and six previous days. It is advised to call this endpoint once per session.\n",
"responses": {
"200": {
"description": "An array of trades",
"schema": {
"items": {
"$ref": "#/definitions/trade"
},
"type": "array"
}
}
},
"summary": "List of Trades for the selected account",
"tags": [
"Trades"
]
}
},
"/iserver/account/{accountId}/alert": {
"post": {
"description": "Please note here, DO NOT pass orderId when creating a new alert, toolId is only required for MTA alert\n",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
},
{
"description": "alert info",
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/alert-request"
}
}
],
"responses": {
"200": {
"description": "returns an object",
"schema": {
"properties": {
"order_id": {
"type": "integer"
},
"order_status": {
"type": "string"
},
"request_id": {
"type": "integer"
},
"success": {
"type": "boolean"
},
"text": {
"type": "string"
},
"warning_message": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Create or modify alert",
"tags": [
"Alert"
]
}
},
"/iserver/account/{accountId}/order": {
"post": {
"deprecated": true,
"description": "This end-point is going to be deprecated, you can use /iserver/account/{accountId}/orders, just pass one order\nin the array, the order structure will be same.\nPlease note here, sometimes this endpoint alone can't make sure you submit the order successfully,\nyou could receive some questions in the response, you have to to answer them in order to submit the order\nsuccessfully. You can use \"/iserver/reply/{replyid}\" endpoint to answer questions\n",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
},
{
"description": "order request info",
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/order-request"
}
}
],
"responses": {
"200": {
"description": "returns an array",
"schema": {
"items": {
"properties": {
"id": {
"type": "string"
},
"message": {
"description": "Please note here, if the message is a question, you have to reply to question in order to submit\nthe order successfully. See more in the \"/iserver/reply/{replyid}\" endpoint.\n",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
}
}
},
"summary": "Place Order (Deprecated)",
"tags": [
"Order"
]
}
},
"/iserver/account/{accountId}/order/whatif": {
"post": {
"deprecated": true,
"description": "This end-point is going to be deprecated, you can use /iserver/account/{accountId}/orders/whatif,\njust pass one order in the array, the order structure will be same.\nThis endpoint allows you to preview order without actually submitting the order and you can get\ncommission information in the response.\n",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
},
{
"description": "order info",
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/order-request"
}
}
],
"responses": {
"200": {
"description": "returns an object",
"schema": {
"properties": {
"amount": {
"properties": {
"amount": {
"description": "for example 23,000 USD",
"type": "string"
},
"commission": {
"description": "for example 1.1 ... 1.2 USD",
"type": "string"
},
"total": {
"type": "string"
}
},
"type": "object"
},
"equity": {
"properties": {
"after": {
"type": "string"
},
"change": {
"type": "string"
},
"current": {
"type": "string"
}
},
"type": "object"
},
"error": {
"type": "string"
},
"initial": {
"properties": {
"after": {
"type": "string"
},
"change": {
"type": "string"
},
"current": {
"type": "string"
}
},
"type": "object"
},
"maintenance": {
"properties": {
"after": {
"type": "string"
},
"change": {
"type": "string"
},
"current": {
"type": "string"
}
},
"type": "object"
},
"warn": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Preview Order (Deprecated)",
"tags": [
"Order"
]
}
},
"/iserver/account/{accountId}/order/{orderId}": {
"delete": {
"description": "Cancels an open order. Must call /iserver/accounts endpoint prior to cancelling an order. Use /iservers/account/orders endpoint to review open-order(s) and get latest order status.",
"parameters": [
{
"description": "account id, or fa group if deleting a group order",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
},
{
"description": "Customer order id, use /iservers/account/orders endpoint to query orderId.",
"in": "path",
"name": "orderId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an object with order id, message, conid and account id",
"schema": {
"properties": {
"account": {
"type": "string"
},
"conid": {
"type": "integer"
},
"msg": {
"type": "string"
},
"order_id": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Cancel Order",
"tags": [
"Order"
]
},
"post": {
"description": "Modifies an open order. Must call /iserver/accounts endpoint prior to modifying an order. Use /iservers/account/orders endpoint to review open-order(s).",
"parameters": [
{
"description": "account id, or fa group if modifying a group order",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
},
{
"description": "Customer order id, use /iservers/account/orders endpoint to query orderId.",
"in": "path",
"name": "orderId",
"required": true,
"type": "string"
},
{
"description": "modify-order request",
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/modify-order"
}
}
],
"responses": {
"200": {
"description": "returns an array",
"schema": {
"items": {
"properties": {
"local_order_id": {
"type": "string"
},
"order_id": {
"type": "string"
},
"order_status": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
}
},
"summary": "Modify Order",
"tags": [
"Order"
]
}
},
"/iserver/account/{accountId}/orders": {
"post": {
"description": "You can pass a list of orders here such as bracket and OCA orders.\nNotes for OCA(one cancel all orders) orders: 1. if one order in the group is filled/cancelled, all the\nothers in the same group will be cancelled. 2. To create OCA orders, please set isSingleGroup to true in\neach order 3. All orders in the same group will have same oca_group_id, you can get oca_group_id\nfrom /iserver/account/order/status/{orderId} end-point after orders are placed successfully\n",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
},
{
"description": "order request info",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"orders": {
"description": "Notes for bracket orders: 1. Children orders will not have its own \"cOID\", so please donot pass \"cOID\"\nparameter in child order.Instead, they will have a \"parentId\" which must be equal to \"cOID\" of parent.\n2. When you cancel a parent order, it will cancel all bracket orders, when you cancel one child order,\nit will also cancel its sibling order.\n",
"items": {
"$ref": "#/definitions/order-request"
},
"type": "array"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "returns an array",
"schema": {
"items": {
"properties": {
"id": {
"type": "string"
},
"message": {
"description": "Please note here, if the message is a question, you have to reply to question in order to submit\nthe order successfully. See more in the \"/iserver/reply/{replyid}\" endpoint.\n",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
}
}
},
"summary": "Place Orders",
"tags": [
"Order"
]
}
},
"/iserver/account/{accountId}/orders/whatif": {
"post": {
"description": "This endpoint allows you to preview order without actually submitting the order and you can get\ncommission information in the response. Also supports bracket orders.\n",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
},
{
"description": "order info",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"orders": {
"description": "Notes for bracket orders: 1. Children orders will not have its own \"cOID\", so please donot pass \"cOID\"\nparameter in child order.Instead, they will have a \"parentId\" which must be equal to \"cOID\" of parent.\n2. When you cancel a parent order, it will cancel all bracket orders, when you cancel one child order,\nit will also cancel its sibling order.\n",
"items": {
"$ref": "#/definitions/order-request"
},
"type": "array"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "returns an object",
"schema": {
"properties": {
"amount": {
"properties": {
"amount": {
"description": "for example 23,000 USD",
"type": "string"
},
"commission": {
"description": "for example 1.1 ... 1.2 USD",
"type": "string"
},
"total": {
"type": "string"
}
},
"type": "object"
},
"equity": {
"properties": {
"after": {
"type": "string"
},
"change": {
"type": "string"
},
"current": {
"type": "string"
}
},
"type": "object"
},
"error": {
"type": "string"
},
"initial": {
"properties": {
"after": {
"type": "string"
},
"change": {
"type": "string"
},
"current": {
"type": "string"
}
},
"type": "object"
},
"maintenance": {
"properties": {
"after": {
"type": "string"
},
"change": {
"type": "string"
},
"current": {
"type": "string"
}
},
"type": "object"
},
"warn": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Preview Orders",
"tags": [
"Order"
]
}
},
"/iserver/accounts": {
"get": {
"description": "Returns a list of accounts the user has trading access to, their respective aliases and the currently selected account. Note this endpoint must be called before modifying an order or querying open orders.",
"responses": {
"200": {
"description": "An array of accounts",
"schema": {
"properties": {
"accounts": {
"description": "Unique account id",
"items": {
"type": "string"
},
"type": "array"
},
"aliases": {
"description": "Account Id and its alias",
"type": "object"
},
"selectedAccount": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Brokerage Accounts",
"tags": [
"Account"
]
}
},
"/iserver/auth/status": {
"post": {
"description": "Current Authentication status to the Brokerage system. Market Data and Trading is not possible if not authenticated, e.g. authenticated shows false",
"responses": {
"200": {
"description": "Authentication Status",
"schema": {
"$ref": "#/definitions/authStatus"
}
}
},
"summary": "Authentication Status",
"tags": [
"Session"
]
}
},
"/iserver/contract/{conid}/algos": {
"get": {
"description": "Returns supported IB Algos for contract. Must be called a second time to query the list of available parameters.",
"parameters": [
{
"description": "IBKR contract identifier",
"in": "path",
"name": "conid",
"required": true,
"type": "string"
},
{
"description": "List of algo ids delimited by \";\" to filter by. Max of 8 algos ids can be specified.",
"in": "query",
"name": "algos",
"required": false,
"type": "string"
},
{
"description": "Whether or not to add algo descriptions to response. Set to 1 for yes, 0 for no.",
"in": "query",
"name": "addDescription",
"required": false,
"type": "string"
},
{
"description": "Whether or not to show algo parameters. Set to 1 for yes, 0 for no.",
"in": "query",
"name": "addParams",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an array of algos",
"schema": {
"items": {
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"parameters": {
"items": {
"properties": {
"defaultValue": {
"description": "User configured preset for this parameter.",
"type": "boolean"
},
"description": {
"description": "Detailed description of the parameter.",
"type": "string"
},
"enabledConditions": {
"description": "The rules that UI should apply to algo parameters depending on chosen order type:\n * MKT:speedUp:=:no - hide SpeedUp param when MKT is chosen for order type.\n * LMT:strategyType:<>:empty - strategyType param cannot be empty when LMT is chosen for order type.\n * MKT:strategyType:=:Marketable - set strategyType param to Marketable and disable (no other choice) when MKT is chosen for order type.\n",
"enum": [
"MKT:speedUp:=:no",
"LMT:strategyType:<>:empty",
"MKT:strategyType:=:Marketable"
],
"type": "string"
},
"guiRank": {
"description": "The order in UI, used when building dynamic UI so that more important parameters are presented first.",
"type": "number"
},
"id": {
"description": "The algo parameter",
"type": "string"
},
"legalStrings": {
"description": "The list of choices",
"example": [
"ALL:Get Done",
"ALL:Aggressive",
"ALL:Neutral",
"ALL:Passive"
],
"type": "string"
},
"maxValue": {
"description": "Largest value, only applies to parameters with valueClassName=Double.",
"type": "number"
},
"minValue": {
"description": "Smallest value, only applies to parameters with valueClassName=Double.",
"type": "number"
},
"name": {
"description": "Descriptive name of the parameter.",
"type": "string"
},
"priceMarketRule": {
"description": "If true, must specify parameter using market rule format. Only applies to parameters with valueClassName=Double.",
"type": "boolean"
},
"required": {
"description": "If true a value must be entered.",
"type": "boolean"
},
"valueClassName": {
"description": "Format of the parameter.",
"enum": [
"double",
"string",
"time",
"boolean"
],
"type": "string"
}
},
"required": [
"id",
"valueClassName"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
}
}
},
"summary": "IB Algo Params",
"tags": [
"Contract"
]
}
},
"/iserver/contract/{conid}/info": {
"get": {
"description": "Using the Contract Identifier get contract info. You can use this to prefill your order before you submit an order",
"parameters": [
{
"description": "contract id",
"in": "path",
"name": "conid",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an object",
"schema": {
"$ref": "#/definitions/contract"
}
}
},
"summary": "Contract Details",
"tags": [
"Contract"
]
}
},
"/iserver/contract/{conid}/info-and-rules": {
"get": {
"description": "Returns trading related rules and info for contract",
"parameters": [
{
"description": "IBKR contract identifier",
"in": "path",
"name": "conid",
"required": true,
"type": "string"
},
{
"description": "Side of the market rules apply too. Set to true for Buy Orders, set to false for Sell Orders",
"in": "query",
"name": "isBuy",
"required": true,
"type": "boolean"
}
],
"responses": {
"200": {
"description": "returns an array",
"schema": {
"properties": {
"allow_sell_long": {
"description": "Allowed to sell shares that you own",
"type": "boolean"
},
"cfi_code": {
"description": "Classification of Financial Instrument codes",
"type": "string"
},
"classifier": {
"type": "string"
},
"company_name": {
"description": "Contracts company name",
"type": "string"
},
"con_id": {
"description": "IBKRs contract identifier",
"type": "number"
},
"contract_month": {
"description": "Month the contract must be satisfied by making or accepting delivery",
"type": "string"
},
"currency": {
"description": "Currency contract trades in",
"type": "string"
},
"cusip": {
"type": "string"
},
"exchange": {
"description": "Primary Exchange, Routing or Trading Venue",
"type": "string"
},
"expiry_full": {
"description": "Expiration Date in the format YYYYMMDD",
"type": "number"
},
"industry": {
"description": "Specific group of companies or businesses.",
"type": "string"
},
"instrument_type": {
"description": "Asset Class of the contract",
"type": "string"
},
"is_zero_commission_security": {
"description": "Supports zero commission trades",
"type": "boolean"
},
"local_symbol": {
"description": "Contracts symbol from primary exchange. For options it is the OCC symbol.",
"type": "string"
},
"maturity_date": {
"description": "Date on which the underlying transaction settles if the option is exercised",
"type": "number"
},
"multiplier": {
"description": "numerical value of each point of price movement",
"type": "string"
},
"r_t_h": {
"description": "Provides trading outside of Regular Trading Hours",
"type": "boolean"
},
"right": {
"description": "Put or Call of the option",
"type": "string"
},
"rules": {
"items": {
"properties": {
"algoEligible": {
"type": "boolean"
},
"cashCcy": {
"description": "Cash currency for the contract",
"type": "string"
},
"cashQtyIncr": {
"description": "Increment value for cash quantity",
"type": "number"
},
"cashSize": {
"description": "cash value",
"type": "integer"
},
"cqtTypes": {
"items": {
"properties": {
"0": {
"description": "order types that support cqt trades",
"type": "string"
}
},
"type": "integer"
},
"type": "array"
},
"defaultSize": {
"description": "Default quantity",
"type": "integer"
},
"defaultTIF": {
"description": "Default time in force value",
"type": "string"
},
"displaySize": {
"type": "number"
},
"error": {
"type": "string"
},
"fraqInt": {
"description": "decimal places for fractional order size",
"type": "number"
},
"fraqTypes": {
"items": {
"properties": {
"0": {
"description": "order types that support fractional trades",
"type": "string"
}
},
"type": "integer"
},
"type": "array"
},
"ibalgoTypes": {
"items": {
"properties": {
"0": {
"description": "order types that support IB Algos",
"type": "string"
}
},
"type": "integer"
},
"type": "array"
},
"increment": {
"description": "Price increment value",
"type": "number"
},
"incrementDigits": {
"description": "Number of digits for price increment",
"type": "integer"
},
"limitPrice": {
"description": "Limit price",
"type": "number"
},
"negativeCapable": {
"description": "trading negative price support",
"type": "boolean"
},
"orderDefaults": {
"description": "If object returned will provide the defaults based on user settings",
"items": {
"properties": {
"string": {
"description": "orderType",
"items": {
"properties": {
"LP": {
"description": "Limit Price value",
"type": "string"
},
"ORTH": {
"description": "Outside of Regular Trading Hours",
"type": "boolean"
},
"PC": {
"description": "Price Cap value",
"type": "string"
},
"ROA": {
"description": "Releative offset amount",
"type": "string"
},
"ROP": {
"description": "Relative offset percent",
"type": "string"
},
"SP": {
"description": "Stop Price value",
"type": "string"
},
"TA": {
"description": "Trailing amount value",
"type": "string"
},
"TT": {
"description": "Touch trigger price",
"type": "string"
},
"TU": {
"description": "Trailing unit",
"type": "string"
},
"UNP": {
"description": "Use Net Price for Bonds",
"type": "boolean"
}
},
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
},
"orderOrigination": {
"description": "Order origin designation for US securities options and Options Clearing Corporation",
"type": "number"
},
"orderTypes": {
"items": {
"properties": {
"0": {
"description": "list of available order types",
"type": "string"
}
},
"type": "integer"
},
"type": "array"
},
"orderTypesOutside": {
"items": {
"properties": {
"0": {
"description": "order types that support outside of regular trading hours",
"type": "string"
}
},
"type": "integer"
},
"type": "array"
},
"preview": {
"description": "order preview required",
"type": "boolean"
},
"priceMagnifier": {
"description": "Price Magnifier",
"type": "number"
},
"sizeIncrement": {
"description": "increment quantity value",
"type": "integer"
},
"stopprice": {
"description": "Stop price",
"type": "number"
},
"tifTypes": {
"items": {
"properties": {
"0": {
"description": "Time in Force values, formatted with o for supporting Outside regular trading hours and a for Algo trading",
"type": "string"
}
},
"type": "integer"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
},
"smart_available": {
"description": "Support IBKRs SMART routing",
"type": "boolean"
},
"strike": {
"description": "fixed price at which the owner of the option buys or sells the underlying",
"type": "string"
},
"symbol": {
"description": "Underlying symbol",
"type": "string"
},
"text": {
"description": "Formatted contract parameters",
"type": "string"
},
"trading_class": {
"description": "Designation of the contract",
"type": "string"
},
"underlying_con_id": {
"description": "IBKRs contract identifier for the underlying instrument",
"type": "number"
},
"underlying_issuer": {
"description": "Legal entity for underlying contract",
"type": "string"
},
"valid_exchanges": {
"description": "Comma separated list of exchanges or trading venues",
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Info and Rules",
"tags": [
"Contract"
]
}
},
"/iserver/marketdata/history": {
"get": {
"description": "Get historical market Data for given conid, length of data is controlled by 'period' and 'bar'.\nFormatted as: min=minute, h=hour, d=day, w=week, m=month, y=year\ne.g. period =1y with bar =1w returns 52 data points (Max of 1000 data points supported).\n**Note**: There's a limit of 5 concurrent requests. Excessive requests will return a 'Too many requests' status 429 response.\n",
"parameters": [
{
"description": "contract id",
"in": "query",
"name": "conid",
"required": true,
"type": "string"
},
{
"description": "Exchange of the conid (e.g. ISLAND, NYSE, etc.). Default value is empty which corresponds to primary exchange of the conid.",
"in": "query",
"name": "exchange",
"required": false,
"type": "string"
},
{
"description": "available time period-- {1-30}min, {1-8}h, {1-1000}d, {1-792}w, {1-182}m, {1-15}y",
"in": "query",
"name": "period",
"required": true,
"type": "string"
},
{
"description": "possible value-- 1min, 2min, 3min, 5min, 10min, 15min, 30min, 1h, 2h, 3h, 4h, 8h, 1d, 1w, 1m",
"in": "query",
"name": "bar",
"required": false,
"type": "string"
},
{
"description": "For contracts that support it, will determine if historical data includes outside of regular trading hours.",
"in": "query",
"name": "outsideRth",
"required": false,
"type": "boolean"
}
],
"responses": {
"200": {
"description": "Returns an object",
"schema": {
"$ref": "#/definitions/history-data"
}
},
"429": {
"description": "Too many requests",
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
},
"500": {
"description": "System Error",
"schema": {
"$ref": "#/definitions/system-error"
}
}
},
"summary": "Market Data History",
"tags": [
"Market Data"
]
}
},
"/iserver/marketdata/snapshot": {
"get": {
"description": "Get Market Data for the given conid(s). The endpoint will return by default bid, ask, last, change, change pct, close, listing exchange.\nSee response fields for a list of available fields that can be request via fields argument.\nThe endpoint /iserver/accounts must be called prior to /iserver/marketdata/snapshot.\nFor derivative contracts the endpoint /iserver/secdef/search must be called first.\nFirst /snapshot endpoint call for given conid will initiate the market data request. \nTo receive all available fields the /snapshot endpoint will need to be called several times.\nTo receive streaming market data the endpoint /ws can be used. Refer to [Streaming WebSocket Data](https://interactivebrokers.github.io/cpwebapi/RealtimeSubscription.html) for details.\n",
"parameters": [
{
"description": "list of conids separated by comma",
"in": "query",
"name": "conids",
"required": true,
"type": "string"
},
{
"description": "time period since which updates are required. uses epoch time with milliseconds.",
"in": "query",
"name": "since",
"required": false,
"type": "integer"
},
{
"description": "list of fields separated by comma",
"in": "query",
"name": "fields",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "Returns an array of objects",
"schema": {
"items": {
"properties": {
"31": {
"description": "Last Price - The last price at which the contract traded. \"C\" identifies this price as the previous day's closing price. \"H\" means that the trading is halted.",
"type": "string"
},
"55": {
"description": "Symbol",
"type": "string"
},
"58": {
"description": "Text",
"type": "string"
},
"6004": {
"description": "Exchange",
"type": "string"
},
"6008": {
"description": "Conid - Contract identifier from IBKR's database.",
"type": "integer"
},
"6070": {
"description": "SecType - The asset class of the instrument.",
"type": "string"
},
"6072": {
"description": "Months",
"type": "string"
},
"6073": {
"description": "Regular Expiry",
"type": "string"
},
"6119": {
"description": "Marker for market data delivery method (similar to request id)",
"type": "string"
},
"6457": {
"description": "Underlying Conid. Use /trsrv/secdef to get more information about the security",
"type": "integer"
},
"6509": {
"description": "Market Data Availability. The field may contain two chars. The first char is the primary code: R = Realtime, D = Delayed,\nZ = Frozen, Y = Frozen Delayed. The second char is the secondary code: P = Snapshot Available, p = Consolidated.\nThe third char defines: B = Book\n",
"type": "string"
},
"70": {
"description": "High - Current day high price",
"type": "string"
},
"7051": {
"description": "Company name",
"type": "string"
},
"7057": {
"description": "Ask Exch - Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY\n",
"type": "string"
},
"7058": {
"description": "Last Exch - Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY\n",
"type": "string"
},
"7059": {
"description": "Last Size - The number of unites traded at the last price",
"type": "string"
},
"7068": {
"description": "Bid Exch - Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY\n",
"type": "string"
},
"7084": {
"description": "Implied Vol./Hist. Vol % - The ratio of the implied volatility over the historical volatility, expressed as a percentage.",
"type": "string"
},
"7085": {
"description": "Put/Call Interest - Put option open interest/call option open interest for the trading day.",
"type": "string"
},
"7086": {
"description": "Put/Call Volume - Put option volume/call option volume for the trading day.",
"type": "string"
},
"7087": {
"description": "Hist. Vol. % - 30-day real-time historical volatility.",
"type": "string"
},
"7088": {
"description": "Hist. Vol. Close % - Shows the historical volatility based on previous close price.",
"type": "string"
},
"7089": {
"description": "Opt. Volume - Option Volume",
"type": "string"
},
"7094": {
"description": "Conid + Exchange",
"type": "string"
},
"71": {
"description": "Low - Current day low price",
"type": "string"
},
"7184": {
"description": "canBeTraded - If contract is a trade-able instrument. Returns 1(true) or 0(false).",
"type": "string"
},
"72": {
"description": "Position - The current aggregate position for the specified account or group.",
"type": "string"
},
"7219": {
"description": "Contract Description",
"type": "string"
},
"7220": {
"description": "Contract Description",
"type": "string"
},
"7221": {
"description": "Listing Exchange",
"type": "string"
},
"7280": {
"description": "Industry - Displays the type of industry under which the underlying company can be categorized.",
"type": "string"
},
"7281": {
"description": "Category - Displays a more detailed level of description within the industry under which the underlying company can be categorized.",
"type": "string"
},
"7282": {
"description": "Average Volume - The average daily trading volume over 90 days.",
"type": "string"
},
"7283": {
"description": "Option Implied Vol. % - A prediction of how volatile an underlying will be in the future.\nAt the market volatility estimated for a maturity thirty calendar days forward of the current trading day, and based on option prices from two consecutive expiration months.\nTo query the Implied Vol. % of a specific strike refer to field 7633.\n",
"type": "string"
},
"7284": {
"description": "Historic Volume (30d)",
"type": "string"
},
"7285": {
"description": "Put/Call Ratio",
"type": "string"
},
"7286": {
"description": "Dividend Amount - Displays the amount of the next dividend.",
"type": "string"
},
"7287": {
"description": "Dividend Yield % - This value is the toal of the expected dividend payments over the next twelve months per share divided by the Current Price and is expressed as a percentage.\nFor derivatives, this displays the total of the expected dividend payments over the expiry date.\n",
"type": "string"
},
"7288": {
"description": "Ex-date of the dividend",
"type": "string"
},
"7289": {
"description": "Market Cap",
"type": "string"
},
"7290": {
"description": "P/E",
"type": "string"
},
"7291": {
"description": "EPS",
"type": "string"
},
"7292": {
"description": "Cost Basis - Your current position in this security multiplied by the average price and multiplier.",
"type": "string"
},
"7293": {
"description": "52 Week High - The highest price for the past 52 weeks.",
"type": "string"
},
"7294": {
"description": "52 Week Low - The lowest price for the past 52 weeks.",
"type": "string"
},
"7295": {
"description": "Open - Today's opening price.",
"type": "string"
},
"7296": {
"description": "Close - Today's closing price.",
"type": "string"
},
"73": {
"description": "Market Value - The current market value of your position in the security. Market Value is calculated with realtime market data (even when not subscribed to market data).",
"type": "string"
},
"7308": {
"description": "Delta - The ratio of the change in the price of the option to the corresponding change in the price of the underlying.",
"type": "string"
},
"7309": {
"description": "Gamma - The rate of change for the delta with respect to the underlying asset's price.",
"type": "string"
},
"7310": {
"description": "Theta - A measure of the rate of decline the value of an option due to the passage of time.",
"type": "string"
},
"7311": {
"description": "Vega - The amount that the price of an option changes compared to a 1% change in the volatility.",
"type": "string"
},
"74": {
"description": "Avg Price - The average price of the position.",
"type": "string"
},
"75": {
"description": "Unrealized PnL - Unrealized profit or loss. Unrealized PnL is calculated with realtime market data (even when not subscribed to market data).",
"type": "string"
},
"76": {
"description": "Formatted position",
"type": "string"
},
"7607": {
"description": "Opt. Volume Change % - Today's option volume as a percentage of the average option volume.",
"type": "string"
},
"7633": {
"description": "Implied Vol. % - The implied volatility for the specific strike of the option in percentage. To query the Option Implied Vol. % from the underlying refer to field 7283. \n",
"type": "string"
},
"7635": {
"description": "Mark - The mark price is, the ask price if ask is less than last price, the bid price if bid is more than the last price, otherwise it's equal to last price.",
"type": "string"
},
"7636": {
"description": "Shortable Shares - Number of shares available for shorting.",
"type": "string"
},
"7637": {
"description": "Fee Rate - Interest rate charged on borrowed shares.",
"type": "string"
},
"7638": {
"description": "Option Open Interest",
"type": "string"
},
"7639": {
"description": "% of Mark Value - Displays the market value of the contract as a percentage of the total market value of the account.\nDaily PnL is calculated with realtime market data (even when not subscribed to market data).\n",
"type": "string"
},
"7644": {
"description": "Shortable - Describes the level of difficulty with which the security can be sold short.",
"type": "string"
},
"7655": {
"description": "Morningstar Rating - Displays Morningstar Rating provided value. Requires [Morningstar](https://www.interactivebrokers.com/en/index.php?f=14262) subscription.",
"type": "string"
},
"7671": {
"description": "Dividends - This value is the total of the expected dividend payments over the next twelve months per share.",
"type": "string"
},
"7672": {
"description": "Dividends TTM - This value is the total of the expected dividend payments over the last twelve months per share.",
"type": "string"
},
"7674": {
"description": "EMA(200) - Exponential moving average (N=200).",
"type": "string"
},
"7675": {
"description": "EMA(100) - Exponential moving average (N=100).",
"type": "string"
},
"7676": {
"description": "EMA(50) - Exponential moving average (N=50).",
"type": "string"
},
"7677": {
"description": "EMA(20) - Exponential moving average (N=20).",
"type": "string"
},
"7678": {
"description": "Price/EMA(200) - Price to Exponential moving average (N=200) ratio -1, displayed in percents.",
"type": "string"
},
"7679": {
"description": "Price/EMA(100) - Price to Exponential moving average (N=100) ratio -1, displayed in percents.",
"type": "string"
},
"7680": {
"description": "Price/EMA(50) - Price to Exponential moving average (N=50) ratio -1, displayed in percents.",
"type": "string"
},
"7681": {
"description": "Price/EMA(20) - Price to Exponential moving average (N=20) ratio -1, displayed in percents.",
"type": "string"
},
"7682": {
"description": "Change Since Open - The difference between the last price and the open price.",
"type": "string"
},
"7683": {
"description": "Upcoming Event - Shows the next major company event. Requires [Wall Street Horizon](https://www.interactivebrokers.com/en/index.php?f=24674) subscription.",
"type": "string"
},
"7684": {
"description": "Upcoming Event Date - The date of the next major company event. Requires [Wall Street Horizon](https://www.interactivebrokers.com/en/index.php?f=24674) subscription.",
"type": "string"
},
"7685": {
"description": "Upcoming Analyst Meeting - The date and time of the next scheduled analyst meeting. Requires [Wall Street Horizon](https://www.interactivebrokers.com/en/index.php?f=24674) subscription.",
"type": "string"
},
"7686": {
"description": "Upcoming Earnings - The date and time of the next scheduled earnings/earnings call event. Requires [Wall Street Horizon](https://www.interactivebrokers.com/en/index.php?f=24674) subscription.",
"type": "string"
},
"7687": {
"description": "Upcoming Misc Event - The date and time of the next shareholder meeting, presentation or other event. Requires [Wall Street Horizon](https://www.interactivebrokers.com/en/index.php?f=24674) subscription.",
"type": "string"
},
"7688": {
"description": "Recent Analyst Meeting - The date and time of the most recent analyst meeting. Requires [Wall Street Horizon](https://www.interactivebrokers.com/en/index.php?f=24674) subscription.",
"type": "string"
},
"7689": {
"description": "Recent Earnings - The date and time of the most recent earnings/earning call event. Requires [Wall Street Horizon](https://www.interactivebrokers.com/en/index.php?f=24674) subscription.",
"type": "string"
},
"7690": {
"description": "Recent Misc Event - The date and time of the most recent shareholder meeting, presentation or other event. Requires [Wall Street Horizon](https://www.interactivebrokers.com/en/index.php?f=24674) subscription.",
"type": "string"
},
"7694": {
"description": "Probability of Max Return - Customer implied probability of maximum potential gain.",
"type": "string"
},
"7695": {
"description": "Break Even - Break even points",
"type": "string"
},
"7696": {
"description": "SPX Delta - Beta Weighted Delta is calculated using the formula; Delta x dollar adjusted beta, where adjusted beta is adjusted by the ratio of the close price.",
"type": "string"
},
"7697": {
"description": "Futures Open Interest - Total number of outstanding futures contracts",
"type": "string"
},
"7698": {
"description": "Last Yield - Implied yield of the bond if it is purchased at the current last price. Last yield is calculated using the Last price on all possible call dates.\nIt is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates.\nThe yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.\n",
"type": "string"
},
"7699": {
"description": "Bid Yield - Implied yield of the bond if it is purchased at the current bid price. Bid yield is calculated using the Ask on all possible call dates.\nIt is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates.\nThe yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.\n",
"type": "string"
},
"77": {
"description": "Formatted Unrealized PnL",
"type": "string"
},
"7700": {
"description": "Probability of Max Return - Customer implied probability of maximum potential gain.",
"type": "string"
},
"7702": {
"description": "Probability of Max Loss - Customer implied probability of maximum potential loss.",
"type": "string"
},
"7703": {
"description": "Profit Probability - Customer implied probability of any gain.",
"type": "string"
},
"7704": {
"description": "Organization Type",
"type": "string"
},
"7705": {
"description": "Debt Class",
"type": "string"
},
"7706": {
"description": "Ratings - Ratings issued for bond contract.",
"type": "string"
},
"7707": {
"description": "Bond State Code",
"type": "string"
},
"7708": {
"description": "Bond Type",
"type": "string"
},
"7714": {
"description": "Last Trading Date",
"type": "string"
},
"7715": {
"description": "Issue Date",
"type": "string"
},
"7718": {
"description": "Beta - Beta is against standard index.",
"type": "string"
},
"7720": {
"description": "Ask Yield - Implied yield of the bond if it is purchased at the current offer. Ask yield is calculated using the Bid on all possible call dates.\nIt is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates.\nThe yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.\n",
"type": "string"
},
"7741": {
"description": "Prior Close - Yesterday's closing price",
"type": "string"
},
"7762": {
"description": "Volume Long - High precision volume for the day. For formatted volume refer to field 87.",
"type": "string"
},
"7768": {
"description": "hasTradingPermissions - if user has trading permissions for specified contract. Returns 1(true) or 0(false).",
"type": "string"
},
"78": {
"description": "Daily PnL - Your profit or loss of the day since prior close. Daily PnL is calculated with realtime market data (even when not subscribed to market data).",
"type": "string"
},
"82": {
"description": "Change - The difference between the last price and the close on the previous trading day",
"type": "string"
},
"83": {
"description": "Change % - The difference between the last price and the close on the previous trading day in percentage.",
"type": "string"
},
"84": {
"description": "Bid Price - The highest-priced bid on the contract.",
"type": "string"
},
"85": {
"description": "Ask Size - The number of contracts or shares offered at the ask price. For US stocks, the number displayed is divided by 100.",
"type": "string"
},
"86": {
"description": "Ask Price - The lowest-priced offer on the contract.",
"type": "string"
},
"87": {
"description": "Volume - Volume for the day, formatted with 'K' for thousands or 'M' for millions. For higher precision volume refer to field 7762.",
"type": "string"
},
"87_raw (deprecated)": {
"description": "Raw Volume - Volume for the day, provided in long form without formatted with K/M. This field value is deprecated, for high precision volume refer to field 7762.",
"type": "string"
},
"88": {
"description": "Bid Size - The number of contracts or shares bid for at the bid price. For US stocks, the number displayed is divided by 100.",
"type": "string"
},
"_updated": {
"type": "integer"
},
"conid": {
"type": "integer"
},
"server_id": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"400": {
"description": "sent when accounts are not queried before sending this request",
"schema": {
"properties": {
"error": {
"type": "string"
},
"statusCode": {
"type": "integer"
}
},
"type": "object"
}
}
},
"summary": "Market Data",
"tags": [
"Market Data"
]
}
},
"/iserver/marketdata/unsubscribeall": {
"get": {
"description": "Cancel all market data request(s). To cancel market data for given conid, see /iserver/marketdata/{conid}/unsubscribe.\n",
"responses": {
"200": {
"description": "confirms market data is cancelled",
"schema": {
"properties": {
"confirmed": {
"description": "true means market data is cancelled, false means it is not.",
"type": "boolean"
}
},
"type": "object"
}
}
},
"summary": "Market Data Cancel (All)",
"tags": [
"Market Data"
]
}
},
"/iserver/marketdata/{conid}/unsubscribe": {
"get": {
"description": "Cancel market data for given conid. To cancel all market data request(s), see /iserver/marketdata/unsubscribeall.\n",
"parameters": [
{
"description": "contract id",
"in": "path",
"name": "conid",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "confirms market data for conid is cancelled",
"schema": {
"properties": {
"confirmed": {
"description": "success means market data was cancelled.",
"type": "string"
}
},
"type": "object"
}
},
"500": {
"description": "cancel failed"
}
},
"summary": "Market Data Cancel (Single)",
"tags": [
"Market Data"
]
}
},
"/iserver/reauthenticate": {
"post": {
"description": "When using the CP Gateway, this endpoint provides a way to reauthenticate to the Brokerage system as long as there is a valid SSO session, see /sso/validate.\n",
"responses": {
"200": {
"description": "Authentication Status",
"schema": {
"$ref": "#/definitions/authStatus"
}
}
},
"summary": "Tries to re-authenticate to Brokerage",
"tags": [
"Session"
]
}
},
"/iserver/reply/{replyid}": {
"post": {
"description": "Reply to questions when placing orders and submit orders",
"parameters": [
{
"description": "Please use the \"id\" from the response of \"Place Order\" endpoint",
"in": "path",
"name": "replyid",
"required": true,
"type": "string"
},
{
"description": "Answer to question",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"confirmed": {
"description": "answer to question, true means yes, false means no",
"type": "boolean"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "Order is submitted successfully, returns an array contains one object",
"schema": {
"items": {
"properties": {
"local_order_id": {
"type": "string"
},
"order_id": {
"type": "string"
},
"order_status": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"400": {
"description": "When you send \"confirmed-false\" in the request, you will receive this",
"schema": {
"properties": {
"error": {
"description": "for example-order not confirmed",
"type": "string"
},
"statusCode": {
"type": "integer"
}
},
"type": "object"
}
}
},
"summary": "Place Order Reply",
"tags": [
"Order"
]
}
},
"/iserver/scanner/params": {
"get": {
"description": "Returns an object contains four lists contain all parameters for scanners",
"responses": {
"200": {
"description": "An object contains lists",
"schema": {
"properties": {
"filter_list": {
"items": {
"properties": {
"code": {
"type": "string"
},
"display_name": {
"type": "string"
},
"group": {
"type": "string"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"instrument_list": {
"items": {
"properties": {
"display_name": {
"type": "string"
},
"filters": {
"items": {
"description": "code of filter",
"type": "string"
},
"type": "array"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"location_tree": {
"items": {
"properties": {
"display_name": {
"type": "string"
},
"locations": {
"items": {
"properties": {
"display_name": {
"type": "string"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"scan_type_list": {
"items": {
"properties": {
"code": {
"type": "string"
},
"display_name": {
"type": "string"
},
"instruments": {
"items": {
"description": "type of instrument",
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
}
},
"summary": "Scanner Parameters",
"tags": [
"Scanner"
]
}
},
"/iserver/scanner/run": {
"post": {
"parameters": [
{
"description": "scanner-params request",
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/scanner-params"
}
}
],
"responses": {
"200": {
"description": "returns an array",
"schema": {
"items": {
"properties": {
"available_chart_periods": {
"description": "List of available chart periods",
"type": "string"
},
"column_name": {
"type": "string"
},
"company_name": {
"description": "Contracts company name",
"type": "string"
},
"con_id": {
"type": "number"
},
"conidex": {
"description": "conid and exchange. Format supports conid or conid@exchange",
"type": "string"
},
"contract_description_1": {
"description": "Format contract name",
"example": "FB Stock (NASDAQ.NMS)",
"type": "string"
},
"listing_exchange": {
"type": "string"
},
"sec_type": {
"type": "string"
},
"server_id": {
"type": "string"
},
"symbol": {
"description": "Underlying symbol",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
}
},
"summary": "run scanner to get a list of contracts",
"tags": [
"Scanner"
]
}
},
"/iserver/secdef/info": {
"get": {
"description": "Provides Contract Details of Futures, Options, Warrants, Cash and CFDs based on conid. To get the strike price for Options/Warrants use \"/iserver/secdef/strikes\" endpoint. Must call /secdef/search for the underlying contract first.",
"parameters": [
{
"description": "underlying contract id",
"in": "query",
"name": "conid",
"required": true,
"type": "string"
},
{
"description": "FUT/OPT/WAR/CASH/CFD",
"in": "query",
"name": "sectype",
"required": true,
"type": "string"
},
{
"description": "contract month, only required for FUT/OPT/WAR in the format MMMYY, example JAN00",
"in": "query",
"name": "month",
"required": false,
"type": "string"
},
{
"description": "optional, default is SMART",
"in": "query",
"name": "exchange",
"required": false,
"type": "string"
},
{
"description": "optional, only required for OPT/WAR",
"in": "query",
"name": "strike",
"required": false,
"type": "string"
},
{
"description": "C for call, P for put",
"in": "query",
"name": "right",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an array of objects",
"schema": {
"items": {
"$ref": "#/definitions/secdef-info"
}
}
},
"500": {
"description": "error while processing the request",
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Secdef Info",
"tags": [
"Contract"
]
}
},
"/iserver/secdef/search": {
"post": {
"description": "Search by underlying symbol or company name. Relays back what derivative contract(s) it has. This endpoint must be called before using /secdef/info.\nIf company name is specified will only receive limited response: conid, companyName, companyHeader and symbol.\n",
"parameters": [
{
"description": "Symbol or Company Name to be searched",
"in": "body",
"name": "symbol",
"required": true,
"schema": {
"properties": {
"name": {
"description": "should be true if the search is to be performed by name. false by default.",
"type": "boolean"
},
"secType": {
"description": "If search is done by name, only the assets provided in this field will be returned. Currently, only STK is supported.",
"type": "string"
},
"symbol": {
"description": "symbol or name to be searched",
"type": "string"
}
},
"required": [
"symbol"
],
"type": "object"
}
}
],
"responses": {
"200": {
"description": "returns an array of results",
"schema": {
"items": {
"properties": {
"companyHeader": {
"description": "Company Name - Exchange",
"type": "string"
},
"companyName": {
"type": "string"
},
"conid": {
"description": "Contract Identifier",
"type": "integer"
},
"description": {
"description": "Exchange",
"type": "string"
},
"fop": {
"description": "List of Future Option expirations in YYYMMDD format separated by semicolon",
"type": "string"
},
"opt": {
"description": "List of Option expirations in YYYYMMDD format separated by semicolon",
"type": "string"
},
"restricted": {
"type": "string"
},
"sections": {
"items": {
"properties": {
"exchange": {
"description": "Listing Exchange",
"type": "string"
},
"legSecType": {
"description": "For combo's defines the asset class for each leg",
"type": "string"
},
"months": {
"description": "List of expiration month(s) and year(s) in MMMYY format separated by semicolon",
"type": "string"
},
"secType": {
"description": "Asset Class",
"type": "string"
},
"symbol": {
"description": "Underlying symbol",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"symbol": {
"description": "Underlying symbol",
"type": "string"
},
"war": {
"description": "List of Warrant expirations in YYYYMMDD format separated by semicolon",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"500": {
"description": "error while processing the request",
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Search by Symbol or Name",
"tags": [
"Contract"
]
}
},
"/iserver/secdef/strikes": {
"get": {
"description": "Query strikes for Options/Warrants. For the conid of the underlying contract, available contract months and exchanges use \"/iserver/secdef/search\"",
"parameters": [
{
"description": "contract id of the underlying contract",
"in": "query",
"name": "conid",
"required": true,
"type": "string"
},
{
"description": "OPT/WAR",
"in": "query",
"name": "sectype",
"required": true,
"type": "string"
},
{
"description": "contract month",
"in": "query",
"name": "month",
"required": true,
"type": "string"
},
{
"description": "optional, default is SMART",
"in": "query",
"name": "exchange",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an object contains call/put strike prices",
"schema": {
"properties": {
"call": {
"items": {
"example": [
"5",
"10",
"20"
],
"type": "string"
},
"type": "array"
},
"put": {
"items": {
"example": [
"5",
"10",
"20"
],
"type": "string"
},
"type": "array"
}
},
"type": "object"
}
},
"500": {
"description": "error while processing the request",
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Search Strikes",
"tags": [
"Contract"
]
}
},
"/logout": {
"post": {
"description": "Logs the user out of the gateway session. Any further activity requires re-authentication.",
"responses": {
"200": {
"description": "returned status indicates if user is logged in",
"schema": {
"properties": {
"confirmed": {
"description": "true means username is still logged in, false means it is not",
"type": "boolean"
}
},
"type": "object"
}
}
},
"summary": "Ends the current session",
"tags": [
"Session"
]
}
},
"/pa/performance": {
"post": {
"description": "Returns the performance (MTM) for the given accounts, if more than one account is passed, the result is consolidated.",
"parameters": [
{
"description": "an array of account ids",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"acctIds": {
"items": {
"description": "account id",
"type": "string"
},
"type": "array"
},
"freq": {
"description": "Frequency of cumulative performance data points: 'D'aily, 'M'onthly,'Q'uarterly.\n",
"enum": [
"D",
"M",
"Q"
],
"type": "string"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "returns an object",
"schema": {
"$ref": "#/definitions/performance"
}
}
},
"summary": "Account Performance",
"tags": [
"PortfolioAnalyst"
]
}
},
"/pa/summary": {
"post": {
"description": "Returns a summary of all account balances for the given accounts, if more than one account is passed, the result is consolidated.",
"parameters": [
{
"description": "an array of account ids",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"acctIds": {
"items": {
"description": "account id",
"type": "string"
},
"type": "array"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "returns an object",
"schema": {
"$ref": "#/definitions/summary"
}
}
},
"summary": "Account Balance's Summary",
"tags": [
"PortfolioAnalyst"
]
}
},
"/pa/transactions": {
"post": {
"description": "transaction history for a given number of conids and accounts.\nTypes of transactions include dividend payments, buy and sell transactions, transfers.\n",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"acctIds": {
"items": {
"description": "account id",
"type": "string"
},
"type": "array"
},
"conids": {
"items": {
"description": "array only supports one conid at a time.",
"type": "number"
},
"type": "array"
},
"currency": {
"description": "optional defaults to USD.",
"example": "USD",
"type": "string"
},
"days": {
"description": "optional, default value is 90",
"example": 7,
"type": "number"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "returns an object",
"schema": {
"$ref": "#/definitions/transactions"
}
}
},
"summary": "Position's Transaction History",
"tags": [
"PortfolioAnalyst"
]
}
},
"/portfolio/accounts": {
"get": {
"description": "In non-tiered account structures, returns a list of accounts for which the user can view position and account information. This endpoint must be called prior to calling other /portfolio endpoints for those accounts. For querying a list of accounts which the user can trade, see /iserver/accounts. For a list of subaccounts in tiered account structures (e.g. financial advisor or ibroker accounts) see /portfolio/subaccounts.",
"responses": {
"200": {
"description": "An array",
"schema": {
"$ref": "#/definitions/accounts"
}
}
},
"summary": "Portfolio Accounts",
"tags": [
"Account",
"Portfolio"
]
}
},
"/portfolio/allocation": {
"post": {
"description": "Similar to /portfolio/{accountId}/allocation but returns a consolidated view of of all the accounts returned by /portfolio/accounts. /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint.",
"parameters": [
{
"description": "accounts info",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"acctIds": {
"items": {
"description": "account id",
"type": "string"
},
"type": "array"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "returns an object of three different allocations",
"schema": {
"$ref": "#/definitions/allocation"
}
}
},
"summary": "Account Alloction (All Accounts)",
"tags": [
"Portfolio"
]
}
},
"/portfolio/positions/{conid}": {
"get": {
"description": "Returns an object of all positions matching the conid for all the selected accounts. For portfolio models the conid could be in more than one model, returning an array with the name of the model it belongs to. /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint.",
"parameters": [
{
"description": "contract id",
"in": "path",
"name": "conid",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "returns an object containing account and its position information",
"schema": {
"properties": {
"ACCTID": {
"$ref": "#/definitions/position"
}
},
"type": "object"
}
}
},
"summary": "Positions by Conid",
"tags": [
"Portfolio"
]
}
},
"/portfolio/subaccounts": {
"get": {
"description": "Used in tiered account structures (such as financial advisor and ibroker accounts) to return a list of sub-accounts for which the user can view position and account-related information. This endpoint must be called prior to calling other /portfolio endpoints for those subaccounts. To query a list of accounts the user can trade, see /iserver/accounts.",
"responses": {
"200": {
"description": "An array",
"schema": {
"$ref": "#/definitions/account"
}
}
},
"summary": "List of Sub-Accounts",
"tags": [
"Account",
"Portfolio"
]
}
},
"/portfolio/{accountId}/allocation": {
"get": {
"description": "Information about the account's portfolio allocation by Asset Class, Industry and Category. /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint.",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an object of three different allocations",
"schema": {
"$ref": "#/definitions/allocation"
}
}
},
"summary": "Account Allocation",
"tags": [
"Portfolio"
]
}
},
"/portfolio/{accountId}/ledger": {
"get": {
"description": "Information regarding settled cash, cash balances, etc. in the account's base currency and any other cash balances hold in other currencies. /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint. The list of supported currencies is available at https://www.interactivebrokers.com/en/index.php?f=3185.",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "200 means successful",
"schema": {
"properties": {
"BASE": {
"$ref": "#/definitions/ledger"
}
},
"type": "object"
}
}
},
"summary": "Account Ledger",
"tags": [
"Account",
"Portfolio"
]
}
},
"/portfolio/{accountId}/meta": {
"get": {
"description": "Account information related to account Id /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint.",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "An object",
"schema": {
"$ref": "#/definitions/accounts"
}
}
},
"summary": "Account Information",
"tags": [
"Account",
"Portfolio"
]
}
},
"/portfolio/{accountId}/position/{conid}": {
"get": {
"description": "Returns a list of all positions matching the conid. For portfolio models the conid could be in more than one model, returning an array with the name of the model it belongs to. /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint.",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
},
{
"description": "contract id",
"in": "path",
"name": "conid",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "returns a list containing only one position for the conid",
"schema": {
"$ref": "#/definitions/position"
}
}
},
"summary": "Position by Conid",
"tags": [
"Portfolio"
]
}
},
"/portfolio/{accountId}/positions/invalidate": {
"post": {
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Means successful",
"schema": {
"type": "object"
}
}
},
"summary": "Invalidates the backend cache of the Portfolio",
"tags": [
"Portfolio"
]
}
},
"/portfolio/{accountId}/positions/{pageId}": {
"get": {
"description": "Returns a list of positions for the given account. The endpoint supports paging, page's default size is 30 positions. /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint.",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
},
{
"default": "0",
"description": "page id",
"in": "path",
"name": "pageId",
"required": true,
"type": "string"
},
{
"description": "optional",
"in": "query",
"name": "model",
"type": "string"
},
{
"description": "declare the table to be sorted by which column",
"in": "query",
"name": "sort",
"type": "string"
},
{
"description": "in which order, a means ascending - d means descending",
"in": "query",
"name": "direction",
"type": "string"
},
{
"description": "period for pnl column, can be 1D, 7D, 1M...",
"in": "query",
"name": "period",
"type": "string"
}
],
"responses": {
"200": {
"description": "returns a list of positions in the portfolio",
"schema": {
"$ref": "#/definitions/position"
}
}
},
"summary": "Portfolio Positions",
"tags": [
"Portfolio"
]
}
},
"/portfolio/{accountId}/summary": {
"get": {
"description": "Returns information about margin, cash balances and other information related to specified account. See also /portfolio/{accountId}/ledger. /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint.",
"parameters": [
{
"description": "account id",
"in": "path",
"name": "accountId",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an object containing account summary. The object contains multiple properties. A property is sufficed with -c if its provides commodity value, -s if it provides security value and -c if its UKL segment value",
"schema": {
"properties": {
"accountready": {
"$ref": "#/definitions/summary"
},
"accounttype": {
"$ref": "#/definitions/summary"
},
"accruedcash": {
"$ref": "#/definitions/summary"
},
"accruedcash-c": {
"$ref": "#/definitions/summary"
},
"accruedcash-f": {
"$ref": "#/definitions/summary"
},
"accruedcash-s": {
"$ref": "#/definitions/summary"
},
"accrueddividend": {
"$ref": "#/definitions/summary"
},
"accrueddividend-c": {
"$ref": "#/definitions/summary"
},
"accrueddividend-f": {
"$ref": "#/definitions/summary"
},
"accrueddividend-s": {
"$ref": "#/definitions/summary"
},
"availablefunds": {
"$ref": "#/definitions/summary"
},
"availablefunds-c": {
"$ref": "#/definitions/summary"
},
"availablefunds-f": {
"$ref": "#/definitions/summary"
},
"availablefunds-s": {
"$ref": "#/definitions/summary"
},
"billable": {
"$ref": "#/definitions/summary"
},
"billable-c": {
"$ref": "#/definitions/summary"
},
"billable-f": {
"$ref": "#/definitions/summary"
},
"billable-s": {
"$ref": "#/definitions/summary"
},
"buyingpower": {
"$ref": "#/definitions/summary"
},
"cushion": {
"$ref": "#/definitions/summary"
},
"daytradesremaining": {
"$ref": "#/definitions/summary"
},
"daytradesremainingt+1": {
"$ref": "#/definitions/summary"
},
"daytradesremainingt+2": {
"$ref": "#/definitions/summary"
},
"daytradesremainingt+3": {
"$ref": "#/definitions/summary"
},
"daytradesremainingt+4": {
"$ref": "#/definitions/summary"
},
"equitywithloanvalue": {
"$ref": "#/definitions/summary"
},
"equitywithloanvalue-c": {
"$ref": "#/definitions/summary"
},
"equitywithloanvalue-f": {
"$ref": "#/definitions/summary"
},
"equitywithloanvalue-s": {
"$ref": "#/definitions/summary"
},
"excessliquidity": {
"$ref": "#/definitions/summary"
},
"excessliquidity-c": {
"$ref": "#/definitions/summary"
},
"excessliquidity-f": {
"$ref": "#/definitions/summary"
},
"excessliquidity-s": {
"$ref": "#/definitions/summary"
},
"fullavailablefunds": {
"$ref": "#/definitions/summary"
},
"fullavailablefunds-c": {
"$ref": "#/definitions/summary"
},
"fullavailablefunds-f": {
"$ref": "#/definitions/summary"
},
"fullavailablefunds-s": {
"$ref": "#/definitions/summary"
},
"fullexcessliquidity": {
"$ref": "#/definitions/summary"
},
"fullexcessliquidity-c": {
"$ref": "#/definitions/summary"
},
"fullexcessliquidity-f": {
"$ref": "#/definitions/summary"
},
"fullexcessliquidity-s": {
"$ref": "#/definitions/summary"
},
"fullinitmarginreq": {
"$ref": "#/definitions/summary"
},
"fullinitmarginreq-c": {
"$ref": "#/definitions/summary"
},
"fullinitmarginreq-f": {
"$ref": "#/definitions/summary"
},
"fullinitmarginreq-s": {
"$ref": "#/definitions/summary"
},
"fullmaintmarginreq": {
"$ref": "#/definitions/summary"
},
"fullmaintmarginreq-c": {
"$ref": "#/definitions/summary"
},
"fullmaintmarginreq-f": {
"$ref": "#/definitions/summary"
},
"fullmaintmarginreq-s": {
"$ref": "#/definitions/summary"
},
"grosspositionvalue": {
"$ref": "#/definitions/summary"
},
"grosspositionvalue-c": {
"$ref": "#/definitions/summary"
},
"grosspositionvalue-f": {
"$ref": "#/definitions/summary"
},
"grosspositionvalue-s": {
"$ref": "#/definitions/summary"
},
"guarantee": {
"$ref": "#/definitions/summary"
},
"guarantee-c": {
"$ref": "#/definitions/summary"
},
"guarantee-f": {
"$ref": "#/definitions/summary"
},
"guarantee-s": {
"$ref": "#/definitions/summary"
},
"highestseverity": {
"$ref": "#/definitions/summary"
},
"highestseverity-c": {
"$ref": "#/definitions/summary"
},
"highestseverity-f": {
"$ref": "#/definitions/summary"
},
"highestseverity-s": {
"$ref": "#/definitions/summary"
},
"indianstockhaircut": {
"$ref": "#/definitions/summary"
},
"indianstockhaircut-c": {
"$ref": "#/definitions/summary"
},
"indianstockhaircut-f": {
"$ref": "#/definitions/summary"
},
"indianstockhaircut-s": {
"$ref": "#/definitions/summary"
},
"initmarginreq": {
"$ref": "#/definitions/summary"
},
"initmarginreq-c": {
"$ref": "#/definitions/summary"
},
"initmarginreq-f": {
"$ref": "#/definitions/summary"
},
"initmarginreq-s": {
"$ref": "#/definitions/summary"
},
"leverage": {
"$ref": "#/definitions/summary"
},
"leverage-c": {
"$ref": "#/definitions/summary"
},
"leverage-f": {
"$ref": "#/definitions/summary"
},
"leverage-s": {
"$ref": "#/definitions/summary"
},
"lookaheadavailablefunds": {
"$ref": "#/definitions/summary"
},
"lookaheadavailablefunds-c": {
"$ref": "#/definitions/summary"
},
"lookaheadavailablefunds-f": {
"$ref": "#/definitions/summary"
},
"lookaheadavailablefunds-s": {
"$ref": "#/definitions/summary"
},
"lookaheadexcessliquidity": {
"$ref": "#/definitions/summary"
},
"lookaheadexcessliquidity-c": {
"$ref": "#/definitions/summary"
},
"lookaheadexcessliquidity-f": {
"$ref": "#/definitions/summary"
},
"lookaheadexcessliquidity-s": {
"$ref": "#/definitions/summary"
},
"lookaheadinitmarginreq": {
"$ref": "#/definitions/summary"
},
"lookaheadinitmarginreq-c": {
"$ref": "#/definitions/summary"
},
"lookaheadinitmarginreq-f": {
"$ref": "#/definitions/summary"
},
"lookaheadinitmarginreq-s": {
"$ref": "#/definitions/summary"
},
"lookaheadmaintmarginreq": {
"$ref": "#/definitions/summary"
},
"lookaheadmaintmarginreq-c": {
"$ref": "#/definitions/summary"
},
"lookaheadmaintmarginreq-f": {
"$ref": "#/definitions/summary"
},
"lookaheadmaintmarginreq-s": {
"$ref": "#/definitions/summary"
},
"lookaheadnextchange": {
"$ref": "#/definitions/summary"
},
"maintmarginreq": {
"$ref": "#/definitions/summary"
},
"maintmarginreq-c": {
"$ref": "#/definitions/summary"
},
"maintmarginreq-f": {
"$ref": "#/definitions/summary"
},
"maintmarginreq-s": {
"$ref": "#/definitions/summary"
},
"netliquidation": {
"$ref": "#/definitions/summary"
},
"netliquidation-c": {
"$ref": "#/definitions/summary"
},
"netliquidation-f": {
"$ref": "#/definitions/summary"
},
"netliquidation-s": {
"$ref": "#/definitions/summary"
},
"netliquidationuncertainty": {
"$ref": "#/definitions/summary"
},
"nlvandmargininreview": {
"$ref": "#/definitions/summary"
},
"pasharesvalue": {
"$ref": "#/definitions/summary"
},
"pasharesvalue-c": {
"$ref": "#/definitions/summary"
},
"pasharesvalue-f": {
"$ref": "#/definitions/summary"
},
"pasharesvalue-s": {
"$ref": "#/definitions/summary"
},
"postexpirationexcess": {
"$ref": "#/definitions/summary"
},
"postexpirationexcess-c": {
"$ref": "#/definitions/summary"
},
"postexpirationexcess-f": {
"$ref": "#/definitions/summary"
},
"postexpirationexcess-s": {
"$ref": "#/definitions/summary"
},
"postexpirationmargin": {
"$ref": "#/definitions/summary"
},
"postexpirationmargin-c": {
"$ref": "#/definitions/summary"
},
"postexpirationmargin-f": {
"$ref": "#/definitions/summary"
},
"postexpirationmargin-s": {
"$ref": "#/definitions/summary"
},
"previousdayequitywithloanvalue": {
"$ref": "#/definitions/summary"
},
"previousdayequitywithloanvalue-c": {
"$ref": "#/definitions/summary"
},
"previousdayequitywithloanvalue-f": {
"$ref": "#/definitions/summary"
},
"previousdayequitywithloanvalue-s": {
"$ref": "#/definitions/summary"
},
"segmenttitle-c": {
"$ref": "#/definitions/summary"
},
"segmenttitle-f": {
"$ref": "#/definitions/summary"
},
"segmenttitle-s": {
"$ref": "#/definitions/summary"
},
"totalcashvalue": {
"$ref": "#/definitions/summary"
},
"totalcashvalue-c": {
"$ref": "#/definitions/summary"
},
"totalcashvalue-f": {
"$ref": "#/definitions/summary"
},
"totalcashvalue-s": {
"$ref": "#/definitions/summary"
},
"totaldebitcardpendingcharges": {
"$ref": "#/definitions/summary"
},
"totaldebitcardpendingcharges-c": {
"$ref": "#/definitions/summary"
},
"totaldebitcardpendingcharges-f": {
"$ref": "#/definitions/summary"
},
"totaldebitcardpendingcharges-s": {
"$ref": "#/definitions/summary"
},
"tradingtype-f": {
"$ref": "#/definitions/summary"
},
"tradingtype-s": {
"$ref": "#/definitions/summary"
}
},
"type": "object"
}
}
},
"summary": "Account Summary",
"tags": [
"Account",
"Portfolio"
]
}
},
"/sso/validate": {
"get": {
"description": "Validates the current session for the SSO user",
"responses": {
"200": {
"description": "An Object",
"schema": {
"properties": {
"AUTH_TIME": {
"description": "Time of session validation",
"type": "number"
},
"LOGIN_TYPE": {
"description": "1 for Live, 2 for Paper",
"type": "number"
},
"RESULT": {
"description": "true if session was validated; false if not.",
"type": "boolean"
},
"USER_ID": {
"description": "User ID",
"type": "number"
},
"USER_NAME": {
"description": "Username",
"type": "string"
},
"expire": {
"description": "Time in milliseconds until session expires. Caller needs to call the again to re-validate session",
"type": "number"
}
},
"type": "object"
}
},
"401": {
"description": "Authentication failed"
},
"500": {
"description": "System failed"
}
},
"summary": "Validate SSO",
"tags": [
"Session"
]
}
},
"/tickle": {
"post": {
"description": "If the gateway has not received any requests for several minutes an open session will automatically timeout. The tickle endpoint pings the server to prevent the session from ending.",
"responses": {
"200": {
"description": "confirms session is open"
}
},
"summary": "Ping the server to keep the session open",
"tags": [
"Session"
]
}
},
"/trsrv/futures": {
"get": {
"description": "Returns a list of non-expired future contracts for given symbol(s)",
"parameters": [
{
"description": "list of case-sensitive symbols separated by comma",
"in": "query",
"name": "symbols",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an object with symbol and and array of its future contracts",
"schema": {
"properties": {
"symbol": {
"$ref": "#/definitions/futures"
}
},
"type": "object"
}
},
"500": {
"description": "error while processing the request",
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Security Futures by Symbol",
"tags": [
"Contract"
]
}
},
"/trsrv/secdef": {
"post": {
"description": "Returns a list of security definitions for the given conids",
"parameters": [
{
"description": "request body",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"conids": {
"items": {
"description": "contract id",
"type": "integer"
},
"type": "array"
}
},
"type": "object"
}
}
],
"responses": {
"200": {
"description": "returns an array of secdef info",
"schema": {
"$ref": "#/definitions/secdef"
}
}
},
"summary": "Secdef by Conid",
"tags": [
"Contract"
]
}
},
"/trsrv/secdef/schedule": {
"get": {
"description": "Returns the trading schedule up to a month for the requested contract",
"parameters": [
{
"description": "specify the asset class of the contract.\nAvailable values-- Stock: STK, Option: OPT, Future: FUT, Contract For Difference: CFD, Warrant: WAR, Forex: SWP, Mutual Fund: FND, Bond: BND, Inter-Commodity Spreads: ICS\n",
"in": "query",
"name": "assetClass",
"required": true,
"type": "string"
},
{
"description": "Underlying Symbol for specified contract, for example 'AAPL' for US Stock - Apple Inc.",
"in": "query",
"name": "symbol",
"required": true,
"type": "string"
},
{
"description": "Native exchange for contract, for example 'NASDAQ' for US Stock - Apple Inc.",
"in": "query",
"name": "exchange",
"required": false,
"type": "string"
},
{
"description": "Response only returns trading schedule for specified exchange",
"in": "query",
"name": "exchangeFilter",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "Returns an object",
"schema": {
"properties": {
"id": {
"description": "Exchange parameter id",
"type": "string"
},
"schedules": {
"description": "Always contains at least one 'tradingTime' and zero or more 'sessionTime' tags",
"items": {
"properties": {
"clearingCycleEndTime": {
"type": "integer"
},
"sessions": {
"description": "If the LIQUID hours differs from the total trading day then a separate 'session' tag is returned.",
"properties": {
"closingTime": {
"type": "integer"
},
"openingTime": {
"type": "integer"
},
"prop": {
"description": "If the whole trading day is considered LIQUID then the value 'LIQUID' is returned.",
"type": "string"
}
},
"type": "object"
},
"tradingScheduleDate": {
"description": "20000101 stands for any Sat, 20000102 stands for any Sun, ... 20000107 stands for any Fri. Any other date stands for itself.",
"type": "integer"
},
"tradingTimes": {
"description": "Returns tradingTime in exchange time zone.",
"properties": {
"cancelDayOrders": {
"type": "string"
},
"closingTime": {
"type": "integer"
},
"openingTime": {
"type": "integer"
}
},
"type": "object"
}
},
"type": "object"
},
"type": "array"
},
"tradeVenueId": {
"description": "Reference on a trade venue of given exchange parameter",
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Get trading schedule for symbol",
"tags": [
"Contract"
]
}
},
"/trsrv/stocks": {
"get": {
"description": "Returns an object contains all stock contracts for given symbol(s)",
"parameters": [
{
"description": "list of upper-sensitive symbols separated by comma",
"in": "query",
"name": "symbols",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "returns an object with symbols",
"schema": {
"properties": {
"symbol": {
"$ref": "#/definitions/stocks"
}
},
"type": "object"
}
},
"500": {
"description": "error while processing the request",
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Security Stocks by Symbol",
"tags": [
"Contract"
]
}
},
"/ws": {
"post": {
"description": "The streaming API is documented under [Streaming WebSocket Data](https://interactivebrokers.github.io/cpwebapi/RealtimeSubscription.html) for details.",
"responses": {
"200": {
"description": "confirms session is open"
}
},
"summary": "Websocket Endpoint",
"tags": [
"Streaming"
]
}
}
},
"produces": [
"application/json"
],
"schemes": [
"https"
],
"swagger": "2.0"
}