{ "basePath": "/v1/api", "host": "localhost:5000", "produces": [ "application/json" ], "name": "swagger", "schemes": [ "http" ], "swagger": "2.0", "info": { "title": "Client Portal Web API", "description": "Client Poral Web API", "version": "1.0.0" }, "paths": { "/fyi/unreadnumber": { "get": { "summary": "Get unread number of fyis. The HTTP method POST is also supported.", "tags": [ "FYI" ], "description": "Returns the total number of unread fyis\n", "responses": { "200": { "description": "An object", "schema": { "type": "object", "properties": { "BN": { "type": "integer", "description": "unread number" } } } } } } }, "/fyi/settings": { "get": { "summary": "Get a list of subscriptions", "tags": [ "FYI" ], "description": "Return the current choices of subscriptions, we can toggle the option\n", "responses": { "200": { "description": "An array", "schema": { "type": "array", "items": { "type": "object", "properties": { "A": { "type": "integer", "description": "optional, if A doesn't exist, it means user can't toggle this option. 0-off, 1-on." }, "FC": { "type": "string", "description": "fyi code" }, "H": { "type": "integer", "description": "disclaimer read, 1 = yes, = 0 no." }, "FD": { "type": "string", "description": "detailed description" }, "FN": { "type": "string", "description": "title" } } } } } } } }, "/fyi/settings/{typecode}": { "post": { "summary": "Enable/Disable certain subscription", "tags": [ "FYI" ], "description": "Configure which typecode you would like to enable/disable.\n", "parameters": [ { "name": "typecode", "in": "path", "required": true, "type": "string", "description": "fyi code" }, { "in": "body", "name": "body", "required": true, "schema": { "type": "object", "properties": { "enabled": { "type": "boolean" } } } } ], "responses": { "200": { "description": "200 means successful", "schema": { "type": "object" } } } } }, "/fyi/disclaimer/{typecode}": { "get": { "summary": "Get disclaimer for a certain kind of fyi", "tags": [ "FYI" ], "parameters": [ { "name": "typecode", "in": "path", "required": true, "type": "string", "description": "fyi code, for example --M8, EA" } ], "responses": { "200": { "description": "receives the disclaimer message", "schema": { "type": "object", "properties": { "DT": { "type": "string", "description": "disclaimer message" }, "FC": { "type": "string", "description": "fyi code" } } } } } }, "put": { "summary": "Mark disclaimer read", "tags": [ "FYI" ], "parameters": [ { "name": "typecode", "in": "path", "required": true, "type": "string", "description": "fyi code, for example --M8, EA" } ], "responses": { "200": { "description": "200 means successful", "schema": { "type": "object", "properties": { "T": { "type": "integer" }, "V": { "type": "integer" } } } } } } }, "/fyi/deliveryoptions": { "get": { "summary": "Get delivery options", "tags": [ "FYI" ], "description": "options for sending fyis to email and other devices\n", "responses": { "200": { "description": "An object", "schema": { "type": "object", "properties": { "M": { "type": "integer", "description": "Email option is enabled or not 0-off, 1-on." }, "E": { "type": "array", "items": { "type": "object", "description": "device", "properties": { "NM": { "type": "string", "description": "device name" }, "I": { "type": "string", "description": "device id" }, "UI": { "type": "string", "description": "unique device id" }, "A": { "type": "string", "description": "device is enabled or not 0-true, 1-false." } } } } } } } } } }, "/fyi/deliveryoptions/email": { "put": { "summary": "Enable/Disable email option", "tags": [ "FYI" ], "parameters": [ { "name": "enabled", "in": "query", "required": true, "type": "string", "description": "true/false" } ], "responses": { "200": { "description": "200 means successful", "schema": { "type": "object", "properties": { "T": { "type": "integer" }, "V": { "type": "integer" } } } } } } }, "/fyi/deliveryoptions/device": { "post": { "summary": "Enable/Disable device option", "tags": [ "FYI" ], "parameters": [ { "in": "body", "name": "body", "description": "device info", "required": true, "schema": { "type": "object", "properties": { "devicename": { "type": "string" }, "deviceId": { "type": "string" }, "uiName": { "type": "string" }, "enabled": { "type": "boolean" } } } } ], "responses": { "200": { "description": "200 means successful", "schema": { "type": "object", "properties": { "T": { "type": "integer" }, "V": { "type": "integer" } } } } } } }, "/fyi/deliveryoptions/{deviceId}": { "delete": { "summary": "Delete a device", "tags": [ "FYI" ], "parameters": [ { "name": "deviceId", "in": "path", "type": "string", "required": true, "description": "device ID" } ], "responses": { "200": { "description": "200 means successful", "schema": { "type": "object" } } } } }, "/fyi/notifications": { "get": { "summary": "Get a list of notifications", "tags": [ "FYI" ], "parameters": [ { "name": "exclude", "in": "query", "type": "string", "description": "if set, don't set include" }, { "name": "include", "in": "query", "type": "string", "description": "if set, don't set exclude" }, { "name": "max", "in": "query", "required": true, "type": "string", "description": "max number of fyis in response" } ], "responses": { "200": { "description": "An array", "schema": { "$ref": "#/definitions/notifications" } } } } }, "/fyi/notifications/more": { "get": { "summary": "Get more notifications based on a certain one", "tags": [ "FYI" ], "parameters": [ { "name": "id", "in": "query", "required": true, "type": "string", "description": "id of last notification in the list" } ], "responses": { "200": { "description": "An array", "schema": { "$ref": "#/definitions/notifications" } } } } }, "/fyi/notifications/{notificationId}": { "put": { "summary": "Get a list of notifications", "tags": [ "FYI" ], "parameters": [ { "name": "notificationId", "in": "path", "required": true, "type": "string", "description": "mark a notification read" } ], "responses": { "200": { "description": "when 200 receives, it means successful", "schema": { "type": "object" } } } } }, "/trsrv/secdef": { "post": { "summary": "Secdef by Conid", "description": "Returns a list of security definitions for the given conids", "tags": [ "Contract" ], "parameters": [ { "in": "body", "name": "body", "description": "request body", "required": true, "schema": { "type": "object", "properties": { "conids": { "type": "array", "items": { "type": "integer", "description": "contract id" } } } } } ], "responses": { "200": { "description": "returns an array of secdef info", "schema": { "$ref": "#/definitions/secdef" } } } } }, "/trsrv/secdef/schedule": { "get": { "summary": "Get trading schedule for symbol", "description": "Returns the trading schedule up to a month for the requested contract", "tags": [ "Contract" ], "parameters": [ { "in": "query", "name": "assetClass", "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", "required": true, "type": "string" }, { "in": "query", "name": "symbol", "description": "Underlying Symbol for specified contract, for example 'AAPL' for US Stock - Apple Inc.", "required": true, "type": "string" }, { "in": "query", "name": "exchange", "description": "Native exchange for contract, for example 'NASDAQ' for US Stock - Apple Inc.", "required": false, "type": "string" }, { "in": "query", "name": "exchangeFilter", "description": "Response only returns trading schedule for specified exchange", "required": false, "type": "string" } ], "responses": { "200": { "description": "Returns an object", "schema": { "type": "object", "properties": { "id": { "description": "Exchange parameter id", "type": "string" }, "tradeVenueId": { "description": "Reference on a trade venue of given exchange parameter", "type": "string" }, "schedules": { "description": "Always contains at least one 'tradingTime' and zero or more 'sessionTime' tags", "type": "array", "items": { "type": "object", "properties": { "clearingCycleEndTime": { "type": "integer" }, "tradingScheduleDate": { "type": "integer", "description": "20000101 stands for any Sat, 20000102 stands for any Sun, ... 20000107 stands for any Fri. Any other date stands for itself." }, "sessions": { "type": "object", "description": "If the LIQUID hours differs from the total trading day then a separate 'session' tag is returned.", "properties": { "openingTime": { "type": "integer" }, "closingTime": { "type": "integer" }, "prop": { "type": "string", "description": "If the whole trading day is considered LIQUID then the value 'LIQUID' is returned." } } }, "tradingTimes": { "description": "Returns tradingTime in exchange time zone.", "type": "object", "properties": { "openingTime": { "type": "integer" }, "closingTime": { "type": "integer" }, "cancelDayOrders": { "type": "string" } } } } } } } } } } } }, "/trsrv/futures": { "get": { "summary": "Security Futures by Symbol", "description": "Returns a list of non-expired future contracts for given symbol(s)", "tags": [ "Contract" ], "parameters": [ { "in": "query", "name": "symbols", "description": "list of case-sensitive symbols separated by comma", "required": true, "type": "string" } ], "responses": { "200": { "description": "returns an object with symbol and and array of its future contracts", "schema": { "type": "object", "properties": { "symbol": { "$ref": "#/definitions/futures" } } } }, "500": { "description": "error while processing the request", "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } } }, "/trsrv/stocks": { "get": { "summary": "Security Stocks by Symbol", "description": "Returns an object contains all stock contracts for given symbol(s)", "tags": [ "Contract" ], "parameters": [ { "in": "query", "name": "symbols", "description": "list of upper-sensitive symbols separated by comma", "required": true, "type": "string" } ], "responses": { "200": { "description": "returns an object with symbols", "schema": { "type": "object", "properties": { "symbol": { "$ref": "#/definitions/stocks" } } } }, "500": { "description": "error while processing the request", "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } } }, "/ws": { "post": { "summary": "Websocket Endpoint", "description": "The streaming API is documented under [Streaming WebSocket Data](https://interactivebrokers.github.io/cpwebapi/RealtimeSubscription.html) for details.", "tags": [ "Streaming" ], "responses": { "200": { "description": "confirms session is open" } } } }, "/tickle": { "post": { "summary": "Ping the server to keep the session open", "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.", "tags": [ "Session" ], "responses": { "200": { "description": "confirms session is open" } } } }, "/logout": { "post": { "summary": "Ends the current session", "description": "Logs the user out of the gateway session. Any further activity requires re-authentication.", "tags": [ "Session" ], "responses": { "200": { "description": "returned status indicates if user is logged in", "schema": { "type": "object", "properties": { "confirmed": { "description": "true means username is still logged in, false means it is not", "type": "boolean" } } } } } } }, "/ccp/auth/init": { "post": { "summary": "Start CCP Session", "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.", "tags": [ "CCP (Beta)" ], "consumes": [ "application/x-www-form-urlencoded" ], "parameters": [ { "in": "formData", "name": "compete", "type": "boolean", "description": "Allow competing CCP session to run" }, { "in": "formData", "name": "locale", "type": "string", "description": "Concatenate value for language and region, set to \"en_US\"" }, { "in": "formData", "name": "mac", "type": "string", "description": "Local MAC Address" }, { "in": "formData", "name": "machineId", "type": "string", "description": "Local machine ID" }, { "in": "formData", "name": "username", "type": "string", "description": "Login user, set to dash \"-\"" } ], "responses": { "500": { "description": "System error" }, "401": { "description": "Access denied" }, "200": { "description": "Returns challenge for connection", "schema": { "type": "object", "properties": { "challenge": { "description": "Challenge in hex format" } } } } } } }, "/hmds/history": { "get": { "summary": "Market Data History (Beta)", "description": "Using a direct connection to the market data farm, will provide a list of historical market data for given conid.", "tags": [ "Market Data" ], "parameters": [ { "in": "query", "name": "conid", "description": "contract id", "required": true, "type": "integer" }, { "in": "query", "name": "period", "enum": [ "min", "h", "d", "w", "m", "y" ], "description": "Time period for history request. \n * min: Minutes\n * h: Hours\n * d: Days\n * w: Weeks\n * m: Months\n * y: Years\n", "required": true, "type": "string" }, { "in": "query", "name": "bar", "enum": [ "min", "h", "d", "w", "m" ], "description": "Duration of time for each candlestick bar.\n * min: Minutes\n * h: Hours\n * d: Days\n * w: Weeks\n * m: Months\n", "required": false, "type": "string" }, { "in": "query", "name": "outsideRth", "description": "For contracts that support it, will determine if history data includes outside of regular trading hours.", "required": false, "type": "boolean" } ], "responses": { "400": { "description": "Bad request" }, "200": { "description": "Valid result", "schema": { "$ref": "#/definitions/history-result" } } } } }, "/ccp/auth/response": { "post": { "summary": "Complete CCP Session", "description": "Session Token Authentication", "tags": [ "CCP (Beta)" ], "parameters": [ { "in": "body", "name": "auth", "schema": { "type": "object", "properties": { "response": { "type": "string" } } } } ], "responses": { "500": { "description": "System error" }, "401": { "description": "Access denied" }, "200": { "description": "Valid result", "schema": { "type": "object", "properties": { "passed": { "type": "boolean", "description": "If sso authentication completed" }, "authenticated": { "type": "boolean", "description": "If connection is authenticated" }, "connected": { "type": "boolean", "description": "Connected to CCP session" }, "competing": { "type": "boolean", "description": "If user already has an existing brokerage session running." } } } } } } }, "/ccp/status": { "get": { "summary": "CCP Status", "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.", "tags": [ "CCP (Beta)" ], "responses": { "500": { "description": "System error" }, "401": { "description": "Access denied" }, "200": { "description": "Valid result", "schema": { "type": "object", "properties": { "authenticated": { "type": "boolean", "description": "Login session is authenticated to the CCP." }, "connected": { "type": "boolean", "description": "Login session is connected" }, "name": { "type": "string", "description": "server name" } } } } } } }, "/ccp/account": { "get": { "summary": "Brokerage Accounts", "description": "Provides the list of tradeable accounts", "tags": [ "CCP (Beta)" ], "responses": { "200": { "description": "An array of accounts", "schema": { "type": "object", "properties": { "mainAcct": { "type": "string", "description": "The primary or parent account." }, "acctList": { "type": "array", "description": "List of tradeable or Sub Accounts", "items": { "type": "object", "properties": { "0": { "type": "string", "description": "For multi-account structures each trading account will numbered from 0 to ..." } } } } } } } } } }, "/ccp/positions": { "get": { "summary": "Positions", "description": "List of positions", "tags": [ "CCP (Beta)" ], "responses": { "500": { "description": "System error" }, "401": { "description": "Access denied" }, "200": { "description": "Valid result", "schema": { "$ref": "#/definitions/position-data" } } } } }, "/ccp/orders": { "get": { "summary": "Order Status", "description": "Get status for all orders", "tags": [ "CCP (Beta)" ], "parameters": [ { "name": "acct", "in": "query", "required": true, "description": "User Account", "type": "string" }, { "name": "cancelled", "in": "query", "required": false, "description": "Return only Rejected or Cancelled orders since today midnight", "type": "boolean" } ], "responses": { "500": { "description": "System error" }, "400": { "description": "Bad request" }, "401": { "description": "Access denied" }, "200": { "description": "An Object", "schema": { "type": "object", "properties": { "orders": { "type": "array", "items": { "$ref": "#/definitions/order-data" } } } } } } } }, "/ccp/order": { "post": { "summary": "Submit Order", "description": "Submits an Order.\n", "tags": [ "CCP (Beta)" ], "parameters": [ { "name": "acct", "in": "query", "required": true, "description": "User Account", "type": "string" }, { "name": "conid", "in": "query", "required": true, "description": "Contract identifier from IBKR's database.", "type": "number" }, { "name": "ccy", "in": "query", "required": true, "description": "Contract Currency", "type": "string", "enum": [ "USD", "GBP", "EUR" ] }, { "name": "exchange", "in": "query", "required": true, "description": "Exchange", "type": "string", "enum": [ "NYSE", "CBOE", "NYMEX" ] }, { "name": "qty", "in": "query", "required": true, "description": "Order Quantity", "type": "number" }, { "name": "type", "in": "query", "required": false, "description": "Order Price; required if order type is limit", "type": "string", "enum": [ "limit", "market" ] }, { "name": "side", "in": "query", "required": false, "description": "Side", "type": "string", "enum": [ "sell", "buy" ] }, { "name": "price", "in": "query", "required": false, "description": "Order Price; required if order type is limit", "type": "number" }, { "name": "tif", "in": "query", "required": false, "description": "Time in Force", "type": "string", "enum": [ "IOC", "GTC" ] } ], "consumes": [ "application/json" ], "responses": { "500": { "description": "System error, for example when connection to CCP failed" }, "400": { "description": "Bad Request" }, "401": { "description": "Access denied" }, "200": { "description": "An Object", "schema": { "$ref": "#/definitions/order-data" } } } }, "delete": { "summary": "Delete Order", "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", "tags": [ "CCP (Beta)" ], "parameters": [ { "name": "acct", "in": "query", "required": true, "description": "Account Number", "type": "string" }, { "name": "id", "in": "query", "required": true, "description": "Order Identifier of original submit order", "type": "number" } ], "consumes": [ "application/json" ], "responses": { "500": { "description": "System error, for example when connection to CCP failed" }, "401": { "description": "Access denied" }, "200": { "description": "An Object", "schema": { "$ref": "#/definitions/order-data" } } } }, "put": { "summary": "Update Order", "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", "tags": [ "CCP (Beta)" ], "parameters": [ { "name": "acct", "in": "query", "required": true, "description": "User Account", "type": "string" }, { "name": "id", "in": "query", "required": true, "description": "Order ID to be modified", "type": "number" } ], "consumes": [ "application/json" ], "responses": { "500": { "description": "System error, for example when connection to CCP failed" }, "401": { "description": "Access denied" }, "200": { "description": "An Object", "schema": { "$ref": "#/definitions/order-data" } } } } }, "/ccp/trades": { "get": { "summary": "Trades", "description": "Get a list of Trades, by default, the list is from today midnight to Date.now().\n", "tags": [ "CCP (Beta)" ], "parameters": [ { "name": "from", "in": "query", "required": false, "description": "From Date (YYYYMMDD-HH:mm:ss) or offset (-1,-2,-3..)", "type": "string" }, { "name": "to", "in": "query", "required": false, "description": "To Date (YYYYMMDD-HH:mm:ss) or offset (-1,-2,-3..). To value should be bigger than from value.\n", "type": "string" } ], "responses": { "500": { "description": "System error" }, "400": { "description": "Bad request" }, "401": { "description": "Access denied" }, "200": { "description": "An Object", "schema": { "type": "object", "properties": { "orders": { "type": "array", "items": { "$ref": "#/definitions/order-data" } } } } } } } }, "/sso/validate": { "get": { "summary": "Validate SSO", "description": "Validates the current session for the SSO user", "tags": [ "Session" ], "responses": { "500": { "description": "System failed" }, "401": { "description": "Authentication failed" }, "200": { "description": "An Object", "schema": { "type": "object", "properties": { "LOGIN_TYPE": { "description": "1 for Live, 2 for Paper", "type": "number" }, "USER_NAME": { "description": "Username", "type": "string" }, "USER_ID": { "description": "User ID", "type": "number" }, "expire": { "description": "Time in milliseconds until session expires. Caller needs to call the again to re-validate session", "type": "number" }, "RESULT": { "description": "true if session was validated; false if not.", "type": "boolean" }, "AUTH_TIME": { "description": "Time of session validation", "type": "number" } } } } } } }, "/hmds/scanner": { "post": { "summary": "Run Scanner (Beta)", "description": "Using a direct connection to the market data farm, will provide results to the requested scanner.", "tags": [ "Scanner" ], "parameters": [ { "in": "body", "name": "body", "description": "request body", "required": true, "schema": { "type": "object", "properties": { "instrument": { "type": "string", "example": "BOND.GOVT" }, "locations": { "type": "string", "example": "BOND.GOVT.US" }, "scanCode": { "type": "string", "example": "FAR_MATURITY_DATE" }, "secType": { "type": "string", "example": "BOND" }, "filters": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string", "example": "bondValidNetBidOrAskOnly" }, "value": { "description": "Value can be either an integer, double, boolean or a string depending upon the type of filter specified in the code section", "example": true } } } } } } } ], "responses": { "400": { "description": "Bad request" }, "200": { "description": "Valid result", "schema": { "$ref": "#/definitions/scanner-result" } } } } }, "/md/snapshot": { "get": { "summary": "Market Data Snapshot (Beta)", "description": "Get a snapshot of Market Data for the given conid(s).See response for a list of available fields that can be requested from the fields argument.\nMust be connected to a brokerage session before can query snapshot data.\nFirst /snapshot endpoint call for given conid(s) will initiate the market data request, make an additional request to receive field values back.\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", "tags": [ "Market Data" ], "parameters": [ { "name": "conids", "in": "query", "required": true, "enum": [ "conid@exchange:instrType" ], "description": "List of conids comma separated. Optional exchange and instrument type can be specified.\n * conid: IBKR Contract Identifier\n * exchange: Exchange or venue\n * instrType: Instrument Type supported values: CS (Stocks), OPT (Options), FUT (Futures), FOP (Future Options), WAR (Warrants), BOND (Bonds), FUND (Mutual Funds), CASH (Forex), CFD (Contract for difference), IND (Index)\n", "type": "string" }, { "name": "fields", "in": "query", "type": "string", "description": "list of fields separated by comma", "example": [ 31, 84, 85, 86, 88 ] } ], "responses": { "500": { "description": "System failed" }, "401": { "description": "Authentication failed" }, "200": { "description": "An Object", "schema": { "$ref": "#/definitions/market-data" } } } } }, "/pa/performance": { "post": { "summary": "Account Performance", "description": "Returns the performance (MTM) for the given accounts, if more than one account is passed, the result is consolidated.", "tags": [ "PortfolioAnalyst" ], "parameters": [ { "in": "body", "name": "body", "description": "an array of account ids", "required": true, "schema": { "type": "object", "properties": { "acctIds": { "type": "array", "items": { "type": "string", "description": "account id" } }, "freq": { "type": "string", "enum": [ "D", "M", "Q" ], "description": "Frequency of cumulative performance data points: 'D'aily, 'M'onthly,'Q'uarterly.\n" } } } } ], "responses": { "200": { "description": "returns an object", "schema": { "$ref": "#/definitions/performance" } } } } }, "/pa/summary": { "post": { "summary": "Account Balance's Summary (Deprecated)", "deprecated": true, "description": "This endpoint is going to be deprecated. Please use /pa/performance instead.\nReturns a summary of all account balances for the given accounts, if more than one account is passe, the result is consolidated.", "tags": [ "PortfolioAnalyst" ], "parameters": [ { "in": "body", "name": "body", "description": "an array of account ids", "required": true, "schema": { "type": "object", "properties": { "acctIds": { "type": "array", "items": { "type": "string", "description": "account id" } } } } } ], "responses": { "200": { "description": "returns an object", "schema": { "$ref": "#/definitions/summary" } } } } }, "/pa/transactions": { "post": { "summary": "Position's Transaction History", "description": "transaction history for a given number of conids and accounts.\nTypes of transactions include dividend payments, buy and sell transactions, transfers.\n", "tags": [ "PortfolioAnalyst" ], "parameters": [ { "in": "body", "name": "body", "required": true, "schema": { "type": "object", "properties": { "acctIds": { "type": "array", "items": { "type": "string", "description": "account id" } }, "conids": { "type": "array", "items": { "type": "number", "description": "array only supports one conid at a time." } }, "currency": { "type": "string", "example": "USD", "description": "optional defaults to USD." }, "days": { "type": "number", "example": 7, "description": "optional, default value is 90" } } } } ], "responses": { "200": { "description": "returns an object", "schema": { "$ref": "#/definitions/transactions" } } } } }, "/portfolio/accounts": { "get": { "summary": "Portfolio Accounts", "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.", "tags": [ "Account", "Portfolio" ], "responses": { "200": { "description": "An array", "schema": { "$ref": "#/definitions/accounts" } } } } }, "/portfolio/subaccounts": { "get": { "summary": "List of Sub-Accounts", "description": "Used in tiered account structures (such as Financial Advisor and IBroker Accounts) to return a list of up to 100 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 sub-accounts. If you have more than 100 sub-accounts use /portfolio/subaccounts2. To query a list of accounts the user can trade, see /iserver/accounts.", "tags": [ "Account", "Portfolio" ], "responses": { "200": { "description": "An array", "schema": { "$ref": "#/definitions/account" } } } } }, "/portfolio/subaccounts2": { "get": { "summary": "List of Sub-Accounts (Large Accounts)", "description": "Used in tiered account structures (such as Financial Advisor and IBroker Accounts) to return a list of sub-accounts, paginated up to 20 accounts per page, for which the user can view position and account-related information. This endpoint must be called prior to calling other /portfolio endpoints for those sub-accounts. If you have less than 100 sub-accounts use /portfolio/subaccounts. To query a list of accounts the user can trade, see /iserver/accounts.", "tags": [ "Account", "Portfolio" ], "parameters": [ { "name": "page", "in": "path", "required": true, "type": "string", "default": "0" } ], "responses": { "200": { "description": "An object containing an array", "schema": { "type": "object", "properties": { "metadata": { "type": "object", "properties": { "total": { "type": "number", "description": "Number of sub-accounts" }, "pageSize": { "type": "number", "description": "How many sub-accounts are returned for the page requested. A max of 20 per page." }, "pageNume": { "type": "number", "description": "Current page number." } } }, "subaccounts": { "type": "array", "items": { "type": "object", "description": "Account information", "properties": { "id": { "type": "string", "description": "The account identification value" }, "accountId": { "type": "string", "description": "The account number", "example": "U12345678 for Individual Live Accounts, DU12345678 for Individual Paper Accounts" }, "accountVan": { "type": "string", "description": "The accountAlias" }, "accountTitle": { "type": "string", "description": "Title of the account" }, "displayName": { "type": "string", "description": "Whichever value is not null in this priority", "enum": [ "accountTitle", "accountVan", "accountId" ] }, "accountAlias": { "type": "string", "description": "User customizable account alias. Refer to [Configure Account Alias](https://guides.interactivebrokers.com/cp/cp.htm#am/settings/accountalias.htm) for details." }, "accountStatus": { "type": "number", "description": "When the account was opened in unix time." }, "currency": { "type": "string", "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": { "type": "string", "description": "Account Type", "enum": [ "INDIVIDUAL", "JOINT", "ORG", "TRUST", "DEMO" ] }, "tradingType": { "type": "string", "description": "UNI - Deprecated property" }, "faclient": { "type": "boolean", "description": "If an account is a sub-account to a Financial Advisor." }, "clearingStatus": { "type": "string", "enum": [ "O", "P", "N", "A", "R", "C" ], "description": "Status of the Account\n * O = Open\n * P or N = Pending\n * A = Abandoned\n * R = Rejected\n * C = Closed\n covestor:\n type: boolean\n description: Is a Covestor Account\n parent:\n type: object\n properties:\n mmc:\n type: array\n items:\n type: string\n description: Money Manager Client (MMC) Account\n accountId:\n type: string\n description: Account Number for Money Manager Client\n isMParent:\n type: boolean\n description: Is MM a Parent Account\n isMChild:\n type: boolean\n description: Is MM a Child Account\n isMultiplex:\n type: boolean\n description: Is a Multiplex Account. These are account models with individual account being parent and managed account being child.\n desc:\n type: string\n description: Formatted \"accountId - accountAlias\"\n" } } } } } } } } } }, "/portfolio/{accountId}/meta": { "get": { "summary": "Account Information", "description": "Account information related to account Id /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint.", "tags": [ "Account", "Portfolio" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" } ], "responses": { "200": { "description": "An object", "schema": { "$ref": "#/definitions/accounts" } } } } }, "/portfolio/{accountId}/allocation": { "get": { "summary": "Account Allocation", "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.", "tags": [ "Portfolio" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" } ], "responses": { "200": { "description": "returns an object of three different allocations", "schema": { "$ref": "#/definitions/allocation" } } } } }, "/portfolio/allocation": { "post": { "summary": "Account Alloction (All Accounts)", "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.", "tags": [ "Portfolio" ], "parameters": [ { "in": "body", "name": "body", "description": "accounts info", "required": true, "schema": { "type": "object", "properties": { "acctIds": { "type": "array", "items": { "type": "string", "description": "account id" } } } } } ], "responses": { "200": { "description": "returns an object of three different allocations", "schema": { "$ref": "#/definitions/allocation" } } } } }, "/portfolio/{accountId}/positions/{pageId}": { "get": { "summary": "Portfolio Positions", "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.", "tags": [ "Portfolio" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" }, { "name": "pageId", "in": "path", "required": true, "type": "string", "default": "0", "description": "page id" }, { "name": "model", "in": "query", "type": "string", "description": "optional" }, { "name": "sort", "in": "query", "type": "string", "description": "declare the table to be sorted by which column" }, { "name": "direction", "in": "query", "type": "string", "description": "in which order, a means ascending - d means descending" }, { "name": "period", "in": "query", "type": "string", "description": "period for pnl column, can be 1D, 7D, 1M..." } ], "responses": { "200": { "description": "returns a list of positions in the portfolio", "schema": { "$ref": "#/definitions/position" } } } } }, "/portfolio/{accountId}/position/{conid}": { "get": { "summary": "Position by Conid", "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.", "tags": [ "Portfolio" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" }, { "name": "conid", "in": "path", "required": true, "type": "integer", "description": "contract id" } ], "responses": { "200": { "description": "returns a list containing only one position for the conid", "schema": { "$ref": "#/definitions/position" } } } } }, "/portfolio/{accountId}/positions/invalidate": { "post": { "summary": "Invalidates the backend cache of the Portfolio", "tags": [ "Portfolio" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" } ], "responses": { "200": { "description": "Means successful", "schema": { "type": "object" } } } } }, "/portfolio/{accountId}/summary": { "get": { "summary": "Account Summary", "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.", "tags": [ "Account", "Portfolio" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" } ], "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": { "type": "object", "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" } } } } } } }, "/portfolio/{accountId}/ledger": { "get": { "summary": "Account Ledger", "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.", "tags": [ "Account", "Portfolio" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" } ], "responses": { "200": { "description": "200 means successful", "schema": { "type": "object", "properties": { "BASE": { "$ref": "#/definitions/ledger" } } } } } } }, "/portfolio/positions/{conid}": { "get": { "summary": "Positions by Conid", "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.", "tags": [ "Portfolio" ], "parameters": [ { "name": "conid", "in": "path", "required": true, "type": "integer", "description": "contract id" } ], "responses": { "200": { "description": "returns an object containing account and its position information", "schema": { "type": "object", "properties": { "ACCTID": { "$ref": "#/definitions/position" } } } } } } }, "/iserver/auth/status": { "post": { "summary": "Authentication Status", "description": "Current Authentication status to the Brokerage system. Market Data and Trading is not possible if not authenticated, e.g. authenticated shows false", "tags": [ "Session" ], "responses": { "200": { "description": "Authentication Status", "schema": { "$ref": "#/definitions/authStatus" } } } } }, "/iserver/reauthenticate": { "post": { "summary": "Tries to re-authenticate to Brokerage", "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", "tags": [ "Session" ], "responses": { "200": { "description": "Authentication Status", "schema": { "$ref": "#/definitions/authStatus" } } } } }, "/iserver/account/trades": { "get": { "summary": "List of Trades for the selected account", "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", "tags": [ "Trades" ], "responses": { "200": { "description": "An array of trades", "schema": { "type": "array", "items": { "$ref": "#/definitions/trade" } } } } } }, "/iserver/accounts": { "get": { "summary": "Brokerage Accounts", "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.", "tags": [ "Account" ], "responses": { "200": { "description": "An array of accounts", "schema": { "type": "object", "properties": { "accounts": { "type": "array", "items": { "type": "string" }, "description": "Unique account id" }, "aliases": { "type": "object", "description": "Account Id and its alias" }, "selectedAccount": { "type": "string" } } } } } } }, "/iserver/account": { "post": { "summary": "Switch Account", "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.", "tags": [ "Account" ], "parameters": [ { "in": "body", "name": "body", "required": true, "description": "account id", "schema": { "$ref": "#/definitions/set-account" } } ], "responses": { "200": { "description": "an object containing updated account ID", "schema": { "type": "object", "properties": { "set": { "type": "boolean" }, "acctId": { "type": "string" } } } } } } }, "/iserver/account/{accountId}/alert": { "post": { "summary": "Create or modify alert", "description": "Please note here, DO NOT pass orderId when creating a new alert, toolId is only required for MTA alert\n", "tags": [ "Alert" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" }, { "in": "body", "name": "body", "description": "alert info", "required": true, "schema": { "$ref": "#/definitions/alert-request" } } ], "responses": { "200": { "description": "returns an object", "schema": { "type": "object", "properties": { "request_id": { "type": "integer" }, "order_id": { "type": "integer" }, "success": { "type": "boolean" }, "text": { "type": "string" }, "order_status": { "type": "string" }, "warning_message": { "type": "string" } } } } } } }, "/iserver/account/:accountId/alerts": { "get": { "summary": "Get a list of available alerts", "description": "The response will contain both active and inactive alerts, but it won't have MTA alert", "tags": [ "Alert" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" } ], "responses": { "200": { "description": "returns an array of objects", "schema": { "type": "array", "items": { "type": "object", "properties": { "order_id": { "type": "integer" }, "account": { "type": "string", "description": "account id" }, "alert_name": { "type": "string" }, "alert_active": { "type": "integer", "description": "Value can only be 0 or 1, 1 means active" }, "order_time": { "type": "string", "description": "format, YYYYMMDD-HH:mm:ss, the time when you created the alert\n" }, "alert_triggered": { "type": "boolean", "description": "whether the alert has been triggered or not" }, "alert_repeatable": { "type": "integer", "description": "whether the alert can be repeatable or not, value can be 1 or 0. 1 means true" } } } } } } } }, "/iserver/account/:accountId/alert/activate": { "post": { "summary": "Activate or deactivate an alert", "description": "Please note, if alertId is 0, it will activate/deactivate all alerts", "tags": [ "Alert" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" }, { "in": "body", "name": "body", "description": "order request info", "required": true, "schema": { "type": "object", "properties": { "alertId": { "description": "alert id(order id)", "type": "integer" }, "alertActive": { "description": "1 to activate, 0 to deactivate", "type": "integer" } } } } ], "responses": { "200": { "description": "returns an object", "schema": { "type": "object", "properties": { "request_id": { "type": "integer" }, "order_id": { "type": "integer" }, "success": { "type": "boolean" }, "text": { "type": "string" }, "order_status": { "type": "string" }, "failure_list": { "type": "string" } } } } } } }, "/iserver/account/:accountId/alert/:alertId": { "delete": { "summary": "Delete an alert", "description": "Please be careful, if alertId is 0, it will delete all alerts", "tags": [ "Alert" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" }, { "name": "alertId", "in": "path", "required": true, "type": "string", "description": "alert id" } ], "responses": { "200": { "description": "returns an object", "schema": { "type": "object", "properties": { "request_id": { "type": "integer" }, "order_id": { "type": "integer" }, "success": { "type": "boolean" }, "text": { "type": "string" }, "order_status": { "type": "string" }, "failure_list": { "type": "string" } } } } } } }, "/iserver/account/alert/:id": { "get": { "summary": "Get details of an alert", "description": "Use the endpoint /iserver/account/:accountId/alerts to receive the alert id.\nThe order_id in the response is the alert id.\n", "tags": [ "Alert" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "string", "description": "alert id" } ], "responses": { "200": { "description": "returns an object", "schema": { "$ref": "#/definitions/alert-response" } } } } }, "/iserver/account/mta": { "get": { "summary": "Get MTA alert", "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", "tags": [ "Alert" ], "responses": { "200": { "description": "returns an object", "schema": { "$ref": "#/definitions/alert-response" } } } } }, "/iserver/account/orders": { "get": { "summary": "Live Orders", "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", "tags": [ "Order" ], "parameters": [ { "in": "query", "name": "Filters", "description": "list of filters separated by comma", "required": false, "type": "string" } ], "responses": { "200": { "description": "An object contains two arrays", "schema": { "type": "object", "properties": { "filters": { "type": "array", "items": { "type": "string", "enum": [ "inactive", "pending_submit", "pre_submitted", "submitted", "filled", "pending_cancel", "cancelled", "warn_state", "sort_by_time" ], "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" } }, "orders": { "type": "array", "items": { "type": "object", "properties": { "acct": { "type": "string", "description": "Account number" }, "conidex": { "type": "string", "description": "conid and exchange. Format supports conid or conid@exchange" }, "conid": { "type": "number", "description": "Contract identifier" }, "orderId": { "type": "string", "description": "Order identifier" }, "cashCcy": { "type": "string", "description": "Cash currency" }, "sizeAndFills": { "type": "string", "description": "Quantity outstanding and total quantity concatenated with forward slash separator" }, "orderDesc": { "type": "string", "description": "Order description" }, "description1": { "type": "string", "description": "Formatted ticker description" }, "ticker": { "type": "string", "description": "Underlying symbol" }, "secType": { "type": "string", "description": "Asset class" }, "listingExchange": { "type": "string", "description": "Listing Exchange" }, "remainingQuantity": { "type": "number", "description": "Quantity remaining" }, "filledQuantity": { "type": "number", "description": "Quantity filled" }, "companyName": { "type": "string", "description": "Company Name" }, "status": { "type": "string", "description": "Status of the order" }, "origOrderType": { "type": "string", "description": "Original order type" }, "supportsTaxOpt": { "type": "number", "description": "Supports Tax Optimization with 0 for no and 1 for yes" }, "lastExecutionTime": { "type": "number", "description": "Last status update in format YYMMDDhhmms based in GMT" }, "lastExecutionTime_r": { "type": "number", "description": "Last status update unix time in ms" }, "orderType": { "type": "string", "description": "Order type" }, "order_ref": { "type": "string", "description": "Order reference" }, "side": { "type": "string", "enum": [ "BUY", "SELL", "ASSN", "EXER" ], "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" }, "timeInForce": { "type": "string", "description": "Time in force" }, "price": { "type": "number", "description": "Price of order" }, "bgColor": { "type": "string", "description": "Background color in hex format" }, "fgColor": { "type": "string", "description": "Foreground color in hex format" } } } }, "snapshot": { "type": "boolean", "description": "If live order update is a snapshot" } } } } } } }, "/iserver/account/{accountId}/order": { "post": { "summary": "Place Order (Deprecated)", "deprecated": true, "description": "This endpoint 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", "tags": [ "Order" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" }, { "in": "body", "name": "body", "description": "order request info", "required": true, "schema": { "$ref": "#/definitions/order-request" } } ], "responses": { "200": { "description": "returns an array", "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "message": { "type": "array", "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" } } } } } } } } }, "/iserver/account/{accountId}/orders": { "post": { "summary": "Place Orders", "description": "When connected to an IServer Brokerage Session, this endpoint will allow you to submit orders. \nCP WEB API supports various advanced orderTypes, for additional details and examples refer to [IBKR Quant Blog](https://www.tradersinsight.news/category/ibkr-quant-news/programming_languages/rest-development/).\n * Bracket - Attach additional opposite-side order(s) by using a single **cOID** sent with the parent and set the same value for **parentId** in each child order(s).\n * Cash Quantity - Send orders using monetary value by specifying **cashQty** instead of quantity, e.g. cashQty: 200. The endpoint /iserver/contract/rules returns list of valid orderTypes in cqtTypes.\n * Currency Conversion - Convert cash from one currency to another by including **isCcyConv** = **true**. To specify the cash quantity use **fxQTY** instead of quantity, e.g. fxQTY: 100.\n * Fractional - Contracts that support fractional shares can be traded by specifying **quantity** as a float, e.g. quantity: 0.001. The endpoint /iserver/contract/rules returns a list of valid orderTypes in fraqTypes.\n * IB Algos - Attached user-defined settings to your trades by using any of IBKR's Algo Orders. Use the endpoint /iserver/contract/{conid}/algos to identify the available strategies for a contract.\n * One-Cancels-All (OCA) - Group multiple unrelated orders by passing order request info in an array and including **isSingleGroup = true** for each order. All orders will be assigned the same oca_group_id.\n", "tags": [ "Order" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" }, { "in": "body", "name": "body", "description": "order request info", "required": true, "schema": { "type": "object", "properties": { "orders": { "type": "array", "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" } } } } } ], "responses": { "200": { "description": "returns an array", "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "message": { "type": "array", "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" } } } } } } } } }, "/iserver/account/orders/{faGroup}": { "post": { "summary": "Place Orders for FA", "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", "tags": [ "Order" ], "parameters": [ { "name": "faGroup", "in": "path", "required": true, "type": "string", "description": "financial advisor group" }, { "in": "body", "name": "body", "description": "order request info", "required": true, "schema": { "$ref": "#/definitions/order-request" } } ], "responses": { "200": { "description": "returns an array", "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "message": { "type": "array", "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" } } } } } } } } }, "/iserver/reply/{replyid}": { "post": { "summary": "Place Order Reply", "description": "Reply to questions when placing orders and submit orders", "tags": [ "Order" ], "parameters": [ { "name": "replyid", "in": "path", "required": true, "type": "string", "description": "Please use the \"id\" from the response of \"Place Order\" endpoint" }, { "in": "body", "name": "body", "description": "Answer to question", "required": true, "schema": { "type": "object", "properties": { "confirmed": { "description": "answer to question, true means yes, false means no", "type": "boolean" } } } } ], "responses": { "200": { "description": "Order is submitted successfully, returns an array contains one object", "schema": { "type": "array", "items": { "type": "object", "properties": { "order_id": { "type": "string" }, "order_status": { "type": "string" }, "local_order_id": { "type": "string" } } } } }, "400": { "description": "When you send \"confirmed-false\" in the request, you will receive this", "schema": { "type": "object", "properties": { "error": { "description": "for example-order not confirmed", "type": "string" }, "statusCode": { "type": "integer" } } } } } } }, "/iserver/account/{accountId}/order/whatif": { "post": { "summary": "Preview Order (Deprecated)", "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", "tags": [ "Order" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" }, { "in": "body", "name": "body", "description": "order info", "required": true, "schema": { "$ref": "#/definitions/order-request" } } ], "responses": { "200": { "description": "returns an object", "schema": { "type": "object", "properties": { "amount": { "type": "object", "properties": { "amount": { "type": "string", "description": "for example 23,000 USD" }, "commission": { "type": "string", "description": "for example 1.1 ... 1.2 USD" }, "total": { "type": "string" } } }, "equity": { "type": "object", "properties": { "current": { "type": "string" }, "change": { "type": "string" }, "after": { "type": "string" } } }, "initial": { "type": "object", "properties": { "current": { "type": "string" }, "change": { "type": "string" }, "after": { "type": "string" } } }, "maintenance": { "type": "object", "properties": { "current": { "type": "string" }, "change": { "type": "string" }, "after": { "type": "string" } } }, "warn": { "type": "string" }, "error": { "type": "string" } } } } } } }, "/iserver/account/{accountId}/orders/whatif": { "post": { "summary": "Preview Orders", "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", "tags": [ "Order" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id" }, { "in": "body", "name": "body", "description": "order info", "required": true, "schema": { "type": "object", "properties": { "orders": { "type": "array", "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" } } } } } ], "responses": { "200": { "description": "returns an object", "schema": { "type": "object", "properties": { "amount": { "type": "object", "properties": { "amount": { "type": "string", "description": "for example 23,000 USD" }, "commission": { "type": "string", "description": "for example 1.1 ... 1.2 USD" }, "total": { "type": "string" } } }, "equity": { "type": "object", "properties": { "current": { "type": "string" }, "change": { "type": "string" }, "after": { "type": "string" } } }, "initial": { "type": "object", "properties": { "current": { "type": "string" }, "change": { "type": "string" }, "after": { "type": "string" } } }, "maintenance": { "type": "object", "properties": { "current": { "type": "string" }, "change": { "type": "string" }, "after": { "type": "string" } } }, "warn": { "type": "string" }, "error": { "type": "string" } } } } } } }, "/iserver/account/order/status/{orderId}": { "get": { "summary": "Order Status", "tags": [ "Order" ], "parameters": [ { "name": "orderId", "in": "path", "description": "Customer order id, use /iservers/account/orders endpoint to query orderId.", "required": true, "type": "string" } ], "responses": { "200": { "description": "returns an object", "schema": { "$ref": "#/definitions/order-status" } } } } }, "/iserver/account/{accountId}/order/{orderId}": { "post": { "summary": "Modify Order", "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).", "tags": [ "Order" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id, or fa group if modifying a group order" }, { "in": "path", "name": "orderId", "description": "Customer order id, use /iservers/account/orders endpoint to query orderId.", "required": true, "type": "string" }, { "in": "body", "name": "body", "description": "modify-order request", "required": true, "schema": { "$ref": "#/definitions/modify-order" } } ], "responses": { "200": { "description": "returns an array", "schema": { "type": "array", "items": { "type": "object", "properties": { "order_id": { "type": "string" }, "local_order_id": { "type": "string" }, "order_status": { "type": "string" } } } } } } }, "delete": { "summary": "Cancel Order", "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.", "tags": [ "Order" ], "parameters": [ { "name": "accountId", "in": "path", "required": true, "type": "string", "description": "account id, or fa group if deleting a group order" }, { "in": "path", "name": "orderId", "description": "Customer order id, use /iservers/account/orders endpoint to query orderId.", "required": true, "type": "string" } ], "responses": { "200": { "description": "returns an object with order id, message, conid and account id", "schema": { "type": "object", "properties": { "order_id": { "type": "string" }, "msg": { "type": "string" }, "conid": { "type": "integer" }, "account": { "type": "string" } } } } } } }, "/iserver/marketdata/snapshot": { "get": { "summary": "Market Data", "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", "tags": [ "Market Data" ], "parameters": [ { "in": "query", "name": "conids", "description": "list of conids separated by comma", "required": true, "type": "string" }, { "in": "query", "name": "since", "description": "time period since which updates are required. uses epoch time with milliseconds.", "required": false, "type": "integer" }, { "in": "query", "name": "fields", "description": "list of fields separated by comma", "required": false, "type": "string" } ], "responses": { "200": { "description": "Returns an array of objects", "schema": { "type": "array", "items": { "type": "object", "properties": { "server_id": { "type": "string" }, "conid": { "type": "integer" }, "_updated": { "type": "integer" }, "31": { "type": "string", "description": "Last Price - The last price at which the contract traded. May contain one of the following prefixes:\n * C - Previous day's closing price.\n * H - Trading has halted.\n" }, "55": { "type": "string", "description": "Symbol" }, "58": { "type": "string", "description": "Text" }, "70": { "type": "string", "description": "High - Current day high price" }, "71": { "type": "string", "description": "Low - Current day low price" }, "73": { "type": "string", "description": "Market Value - The current market value of your position in the security. Market Value is calculated with real time market data (even when not subscribed to market data)." }, "74": { "type": "string", "description": "Avg Price - The average price of the position." }, "75": { "description": "Unrealized PnL - Unrealized profit or loss. Unrealized PnL is calculated with real time market data (even when not subscribed to market data).", "type": "string" }, "76": { "description": "Formatted position", "type": "string" }, "77": { "description": "Formatted Unrealized PnL", "type": "string" }, "78": { "description": "Daily PnL - Your profit or loss of the day since prior close. Daily PnL is calculated with real time market data (even when not subscribed to market data).", "type": "string" }, "79": { "description": "Realized PnL - Realized profit or loss. Realized PnL is calculated with real time market data (even when not subscribed to market data).", "type": "string" }, "80": { "description": "Unrealized PnL % - Unrealized profit or loss expressed in percentage.", "type": "string" }, "82": { "type": "string", "description": "Change - The difference between the last price and the close on the previous trading day" }, "83": { "type": "string", "description": "Change % - The difference between the last price and the close on the previous trading day in percentage." }, "84": { "type": "string", "description": "Bid Price - The highest-priced bid on the contract." }, "85": { "type": "string", "description": "Ask Size - The number of contracts or shares offered at the ask price. For US stocks, the number displayed is divided by 100." }, "86": { "type": "string", "description": "Ask Price - The lowest-priced offer on the contract." }, "87": { "type": "string", "description": "Volume - Volume for the day, formatted with 'K' for thousands or 'M' for millions. For higher precision volume refer to field 7762." }, "87_raw (deprecated)": { "type": "string", "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." }, "88": { "type": "string", "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." }, "6004": { "type": "string", "description": "Exchange" }, "6008": { "type": "integer", "description": "Conid - Contract identifier from IBKR's database." }, "6070": { "type": "string", "description": "SecType - The asset class of the instrument." }, "6072": { "type": "string", "description": "Months" }, "6073": { "type": "string", "description": "Regular Expiry" }, "6119": { "type": "string", "description": "Marker for market data delivery method (similar to request id)" }, "6457": { "type": "integer", "description": "Underlying Conid. Use /trsrv/secdef to get more information about the security" }, "6508": { "type": "string", "description": "Service Params." }, "6509": { "type": "string", "description": "Market Data Availability. The field may contain three chars. First char defines: R = RealTime, D = Delayed,\nZ = Frozen, Y = Frozen Delayed, N = Not Subscribed. Second char defines: P = Snapshot, p = Consolidated.\nThird char defines: B = Book\n * RealTime - Data is relayed back in real time without delay, market data subscription(s) are required.\n * Delayed - Data is relayed back 15-20 min delayed. \n * Frozen - Last recorded data at market close, relayed back in real time.\n * Frozen Delayed - Last recorded data at market close, relayed back delayed.\n * Not Subscribed - User does not have the required market data subscription(s) to relay back either real time or delayed data.\n * Snapshot - Snapshot request is available for contract.\n * Consolidated - Market data is aggregated across multiple exchanges or venues.\n * Book - Top of the book data is available for contract.\n" }, "7051": { "type": "string", "description": "Company name" }, "7057": { "type": "string", "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" }, "7058": { "type": "string", "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" }, "7059": { "type": "string", "description": "Last Size - The number of unites traded at the last price" }, "7068": { "type": "string", "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" }, "7084": { "type": "string", "description": "Implied Vol./Hist. Vol % - The ratio of the implied volatility over the historical volatility, expressed as a percentage." }, "7085": { "type": "string", "description": "Put/Call Interest - Put option open interest/call option open interest for the trading day." }, "7086": { "type": "string", "description": "Put/Call Volume - Put option volume/call option volume for the trading day." }, "7087": { "type": "string", "description": "Hist. Vol. % - 30-day real-time historical volatility." }, "7088": { "type": "string", "description": "Hist. Vol. Close % - Shows the historical volatility based on previous close price." }, "7089": { "type": "string", "description": "Opt. Volume - Option Volume" }, "7094": { "type": "string", "description": "Conid + Exchange" }, "7184": { "type": "string", "description": "canBeTraded - If contract is a trade-able instrument. Returns 1(true) or 0(false)." }, "7219": { "type": "string", "description": "Contract Description" }, "7220": { "type": "string", "description": "Contract Description" }, "7221": { "type": "string", "description": "Listing Exchange" }, "7280": { "type": "string", "description": "Industry - Displays the type of industry under which the underlying company can be categorized." }, "7281": { "type": "string", "description": "Category - Displays a more detailed level of description within the industry under which the underlying company can be categorized." }, "7282": { "type": "string", "description": "Average Volume - The average daily trading volume over 90 days." }, "7283": { "type": "string", "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" }, "7284": { "type": "string", "description": "Historic Volume (30d)" }, "7285": { "type": "string", "description": "Put/Call Ratio" }, "7286": { "type": "string", "description": "Dividend Amount - Displays the amount of the next dividend." }, "7287": { "type": "string", "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" }, "7288": { "type": "string", "description": "Ex-date of the dividend" }, "7289": { "type": "string", "description": "Market Cap" }, "7290": { "type": "string", "description": "P/E" }, "7291": { "type": "string", "description": "EPS" }, "7292": { "type": "string", "description": "Cost Basis - Your current position in this security multiplied by the average price and multiplier." }, "7293": { "type": "string", "description": "52 Week High - The highest price for the past 52 weeks." }, "7294": { "type": "string", "description": "52 Week Low - The lowest price for the past 52 weeks." }, "7295": { "type": "string", "description": "Open - Today's opening price." }, "7296": { "type": "string", "description": "Close - Today's closing price." }, "7308": { "type": "string", "description": "Delta - The ratio of the change in the price of the option to the corresponding change in the price of the underlying." }, "7309": { "type": "string", "description": "Gamma - The rate of change for the delta with respect to the underlying asset's price." }, "7310": { "type": "string", "description": "Theta - A measure of the rate of decline the value of an option due to the passage of time." }, "7311": { "type": "string", "description": "Vega - The amount that the price of an option changes compared to a 1% change in the volatility." }, "7607": { "type": "string", "description": "Opt. Volume Change % - Today's option volume as a percentage of the average option volume." }, "7633": { "type": "string", "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" }, "7635": { "type": "string", "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." }, "7636": { "type": "string", "description": "Shortable Shares - Number of shares available for shorting." }, "7637": { "type": "string", "description": "Fee Rate - Interest rate charged on borrowed shares." }, "7638": { "type": "string", "description": "Option Open Interest" }, "7639": { "type": "string", "description": "% of Mark Value - Displays the market value of the contract as a percentage of the total market value of the account.\nMark Value is calculated with real time market data (even when not subscribed to market data).\n" }, "7644": { "type": "string", "description": "Shortable - Describes the level of difficulty with which the security can be sold short." }, "7655": { "type": "string", "description": "Morningstar Rating - Displays Morningstar Rating provided value. Requires [Morningstar](https://www.interactivebrokers.com/en/index.php?f=14262) subscription." }, "7671": { "type": "string", "description": "Dividends - This value is the total of the expected dividend payments over the next twelve months per share." }, "7672": { "type": "string", "description": "Dividends TTM - This value is the total of the expected dividend payments over the last twelve months per share." }, "7674": { "type": "string", "description": "EMA(200) - Exponential moving average (N=200)." }, "7675": { "type": "string", "description": "EMA(100) - Exponential moving average (N=100)." }, "7676": { "type": "string", "description": "EMA(50) - Exponential moving average (N=50)." }, "7677": { "type": "string", "description": "EMA(20) - Exponential moving average (N=20)." }, "7678": { "type": "string", "description": "Price/EMA(200) - Price to Exponential moving average (N=200) ratio -1, displayed in percents." }, "7679": { "type": "string", "description": "Price/EMA(100) - Price to Exponential moving average (N=100) ratio -1, displayed in percents." }, "7680": { "type": "string", "description": "Price/EMA(50) - Price to Exponential moving average (N=50) ratio -1, displayed in percents." }, "7681": { "type": "string", "description": "Price/EMA(20) - Price to Exponential moving average (N=20) ratio -1, displayed in percents." }, "7682": { "type": "string", "description": "Change Since Open - The difference between the last price and the open price." }, "7683": { "type": "string", "description": "Upcoming Event - Shows the next major company event. Requires [Wall Street Horizon](https://www.interactivebrokers.com/en/index.php?f=24674) subscription." }, "7684": { "type": "string", "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." }, "7685": { "type": "string", "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." }, "7686": { "type": "string", "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." }, "7687": { "type": "string", "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." }, "7688": { "type": "string", "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." }, "7689": { "type": "string", "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." }, "7690": { "type": "string", "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." }, "7694": { "type": "string", "description": "Probability of Max Return - Customer implied probability of maximum potential gain." }, "7695": { "type": "string", "description": "Break Even - Break even points" }, "7696": { "type": "string", "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." }, "7697": { "type": "string", "description": "Futures Open Interest - Total number of outstanding futures contracts" }, "7698": { "type": "string", "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" }, "7699": { "type": "string", "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" }, "7700": { "type": "string", "description": "Probability of Max Return - Customer implied probability of maximum potential gain." }, "7702": { "type": "string", "description": "Probability of Max Loss - Customer implied probability of maximum potential loss." }, "7703": { "type": "string", "description": "Profit Probability - Customer implied probability of any gain." }, "7704": { "type": "string", "description": "Organization Type" }, "7705": { "type": "string", "description": "Debt Class" }, "7706": { "type": "string", "description": "Ratings - Ratings issued for bond contract." }, "7707": { "type": "string", "description": "Bond State Code" }, "7708": { "type": "string", "description": "Bond Type" }, "7714": { "type": "string", "description": "Last Trading Date" }, "7715": { "type": "string", "description": "Issue Date" }, "7718": { "type": "string", "description": "Beta - Beta is against standard index." }, "7720": { "type": "string", "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" }, "7741": { "type": "string", "description": "Prior Close - Yesterday's closing price" }, "7762": { "type": "string", "description": "Volume Long - High precision volume for the day. For formatted volume refer to field 87." }, "7768": { "type": "string", "description": "hasTradingPermissions - if user has trading permissions for specified contract. Returns 1(true) or 0(false)." } } } } }, "400": { "description": "sent when accounts are not queried before sending this request", "schema": { "type": "object", "properties": { "error": { "type": "string" }, "statusCode": { "type": "integer" } } } } } } }, "/iserver/marketdata/{conid}/unsubscribe": { "get": { "summary": "Market Data Cancel (Single)", "description": "Cancel market data for given conid. To cancel all market data request(s), see /iserver/marketdata/unsubscribeall.\n", "tags": [ "Market Data" ], "parameters": [ { "name": "conid", "in": "path", "required": true, "type": "string", "description": "contract id" } ], "responses": { "500": { "description": "cancel failed" }, "200": { "description": "confirms market data for conid is cancelled", "schema": { "type": "object", "properties": { "confirmed": { "description": "success means market data was cancelled.", "type": "string" } } } } } } }, "/iserver/marketdata/unsubscribeall": { "get": { "summary": "Market Data Cancel (All)", "description": "Cancel all market data request(s). To cancel market data for given conid, see /iserver/marketdata/{conid}/unsubscribe.\n", "tags": [ "Market Data" ], "responses": { "200": { "description": "confirms market data is cancelled", "schema": { "type": "object", "properties": { "confirmed": { "description": "true means market data is cancelled, false means it is not.", "type": "boolean" } } } } } } }, "/iserver/marketdata/history": { "get": { "summary": "Market Data History", "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", "tags": [ "Market Data" ], "parameters": [ { "in": "query", "name": "conid", "description": "contract id", "required": true, "type": "string" }, { "in": "query", "name": "exchange", "description": "Exchange of the conid (e.g. ISLAND, NYSE, etc.). Default value is empty which corresponds to primary exchange of the conid.", "required": false, "type": "string" }, { "in": "query", "name": "period", "description": "available time period-- {1-30}min, {1-8}h, {1-1000}d, {1-792}w, {1-182}m, {1-15}y", "required": true, "type": "string" }, { "in": "query", "name": "bar", "description": "possible value-- 1min, 2min, 3min, 5min, 10min, 15min, 30min, 1h, 2h, 3h, 4h, 8h, 1d, 1w, 1m", "required": false, "type": "string" }, { "in": "query", "name": "outsideRth", "description": "For contracts that support it, will determine if historical data includes outside of regular trading hours.", "required": false, "type": "boolean" } ], "responses": { "200": { "description": "Returns an object", "schema": { "$ref": "#/definitions/history-data" } }, "429": { "description": "Too many requests", "schema": { "type": "object", "properties": { "error": { "type": "string" } } } }, "500": { "description": "System Error", "schema": { "$ref": "#/definitions/system-error" } } } } }, "/iserver/contract/{conid}/info": { "get": { "summary": "Contract Details", "description": "Using the Contract Identifier get contract info. You can use this to prefill your order before you submit an order", "tags": [ "Contract" ], "parameters": [ { "name": "conid", "in": "path", "required": true, "type": "string", "description": "contract id" } ], "responses": { "200": { "description": "returns an object", "schema": { "$ref": "#/definitions/contract" } } } } }, "/iserver/secdef/search": { "post": { "summary": "Search by Symbol or Name", "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", "tags": [ "Contract" ], "parameters": [ { "in": "body", "name": "symbol", "required": true, "description": "Symbol or Company Name to be searched", "schema": { "type": "object", "required": [ "symbol" ], "properties": { "symbol": { "type": "string", "description": "symbol or name to be searched" }, "name": { "type": "boolean", "description": "should be true if the search is to be performed by name. false by default." }, "secType": { "type": "string", "description": "If search is done by name, only the assets provided in this field will be returned. Currently, only STK is supported." } } } } ], "responses": { "200": { "description": "returns an array of results", "schema": { "type": "array", "items": { "type": "object", "properties": { "conid": { "type": "integer", "description": "Contract Identifier" }, "companyHeader": { "type": "string", "description": "Company Name - Exchange" }, "companyName": { "type": "string" }, "symbol": { "type": "string", "description": "Underlying symbol" }, "description": { "type": "string", "description": "Exchange" }, "restricted": { "type": "string" }, "fop": { "type": "string", "description": "List of Future Option expirations in YYYMMDD format separated by semicolon" }, "opt": { "type": "string", "description": "List of Option expirations in YYYYMMDD format separated by semicolon" }, "war": { "type": "string", "description": "List of Warrant expirations in YYYYMMDD format separated by semicolon" }, "sections": { "type": "array", "items": { "type": "object", "properties": { "secType": { "type": "string", "description": "Asset Class" }, "months": { "type": "string", "description": "List of expiration month(s) and year(s) in MMMYY format separated by semicolon" }, "symbol": { "type": "string", "description": "Underlying symbol" }, "exchange": { "type": "string", "description": "Listing Exchange" }, "legSecType": { "type": "string", "description": "For combo's defines the asset class for each leg" } } } } } } } }, "500": { "description": "error while processing the request", "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } } }, "/iserver/secdef/strikes": { "get": { "summary": "Search Strikes", "description": "Query strikes for Options/Warrants. For the conid of the underlying contract, available contract months and exchanges use \"/iserver/secdef/search\"", "tags": [ "Contract" ], "parameters": [ { "in": "query", "name": "conid", "description": "contract id of the underlying contract", "required": true, "type": "string" }, { "in": "query", "name": "sectype", "description": "OPT/WAR", "required": true, "type": "string" }, { "in": "query", "name": "month", "description": "contract month", "required": true, "type": "string" }, { "in": "query", "name": "exchange", "description": "optional, default is SMART", "required": false, "type": "string" } ], "responses": { "200": { "description": "returns an object contains call/put strike prices", "schema": { "type": "object", "properties": { "call": { "type": "array", "items": { "type": "string", "example": [ "5", "10", "20" ] } }, "put": { "type": "array", "items": { "type": "string", "example": [ "5", "10", "20" ] } } } } }, "500": { "description": "error while processing the request", "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } } }, "/iserver/secdef/info": { "get": { "summary": "Secdef Info", "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.", "tags": [ "Contract" ], "parameters": [ { "in": "query", "name": "conid", "description": "underlying contract id", "required": true, "type": "string" }, { "in": "query", "name": "sectype", "description": "FUT/OPT/WAR/CASH/CFD", "required": true, "type": "string" }, { "in": "query", "name": "month", "description": "contract month, only required for FUT/OPT/WAR in the format MMMYY, example JAN00", "required": false, "type": "string" }, { "in": "query", "name": "exchange", "description": "optional, default is SMART", "required": false, "type": "string" }, { "in": "query", "name": "strike", "description": "optional, only required for OPT/WAR", "required": false, "type": "number" }, { "in": "query", "name": "right", "description": "C for call, P for put", "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": { "type": "object", "properties": { "error": { "type": "string" } } } } } } }, "/iserver/contract/{conid}/algos": { "get": { "summary": "IB Algo Params", "description": "Returns supported IB Algos for contract. Must be called a second time to query the list of available parameters.", "tags": [ "Contract" ], "parameters": [ { "in": "path", "name": "conid", "description": "IBKR contract identifier", "required": true, "type": "string" }, { "in": "query", "name": "algos", "description": "List of algo ids delimited by \";\" to filter by. Max of 8 algos ids can be specified.", "required": false, "type": "string" }, { "in": "query", "name": "addDescription", "description": "Whether or not to add algo descriptions to response. Set to 1 for yes, 0 for no.", "required": false, "type": "string" }, { "in": "query", "name": "addParams", "description": "Whether or not to show algo parameters. Set to 1 for yes, 0 for no.", "required": false, "type": "string" } ], "responses": { "200": { "description": "returns an array of algos", "schema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "parameters": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "The algo parameter" }, "required": { "type": "boolean", "description": "If true a value must be entered." }, "name": { "type": "string", "description": "Descriptive name of the parameter." }, "valueClassName": { "type": "string", "description": "Format of the parameter.", "enum": [ "double", "string", "time", "boolean" ] }, "minValue": { "type": "number", "description": "Smallest value, only applies to parameters with valueClassName=Double." }, "maxValue": { "type": "number", "description": "Largest value, only applies to parameters with valueClassName=Double." }, "defaultValue": { "type": "boolean", "description": "User configured preset for this parameter." }, "legalStrings": { "type": "string", "description": "The list of choices", "example": [ "ALL:Get Done", "ALL:Aggressive", "ALL:Neutral", "ALL:Passive" ] }, "description": { "type": "string", "description": "Detailed description of the parameter." }, "guiRank": { "type": "number", "description": "The order in UI, used when building dynamic UI so that more important parameters are presented first." }, "priceMarketRule": { "type": "boolean", "description": "If true, must specify parameter using market rule format. Only applies to parameters with valueClassName=Double." }, "enabledConditions": { "type": "string", "enum": [ "MKT:speedUp:=:no", "LMT:strategyType:<>:empty", "MKT:strategyType:=:Marketable" ], "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" } }, "required": [ "id", "valueClassName" ] } } } } } } } } }, "/iserver/contract/rules": { "post": { "summary": "Contract Rules", "description": "Returns trading related rules for a specific contract and side. For both contract info and rules use the endpoint /iserver/contract/{conid}/info-and-rules.", "tags": [ "Contract" ], "parameters": [ { "in": "body", "name": "conid", "required": true, "schema": { "type": "object", "required": [ "conid", "isBuy" ], "properties": { "conid": { "type": "string", "description": "IBKR contract identifier" }, "isBuy": { "type": "boolean", "description": "Side of the market rules apply too. Set to **true** for Buy Orders, set to **false** for Sell Orders" } } } } ], "responses": { "200": { "description": "returns an array", "schema": { "type": "object", "properties": { "rules": { "type": "array", "items": { "type": "object", "properties": { "algoEligible": { "type": "boolean" }, "canTradeAcctIds": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "List of Accounts that can be traded" } } } }, "error": { "type": "string", "description": "Returns a description on any errors with order presets" }, "orderTypes": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "list of available order types" } } } }, "ibalgoTypes": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "order types that support IB Algos" } } } }, "fraqTypes": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "order types that support fractional trades" } } } }, "cqtTypes": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "order types that support cash quantity trades" } } } }, "orderDefaults": { "type": "array", "description": "If object returned will provide the defaults based on user settings", "items": { "type": "object", "properties": { "string": { "type": "array", "description": "orderType", "items": { "type": "string", "properties": { "ORTH": { "type": "boolean", "description": "Outside of Regular Trading Hours" }, "SP": { "type": "string", "description": "Stop Price value" }, "LP": { "type": "string", "description": "Limit Price value" }, "PC": { "type": "string", "description": "Price Cap value" }, "TA": { "type": "string", "description": "Trailing amount value" }, "TU": { "type": "string", "description": "Trailing unit" }, "ROA": { "type": "string", "description": "Releative offset amount" }, "ROP": { "type": "string", "description": "Relative offset percent" }, "TT": { "type": "string", "description": "Touch trigger price" }, "UNP": { "type": "boolean", "description": "Use Net Price for Bonds" } } } } } } }, "orderTypesOutside": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "order types that support outside of regular trading hours" } } } }, "defaultSize": { "type": "integer", "description": "Default quantity" }, "cashSize": { "type": "integer", "description": "cash value" }, "sizeIncrement": { "type": "integer", "description": "increment quantity value" }, "tifTypes": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "Time in Force values, formatted with o for supporting Outside regular trading hours and a for Algo trading" } } } }, "defaultTIF": { "type": "string", "description": "Default time in force value" }, "limitPrice": { "type": "number", "description": "Limit price" }, "stopprice": { "type": "number", "description": "Stop price" }, "orderOrigination": { "type": "number", "description": "Order origin designation for US securities options and Options Clearing Corporation" }, "preview": { "type": "boolean", "description": "order preview required" }, "displaySize": { "type": "number" }, "fraqInt": { "type": "number", "description": "decimal places for fractional order size" }, "cashCcy": { "type": "string", "description": "Cash currency for the contract" }, "cashQtyIncr": { "type": "number", "description": "Increment value for cash quantity" }, "priceMagnifier": { "type": "number", "description": "Price Magnifier" }, "negativeCapable": { "type": "boolean", "description": "trading negative price support" }, "increment": { "type": "number", "description": "Price increment value" }, "incrementDigits": { "type": "integer", "description": "Number of digits for price increment" } } } } } } } } } }, "/iserver/contract/{conid}/info-and-rules": { "get": { "summary": "Info and Rules", "description": "Returns both contract info and rules from a single endpoint.\nFor only contract rules, use the endpoint /iserver/contract/rules.\nFor only contract info, use the endpoint /iserver/contract/{conid}/info. \n", "tags": [ "Contract" ], "parameters": [ { "in": "path", "name": "conid", "description": "IBKR contract identifier", "required": true, "type": "string" }, { "in": "query", "name": "isBuy", "description": "Side of the market rules apply too. Set to **true** for Buy Orders, set to **false** for Sell Orders", "required": true, "type": "boolean" } ], "responses": { "200": { "description": "returns an array", "schema": { "type": "object", "properties": { "cfi_code": { "type": "string", "description": "Classification of Financial Instrument codes" }, "symbol": { "type": "string", "description": "Underlying symbol" }, "cusip": { "type": "string" }, "expiry_full": { "type": "number", "description": "Expiration Date in the format YYYYMMDD" }, "con_id": { "type": "number", "description": "IBKRs contract identifier" }, "maturity_date": { "type": "number", "description": "Date on which the underlying transaction settles if the option is exercised" }, "industry": { "type": "string", "description": "Specific group of companies or businesses." }, "instrument_type": { "type": "string", "description": "Asset Class of the contract" }, "trading_class": { "type": "string", "description": "Designation of the contract" }, "valid_exchanges": { "type": "string", "description": "Comma separated list of exchanges or trading venues" }, "allow_sell_long": { "type": "boolean", "description": "Allowed to sell shares that you own" }, "is_zero_commission_security": { "type": "boolean", "description": "Supports zero commission trades" }, "local_symbol": { "type": "string", "description": "Contracts symbol from primary exchange. For options it is the OCC symbol." }, "classifier": { "type": "string" }, "currency": { "type": "string", "description": "Currency contract trades in" }, "text": { "type": "string", "description": "Formatted contract parameters" }, "underlying_con_id": { "type": "number", "description": "IBKRs contract identifier for the underlying instrument" }, "r_t_h": { "type": "boolean", "description": "Provides trading outside of Regular Trading Hours" }, "multiplier": { "type": "string", "description": "numerical value of each point of price movement" }, "strike": { "type": "string", "description": "fixed price at which the owner of the option buys or sells the underlying" }, "right": { "type": "string", "description": "Put or Call of the option" }, "underlying_issuer": { "type": "string", "description": "Legal entity for underlying contract" }, "contract_month": { "type": "string", "description": "Month the contract must be satisfied by making or accepting delivery" }, "company_name": { "type": "string", "description": "Contracts company name" }, "smart_available": { "type": "boolean", "description": "Support IBKRs SMART routing" }, "exchange": { "type": "string", "description": "Primary Exchange, Routing or Trading Venue" }, "rules": { "type": "array", "items": { "type": "object", "properties": { "algoEligible": { "type": "boolean", "description": "Contract supports algo orders" }, "canTradeAcctIds": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "List of Accounts that can be traded" } } } }, "error": { "type": "string", "description": "Returns a description on any errors with order presets" }, "orderTypes": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "list of available order types" } } } }, "ibalgoTypes": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "order types that support IB Algos" } } } }, "fraqTypes": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "order types that support fractional trades" } } } }, "cqtTypes": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "order types that support cash quantity trades" } } } }, "orderDefaults": { "type": "array", "description": "If object returned will provide the defaults based on user settings", "items": { "type": "object", "properties": { "string": { "type": "array", "description": "orderType", "items": { "type": "string", "properties": { "ORTH": { "type": "boolean", "description": "Outside of Regular Trading Hours" }, "SP": { "type": "string", "description": "Stop Price value" }, "LP": { "type": "string", "description": "Limit Price value" }, "PC": { "type": "string", "description": "Price Cap value" }, "TA": { "type": "string", "description": "Trailing amount value" }, "TU": { "type": "string", "description": "Trailing unit" }, "ROA": { "type": "string", "description": "Releative offset amount" }, "ROP": { "type": "string", "description": "Relative offset percent" }, "TT": { "type": "string", "description": "Touch trigger price" }, "UNP": { "type": "boolean", "description": "Use Net Price for Bonds" } } } } } } }, "orderTypesOutside": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "order types that support outside of regular trading hours" } } } }, "defaultSize": { "type": "integer", "description": "Default quantity" }, "cashSize": { "type": "integer", "description": "cash value" }, "sizeIncrement": { "type": "integer", "description": "increment quantity value" }, "tifTypes": { "type": "array", "items": { "type": "integer", "properties": { "0": { "type": "string", "description": "Time in Force values, formatted with o for supporting Outside regular trading hours and a for Algo trading" } } } }, "defaultTIF": { "type": "string", "description": "Default time in force value" }, "limitPrice": { "type": "number", "description": "Limit price" }, "stopprice": { "type": "number", "description": "Stop price" }, "orderOrigination": { "type": "number", "description": "Order origin designation for US securities options and Options Clearing Corporation" }, "preview": { "type": "boolean", "description": "order preview required" }, "displaySize": { "type": "number" }, "fraqInt": { "type": "number", "description": "decimal places for fractional order size" }, "cashCcy": { "type": "string", "description": "Cash currency for the contract" }, "cashQtyIncr": { "type": "number", "description": "Increment value for cash quantity" }, "priceMagnifier": { "type": "number", "description": "Price Magnifier" }, "negativeCapable": { "type": "boolean", "description": "trading negative price support" }, "increment": { "type": "number", "description": "Price increment value" }, "incrementDigits": { "type": "integer", "description": "Number of digits for price increment" } } } } } } } } } }, "/iserver/scanner/params": { "get": { "summary": "Scanner Parameters", "description": "Returns an object contains four lists contain all parameters for scanners", "tags": [ "Scanner" ], "responses": { "200": { "description": "An object contains lists", "schema": { "type": "object", "properties": { "scan_type_list": { "type": "array", "items": { "type": "object", "properties": { "display_name": { "type": "string" }, "code": { "type": "string" }, "instruments": { "type": "array", "items": { "type": "string", "description": "type of instrument" } } } } }, "instrument_list": { "type": "array", "items": { "type": "object", "properties": { "display_name": { "type": "string" }, "type": { "type": "string" }, "filters": { "type": "array", "items": { "type": "string", "description": "code of filter" } } } } }, "filter_list": { "type": "array", "items": { "type": "object", "properties": { "group": { "type": "string" }, "display_name": { "type": "string" }, "code": { "type": "string" }, "type": { "type": "string" } } } }, "location_tree": { "type": "array", "items": { "type": "object", "properties": { "display_name": { "type": "string" }, "type": { "type": "string" }, "locations": { "type": "array", "items": { "type": "object", "properties": { "display_name": { "type": "string" }, "type": { "type": "string" } } } } } } } } } } } } }, "/iserver/scanner/run": { "post": { "summary": "Scanner Run", "description": "Searches for contracts according to the filters specified in scanner/params endpoint", "tags": [ "Scanner" ], "parameters": [ { "in": "body", "name": "body", "description": "scanner-params request", "required": true, "schema": { "$ref": "#/definitions/scanner-params" } } ], "responses": { "200": { "description": "returns an array", "schema": { "type": "array", "items": { "type": "object", "properties": { "server_id": { "type": "string" }, "column_name": { "type": "string" }, "symbol": { "type": "string", "description": "Underlying symbol" }, "conidex": { "type": "string", "description": "conid and exchange. Format supports conid or conid@exchange" }, "con_id": { "type": "number" }, "available_chart_periods": { "type": "string", "description": "List of available chart periods" }, "company_name": { "type": "string", "description": "Contracts company name" }, "contract_description_1": { "type": "string", "description": "Format contract name", "example": "FB Stock (NASDAQ.NMS)" }, "listing_exchange": { "type": "string" }, "sec_type": { "type": "string" } } } } } } } }, "/iserver/account/pnl/partitioned": { "get": { "summary": "PnL for the selected account", "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", "tags": [ "PnL", "Account" ], "responses": { "200": { "description": "An object containing account and model(s) pnl", "schema": { "type": "object", "properties": { "acctId": { "type": "object" } } } } } } } }, "definitions": { "notifications": { "type": "array", "items": { "type": "object", "description": "notification", "properties": { "D": { "type": "string", "description": "notification date" }, "ID": { "type": "string", "description": "unique way to reference this notification" }, "FC": { "type": "string", "description": "FYI code, we can use it to find whether the disclaimer is accepted or not in settings" }, "MD": { "type": "string", "description": "content of notification" }, "MS": { "type": "string", "description": "title of notification" }, "R": { "type": "string", "description": "0-unread, 1-read" } } } }, "calendar_request": { "type": "object", "properties": { "date": { "type": "object", "properties": { "start": { "type": "string", "description": "start date of a period. for example 20180808-0400" }, "end": { "type": "string", "description": "end date of a period. for example 20180808-0400" } } }, "filters": { "type": "object", "properties": { "recently_held": { "type": "string", "description": "value can be 'true' or 'false'." }, "corporate_earnings": { "type": "string", "description": "value can be 'true' or 'false'." }, "DivExDates": { "type": "string", "description": "value can be 'true' or 'false'." }, "ipo": { "type": "string", "description": "value can be 'true' or 'false'." }, "splits": { "type": "string", "description": "value can be 'true' or 'false'." }, "corporate_events": { "type": "string", "description": "value can be 'true' or 'false'." }, "economic_events": { "type": "string", "description": "value can be 'true' or 'false'." }, "option_show_monthly": { "type": "string", "description": "value can be 'true' or 'false'." }, "option_show_weekly": { "type": "string", "description": "value can be 'true' or 'false'." }, "country": { "type": "string", "description": "default is 'All'." }, "limit": { "type": "string", "description": "default is '250'." }, "limit_region": { "type": "string", "description": "default is '50'." } } } } }, "events": { "type": "array", "description": "events", "items": { "type": "object", "properties": { "index_date_type": { "type": "string" }, "event_type": { "type": "string" }, "data": { "type": "object", "description": "will be different for different event types" }, "conids": { "type": "array", "items": { "type": "string", "description": "conid in string" } }, "index_date": { "type": "string", "description": "for exmple 20180817T040000+0000" }, "source": { "type": "string", "description": "for example RSE" }, "event_key": { "type": "string", "description": "for example 11662135" }, "tooltips": { "type": "object" }, "status": { "type": "string" } } } }, "wagers": { "type": "array", "items": { "type": "object", "description": "List of wagers", "properties": { "conid": { "type": "number" }, "curr": { "type": "string" }, "desc": { "type": "string" }, "part": { "type": "string" } } } }, "inds": { "type": "array", "items": { "type": "object", "properties": { "conid": { "type": "number" } } } }, "secdef": { "type": "array", "items": { "type": "object", "description": "security definition information.", "properties": { "conid": { "type": "integer", "description": "IBKR contract identifier." }, "currency": { "type": "string", "description": "Currency contract trades in." }, "crossCurrency": { "type": "boolean", "description": "Defines if a derivative contract has a different currency." }, "time": { "type": "integer" }, "chineseName": { "type": "string", "description": "HTML encoded company description in Chinese." }, "allExchanges": { "type": "string", "description": "List of exchanges and venues contract trades." }, "listingExchange": { "type": "string", "description": "Main trading venue." }, "name": { "type": "string", "description": "Company Name." }, "assetClass": { "type": "string", "description": "Group of financial instruments which have similar financial characteristics and behave similar in the marketplace." }, "expiry": { "type": "string", "description": "Specific data contract expires." }, "lastTradingDay": { "type": "string", "description": "Final day derivative contract can be traded before delivery of the underlying asset or cash settlement." }, "group": { "type": "string", "description": "Potential characteristic of each product." }, "putOrCall": { "type": "string", "description": "Defines the right to buy or sell of the underlying security." }, "sector": { "type": "string", "description": "The category of the economy." }, "sectorGroup": { "type": "string", "description": "Stock Group contract belongs too." }, "strike": { "type": "number", "description": "Set price at which a derivative contract can be bought or sold." }, "ticker": { "type": "string", "description": "Contract symbol." }, "undConid": { "type": "integer", "description": "Underlying contract identifier." }, "multiplier": { "type": "integer", "description": "Multiplier for total premium paid or received for derivative contract." }, "type": { "type": "string", "description": "Stock type." }, "undComp": { "type": "string", "description": "Company name for underlying contract." }, "undSym": { "type": "string", "description": "IBKR Symbol for underlying contract." }, "hasOptions": { "type": "boolean", "description": "If contract has an option." }, "fullName": { "type": "string", "description": "Formatted company name with underlying symbol, expiration, strike, right." }, "isUS": { "type": "boolean", "description": "If contract is a US contract. Currently supported for stocks, options and warrants." }, "incrementRules": { "type": "object", "description": "Price increment value contract trades.", "properties": { "lowerEdge": { "type": "number", "description": "The minimum contract price on the market that supports the specified increment." }, "increment": { "type": "number", "description": "The minimum increment value for contract price." } } } } } }, "futures": { "type": "array", "items": { "type": "object", "description": "future contract information", "properties": { "symbol": { "type": "string" }, "conid": { "type": "integer", "description": "conid of the future contract" }, "underlyingConid": { "type": "integer" }, "expirationDate": { "type": "string" }, "ltd": { "type": "string", "description": "last trading day" } } } }, "stocks": { "type": "array", "description": "This is an array of object(s), there could be multiple results under same symbol\n", "items": { "type": "object", "description": "future contract information", "properties": { "name": { "type": "string", "description": "company name" }, "chineseName": { "type": "string", "description": "company name in Chinese" }, "assetClass": { "type": "string", "example": "STK" }, "contracts": { "type": "array", "description": "array of contracts from different exchanges", "items": { "type": "object", "properties": { "conid": { "type": "integer", "description": "conid of the stock contract" }, "exchange": { "type": "string", "example": "NYSE" } } } } } } }, "history-result": { "type": "object", "properties": { "bars": { "type": "object", "properties": { "open": { "type": "number", "description": "First price returned for bar value." }, "startTime": { "type": "string", "description": "Start Time in the format YYYYMMDD." }, "startTimeVal": { "type": "integer", "description": "Start Time Value - Formatted in unix time in ms." }, "endTime": { "type": "string", "description": "End Time in the format YYYYMMDD." }, "endTimeVal": { "type": "integer", "description": "End Time Value - Formatted in unix time in ms." }, "points": { "type": "integer", "description": "total number of data points." }, "data": { "type": "array", "items": { "type": "object", "properties": { "t": { "type": "number", "description": "Time - Formatted in unix time in ms." }, "o": { "type": "number", "description": "Open - First price returned for bar value." }, "c": { "type": "number", "description": "Close - Last price returned for bar value." }, "h": { "type": "number", "description": "High - High price returned for bar value." }, "l": { "type": "number", "description": "Low - Last price returned for bar value." }, "v": { "type": "number", "description": "Volume - Traded volume for bar value." } } } }, "mktDataDelay": { "type": "integer", "description": "If 0 then data is returned in real time. Otherwise will return the number of seconds history data is delayed." } } } } }, "position-data": { "type": "object", "properties": { "conid": { "type": "number", "description": "Contract identifier from IBKR's database." }, "position": { "type": "number", "description": "Number of shares or quantity of the position." }, "avgCost": { "type": "number", "description": "Average cost of the position." } } }, "order-data": { "type": "object", "properties": { "clientOrderId": { "type": "string" }, "execId": { "type": "string" }, "execType": { "type": "string", "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\"" ] }, "orderType": { "type": "string", "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\"" ] }, "orderStatus": { "type": "string", "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\"" ] }, "symbol": { "type": "string", "description": "Underlying symbol for contract" }, "orderQty": { "type": "string", "description": "Quantity of active order" }, "price": { "type": "string", "description": "Price of active order" }, "lastShares": { "type": "string", "description": "Quantity of the last partial fill" }, "lastPrice": { "type": "string", "description": "Price of the last partial fill" }, "cumQty": { "type": "string", "description": "Cumulative fill quantity" }, "leavesQty": { "type": "string", "description": "Remaining quantity to be filled" }, "avgPrice": { "type": "string", "description": "Average fill price" }, "side": { "type": "string", "enum": [ "1 \"Buy\"", "2 \"Sell\"", "3 \"Buy Minus\"", "4 \"Sell Plus\"", "5 \"Sell Short\"", "6 \"Sell Short Exempt\"" ] }, "orderId": { "type": "string", "description": "Order identifier" }, "account": { "type": "string", "description": "Account number" }, "secType": { "type": "string", "enum": [ "CS \"Stock\"", "CASH \"Forex\"", "CFD \"Contract for Difference\"", "FUT \"Future\"", "OPT \"Option\"" ], "description": "Contracts asset class" }, "txTime": { "type": "string", "description": "Time of transaction in GMT, format YYYYMMDD-hh:m:ss" }, "rcptTime": { "type": "string", "description": "Time of receipt in GMT, format YYYYMMDD-hh:mm:ss" }, "tif": { "type": "string", "enum": [ "0 \"Day\"", "1 \"GTC\"", "2 \"At the Opening\"" ], "description": "Time in Force" }, "conid": { "type": "string", "description": "Contract identifier from IBKR's database." }, "currency": { "type": "string", "description": "Trading currency" }, "exchange": { "type": "string", "description": "Exchange or venue" }, "listingExchange": { "type": "string", "description": "Listing Exchange" }, "text": { "type": "number", "description": "error message" }, "warnings": { "type": "object", "properties": { "PRICECAP": { "type": "string" }, "TIME": { "type": "string" } } }, "commCurr": { "type": "string", "description": "Commission currency" }, "comms": { "type": "string", "description": "Commissions" }, "realizedPnl": { "type": "string", "description": "Realized PnL" } } }, "stats-data": { "type": "object", "properties": { "Conid": { "type": "number" }, "Exchange": { "type": "string" }, "V": { "type": "number" }, "T": { "type": "number" }, "TT": { "type": "number" }, "P": { "type": "string", "description": "Object, payload depends on event type. See confluence page for IGEvntUpd." } } }, "market-data": { "type": "object", "properties": { "31": { "type": "string", "description": "Last Price - The last price at which the contract traded. May contain one of the following prefixes:\n * C - Previous day's closing price.\n * H - Trading has halted.\n" }, "70": { "type": "number", "description": "High - Current day high price" }, "71": { "type": "number", "description": "Low - Current day low price" }, "82": { "type": "string", "description": "Change - The difference between the last price and the close on the previous trading day" }, "83": { "type": "number", "description": "Change % - The difference between the last price and the close on the previous trading day in percentage." }, "84": { "type": "string", "description": "Bid Price - The highest-priced bid on the contract." }, "85": { "type": "string", "description": "Ask Size - The number of contracts or shares offered at the ask price. For US stocks, the number displayed is divided by 100." }, "86": { "type": "string", "description": "Ask Price - The lowest-priced offer on the contract." }, "87": { "type": "string", "description": "Volume - Volume for the day, formatted with 'K' for thousands or 'M' for millions. For higher precision volume refer to field 7762." }, "88": { "type": "string", "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." }, "6509": { "type": "string", "description": "Market Data Availability. The field may contain three chars. First char defines: R = RealTime, D = Delayed,\nZ = Frozen, Y = Frozen Delayed, N = Not Subscribed. Second char defines: P = Snapshot, p = Consolidated.\nThird char defines: B = Book\n * RealTime - Data is relayed back in real time without delay, market data subscription(s) are required.\n * Delayed - Data is relayed back 15-20 min delayed.\n * Frozen - Last recorded data at market close, relayed back in real time.\n * Frozen Delayed - Last recorded data at market close, relayed back delayed.\n * Not Subscribed - User does not have the required market data subscription(s) to relay back either real time or delayed data.\n * Snapshot - Snapshot request is available for contract.\n * Consolidated - Market data is aggregated across multiple exchanges or venues.\n * Book - Top of the book data is available for contract.\n" }, "7057": { "type": "string", "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" }, "7058": { "type": "string", "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" }, "7059": { "type": "number", "description": "Last Size - The number of unites traded at the last price" }, "7068": { "type": "string", "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" }, "7195": { "type": "string", "description": "IV Rank" }, "7196": { "type": "string", "description": "IV Rank" }, "7197": { "type": "string", "description": "IV Rank" }, "7198": { "type": "string", "description": "IV Percentile" }, "7199": { "type": "string", "description": "IV Percentile" }, "7200": { "type": "string", "description": "IV Percentile" }, "7201": { "type": "string", "description": "IV High Low" }, "7202": { "type": "string", "description": "IV High Low" }, "7203": { "type": "string", "description": "IV High Low" }, "7204": { "type": "string", "description": "IV High Low" }, "7205": { "type": "string", "description": "IV High Low" }, "7206": { "type": "string", "description": "IV High Low" }, "7207": { "type": "string", "description": "HV Rank" }, "7208": { "type": "string", "description": "HV Rank" }, "7209": { "type": "string", "description": "HV Rank" }, "7210": { "type": "string", "description": "HV Percentile" }, "7211": { "type": "string", "description": "HV Percentile" }, "7212": { "type": "string", "description": "HV Percentile" }, "7245": { "type": "string", "description": "HV High Low" }, "7246": { "type": "string", "description": "HV High Low" }, "7247": { "type": "string", "description": "HV High Low" }, "7248": { "type": "string", "description": "HV High Low" }, "7249": { "type": "string", "description": "HV High Low" }, "7263": { "type": "string", "description": "HV High Low" }, "7264": { "type": "string", "description": "ESG" }, "7265": { "type": "string", "description": "ESG" }, "7266": { "type": "string", "description": "ESG" }, "7267": { "type": "string", "description": "ESG" }, "7268": { "type": "string", "description": "ESG" }, "7269": { "type": "string", "description": "ESG" }, "7271": { "type": "string", "description": "ESG" }, "7272": { "type": "string", "description": "ESG" }, "7273": { "type": "string", "description": "ESG" }, "7274": { "type": "string", "description": "ESG" }, "7275": { "type": "string", "description": "ESG" }, "7276": { "type": "string", "description": "ESG" }, "7277": { "type": "string", "description": "ESG" }, "7282": { "type": "string", "description": "Average Volume - The average daily trading volume over 90 days." }, "7283": { "type": "string", "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. \n" }, "7284": { "type": "string", "description": "Historic Volume (30d)" }, "7286": { "type": "number", "description": "Dividend Amount - Displays the amount of the next dividend." }, "7287": { "type": "string", "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" }, "7288": { "type": "string", "description": "Ex-date of the dividend" }, "7289": { "type": "string", "description": "Market Cap" }, "7290": { "type": "string", "description": "P/E" }, "7293": { "type": "string", "description": "52 Week High - The highest price for the past 52 weeks." }, "7294": { "type": "string", "description": "52 Week Low - The lowest price for the past 52 weeks." }, "7295": { "type": "number", "description": "Open - Today's opening price." }, "7296": { "type": "number", "description": "Close - Today's closing price." }, "7331": { "type": "string", "description": "Reuters Fundamentals" }, "7370": { "type": "string", "description": "ESG" }, "7371": { "type": "string", "description": "ESG" }, "7372": { "type": "string", "description": "ESG" }, "7635": { "type": "string", "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" }, "7636": { "type": "number", "description": "shortable invetory" }, "7637": { "type": "string", "description": "Fee rebate rate" }, "7644": { "type": "string", "description": "Shortable - Describes the level of difficulty with which the security can be sold short." }, "7674": { "type": "string", "description": "EMA(200) - Exponential moving average (N=200)." }, "7675": { "type": "string", "description": "EMA(100) - Exponential moving average (N=100)." }, "7676": { "type": "string", "description": "EMA(50) - Exponential moving average (N=50)." }, "7677": { "type": "string", "description": "EMA(20) - Exponential moving average (N=20)." }, "7681": { "type": "string", "description": "Price/EMA(20) - Price to Exponential moving average (N=20) ratio -1, displayed in percents." }, "7698": { "type": "string", "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" }, "7699": { "type": "string", "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" }, "7718": { "type": "string", "description": "Beta - Beta is against standard index." }, "7720": { "type": "string", "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" }, "7743": { "type": "string", "description": "Reuters Fundamentals" }, "7761": { "type": "string", "description": "ESG" }, "7992": { "type": "string", "description": "26 Week High - The highest price for the past 26 weeks." }, "7993": { "type": "string", "description": "26 Week Low - The lowest price for the past 26 weeks." }, "7994": { "type": "string", "description": "13 Week High - The highest price for the past 13 weeks." }, "7995": { "type": "string", "description": "13 Week Low - The lowest price for the past 13 weeks." }, "conid": { "type": "integer", "description": "IBKR Contract identifier" }, "minTick": { "type": "number", "description": "minimum price increment" }, "BboExchange": { "type": "string", "description": "Color for Best Bid/Offer Exchange in hex code" }, "HasDelayed": { "type": "boolean", "description": "If market data field values return delayed" }, "sizeMinTick": { "type": "integer", "description": "minimum size increment" }, "BestEligible": { "type": "integer" }, "BestBidExch": { "type": "integer" }, "BestAskExch": { "type": "integer" }, "PreOpenBid": { "type": "integer" }, "LastAttribs": { "type": "integer" }, "TimestampBase": { "type": "integer", "description": "Base time stamp for last update in format YYYYMMDD" }, "TimestampDelta": { "type": "integer" }, "LastExch": { "type": "integer" }, "CloseAttribs": { "type": "integer" } } }, "scanner-params": { "type": "object", "properties": { "instrument": { "type": "string", "description": "Contains an instrument, which to scan for. For example - \"STK\"" }, "type": { "type": "string", "description": "Specify the scan type to use. For example - \"MOST_ACTIVE_USD\"" }, "location": { "type": "string", "description": "Contains location code, where to look for specified instrument. For example - \"STK.US.MAJOR\"" }, "filter": { "type": "array", "description": "Contains list of filters supported for the scanner", "items": { "type": "object", "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. For example - [{\"code\":\"usdVolume\",\"value\":500}]. You can also specify multiple filters - \"filter\":[{\"code\":\"value\"},{\"code\":\"value\"},{\"code\":\"value\"}]", "properties": { "code": { "type": "string" }, "value": { "type": "number" } } } } } }, "scanner-result": { "type": "object", "properties": { "total": { "type": "integer" }, "size": { "type": "integer" }, "offset": { "type": "integer" }, "scanTime": { "type": "string" }, "id": { "type": "number" }, "position": { "type": "string" }, "Contracts": { "type": "object", "description": "Contains list of contracts matching the scanner query", "properties": { "Contract": { "type": "array", "items": { "type": "object", "properties": { "inScanTime": { "type": "string" }, "distance": { "type": "integer" }, "contractID": { "type": "integer" } } } } } } } }, "performance": { "type": "object", "properties": { "id": { "type": "string" }, "cps": { "type": "object", "description": "Cumulative performance data", "properties": { "dates": { "type": "array", "description": "array of dates, the length should be same as the length of returns inside data.", "items": { "type": "string", "description": "format-- yyyyMMdd" } }, "freq": { "type": "string", "description": "D means Day" }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "idType": { "type": "string", "description": "for example-- acctid" }, "start": { "type": "string", "description": "start date-- yyyyMMdd" }, "baseCurrency": { "type": "string" }, "returns": { "type": "array", "description": "each value stands for price change percent of corresponding date in dates array", "items": { "type": "number" } }, "end": { "type": "string", "description": "end date-- yyyyMMdd" } } } } } }, "tpps": { "type": "object", "description": "Time period performance data", "properties": { "dates": { "type": "array", "description": "array of dates, the length should be same as the length of returns inside data.", "items": { "type": "string", "description": "format-- yyyyMMdd" } }, "freq": { "type": "string", "description": "M means Month" }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "idType": { "type": "string", "description": "for example-- acctid" }, "start": { "type": "string", "description": "start date-- yyyyMMdd" }, "baseCurrency": { "type": "string" }, "returns": { "type": "array", "description": "each value stands for price change percent of corresponding date in dates array", "items": { "type": "number" } }, "end": { "type": "string", "description": "end date-- yyyyMMdd" } } } } } }, "nav": { "type": "object", "description": "Net asset value data for the account or consolidated accounts. NAV data is not applicable to benchmarks.", "properties": { "dates": { "type": "array", "description": "array of dates, the length should be same as the length of returns inside data.", "items": { "type": "string", "description": "format--yyyyMMdd" } }, "freq": { "type": "string", "description": "D means Day" }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "idType": { "type": "string", "description": "for example-- acctid" }, "start": { "type": "string", "description": "start date-- yyyyMMdd" }, "baseCurrency": { "type": "string" }, "returns": { "type": "array", "description": "each value stands for price change percent of corresponding date in dates array", "items": { "type": "number" } }, "end": { "type": "string", "description": "end date-- yyyyMMdd" } } } } } }, "pm": { "type": "string" }, "included": { "type": "array", "items": { "type": "string", "description": "account id" } }, "currencyType": { "type": "string" }, "rc": { "type": "integer" } } }, "summary": { "type": "object", "properties": { "amount": { "type": "number" }, "currency": { "type": "string" }, "isNull": { "type": "boolean" }, "timestamp": { "type": "integer" }, "value": { "type": "string" } } }, "transactions": { "type": "object", "description": "account transactions", "properties": { "id": { "type": "string", "description": "will always be getTransactions" }, "currency": { "type": "string", "description": "same as request" }, "includesRealTime": { "type": "boolean", "description": "Indicates whether current day and realtime data is included in the result" }, "from": { "type": "number", "description": "Period start date. Epoch time, GMT" }, "to": { "type": "number", "description": "Period end date. Epoch time, GMT" }, "transactions": { "description": "Sorted by date descending", "type": "array", "items": { "type": "object", "properties": { "acctid": { "type": "string" }, "conid": { "type": "number" }, "cur": { "type": "string", "description": "currency code" }, "fxRate": { "type": "number", "description": "Conversion rate from asset currency to response currency" }, "desc": { "type": "string", "description": "Transaction description" }, "date": { "type": "string", "description": "Date of transaction. Epoch time, GMT" }, "type": { "type": "string", "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" }, "qty": { "type": "number", "description": "Not applicable for all transaction types" }, "pr": { "type": "number", "description": "In asset currency. Not be applicable for all transaction types." }, "amt": { "type": "number", "description": "Raw value, no formatting. Net transaction amount (may include commission, tax).\nIn asset currency" } } } } } }, "position": { "type": "array", "items": { "type": "object", "description": "Account Information", "properties": { "acctId": { "type": "string" }, "conid": { "type": "integer" }, "contractDesc": { "type": "string" }, "assetClass": { "type": "string" }, "position": { "type": "number" }, "mktPrice": { "type": "number" }, "mktValue": { "type": "number" }, "currency": { "type": "string" }, "avgCost": { "type": "number" }, "avgPrice": { "type": "number" }, "realizedPnl": { "type": "number" }, "unrealizedPnl": { "type": "number" }, "exchs": { "type": "string" }, "expiry": { "type": "string" }, "putOrCall": { "type": "string" }, "multiplier": { "type": "number" }, "strike": { "type": "number" }, "exerciseStyle": { "type": "string" }, "undConid": { "type": "integer" }, "conExchMap": { "type": "array", "items": { "type": "string" } }, "baseMktValue": { "type": "number" }, "baseMktPrice": { "type": "number" }, "baseAvgCost": { "type": "number" }, "baseAvgPrice": { "type": "number" }, "baseRealizedPnl": { "type": "number" }, "baseUnrealizedPnl": { "type": "number" }, "name": { "type": "string" }, "lastTradingDay": { "type": "string" }, "group": { "type": "string" }, "sector": { "type": "string" }, "sectorGroup": { "type": "string" }, "ticker": { "type": "string" }, "undComp": { "type": "string" }, "undSym": { "type": "string" }, "fullName": { "type": "string" }, "pageSize": { "type": "integer" }, "model": { "type": "string" } } } }, "allocation": { "type": "array", "items": { "type": "object", "description": "allocation", "properties": { "assetClass": { "type": "object", "description": "portfolio allocation by asset class", "properties": { "long": { "type": "object", "description": "long positions allocation", "properties": { "STK": { "type": "number" }, "OPT": { "type": "number" }, "FUT": { "type": "number" }, "WAR": { "type": "number" }, "BOND": { "type": "number" }, "CASH": { "type": "number" } } }, "short": { "type": "object", "description": "short positions allocation", "properties": { "STK": { "type": "number" }, "OPT": { "type": "number" }, "FUT": { "type": "number" }, "WAR": { "type": "number" }, "BOND": { "type": "number" }, "CASH": { "type": "number" } } } } }, "sector": { "type": "object", "description": "portfolio allocation by sector", "properties": { "long": { "type": "object", "description": "long positions allocation", "properties": { "Others": { "type": "number" }, "Utilities": { "type": "number" }, "Energy": { "type": "number" }, "Technology": { "type": "number" }, "Financial": { "type": "number" }, "Communications": { "type": "number" } } }, "short": { "type": "object", "description": "short positions allocation", "properties": { "Industrial": { "type": "number" }, "Consumer": { "type": "number" }, "Diversified": { "type": "number" } } } } }, "group": { "type": "object", "description": "portfolio allocation by group", "properties": { "long": { "type": "object", "description": "long positions allocation", "properties": { "Computers": { "type": "number" }, "Semiconductors": { "type": "number" }, "Others": { "type": "number" }, "Chemicals": { "type": "number" }, "Apparel": { "type": "number" }, "Communications": { "type": "number" } } }, "short": { "type": "object", "description": "short positions allocation", "properties": { "Banks": { "type": "number" }, "Airlines": { "type": "number" }, "Internet": { "type": "number" } } } } } } } }, "accounts": { "type": "array", "items": { "$ref": "#/definitions/account" } }, "account": { "type": "object", "description": "account information", "properties": { "id": { "type": "string", "description": "The account identification value" }, "accountId": { "type": "string", "description": "The account number", "example": "U12345678 for Individual Live Accounts, DU12345678 for Individual Paper Accounts" }, "accountVan": { "type": "string", "description": "The accountAlias" }, "accountTitle": { "type": "string", "description": "Title of the account" }, "displayName": { "type": "string", "description": "Whichever value is not null in this priority", "enum": [ "accountTitle", "accountVan", "accountId" ] }, "accountAlias": { "type": "string", "description": "User customizable account alias. Refer to [Configure Account Alias](https://guides.interactivebrokers.com/cp/cp.htm#am/settings/accountalias.htm) for details." }, "accountStatus": { "type": "number", "description": "When the account was opened in unix time." }, "currency": { "type": "string", "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": { "type": "string", "description": "Account Type", "enum": [ "INDIVIDUAL", "JOINT", "ORG", "TRUST", "DEMO" ] }, "tradingType": { "type": "string", "description": "UNI - Deprecated property" }, "faclient": { "type": "boolean", "description": "If an account is a sub-account to a Financial Advisor." }, "clearingStatus": { "type": "string", "enum": [ "O", "P", "N", "A", "R", "C" ], "description": "Status of the Account\n * O = Open\n * P or N = Pending\n * A = Abandoned\n * R = Rejected\n * C = Closed\n" }, "covestor": { "type": "boolean", "description": "Is a Covestor Account" }, "parent": { "type": "object", "properties": { "mmc": { "type": "array", "items": { "type": "string", "description": "Money Manager Client (MMC) Account" } }, "accountId": { "type": "string", "description": "Account Number for Money Manager Client" }, "isMParent": { "type": "boolean", "description": "Is MM a Parent Account" }, "isMChild": { "type": "boolean", "description": "Is MM a Child Account" }, "isMultiplex": { "type": "boolean", "description": "Is a Multiplex Account. These are account models with individual account being parent and managed account being child." } } }, "desc": { "type": "string", "description": "Formatted \"accountId - accountAlias\"" } } }, "ledger": { "type": "object", "properties": { "commoditymarketvalue": { "type": "number" }, "futuremarketvalue": { "type": "number" }, "settledcash": { "type": "number" }, "exchangerate": { "type": "number" }, "sessionid": { "type": "integer" }, "cashbalance": { "type": "number" }, "corporatebondsmarketvalue": { "type": "number" }, "warrantsmarketvalue": { "type": "number" }, "netliquidationvalue": { "type": "number" }, "interest": { "type": "number" }, "unrealizedpnl": { "type": "number" }, "stockmarketvalue": { "type": "number" }, "moneyfunds": { "type": "number" }, "currency": { "type": "string" }, "realizedpnl": { "type": "number" }, "funds": { "type": "number" }, "acctcode": { "type": "string" }, "issueroptionsmarketvalue": { "type": "number" }, "key": { "type": "string" }, "timestamp": { "type": "integer" }, "severity": { "type": "integer" } } }, "alert-request": { "type": "object", "properties": { "orderId": { "description": "orderId is required when modifying alert. You can get it from /iserver/account/:accountId/alerts\n", "type": "integer" }, "alertName": { "description": "name of alert", "type": "string" }, "alertMessage": { "type": "string", "description": "The message you want to receive via email or text message" }, "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" }, "email": { "description": "email address to receive alert", "type": "string" }, "sendMessage": { "description": "whether allowing to send email or not, so value can only be 0 or 1,\n", "type": "integer" }, "tif": { "description": "time in force, can only be GTC or GTD", "type": "string" }, "expireTime": { "description": "format, YYYYMMDD-HH:mm:ss, please NOTE this will only work when tif is GTD\n", "type": "string", "example": "20201105-19:51:14" }, "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" }, "iTWSOrdersOnly": { "description": "value can only be 0 or 1, set to 1 to enable the alert only in IBKR mobile\n", "type": "integer" }, "showPopup": { "type": "integer", "description": "value can only be 0 or 1, set to 1 to allow to show alert in pop-ups" }, "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" }, "playAudio": { "description": "audio message to play when alert is triggered", "type": "string" }, "conditions": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "integer", "description": "Types: 1-Price, 3-Time, 4-Margin, 5-Trade, 6-Volume, 7: MTA market 8: MTA Position, 9: MTA Acc. Daily PN&\n" }, "conidex": { "type": "string", "description": "conid and exchange. Format supports conid or conid@exchange", "example": "8314@SMART" }, "operator": { "type": "string", "description": "optional, operator for the current condition, can be >= or <=", "example": ">=" }, "triggerMethod": { "type": "string", "description": "optional, only some type of conditions have triggerMethod", "example": "0" }, "value": { "type": "string", "description": "can not be empty, can pass default value \"*\"", "example": "220" }, "logicBind": { "type": "string", "description": "\"a\" means \"AND\", \"o\" means \"OR\", \"n\" means \"END\",\nthe last one condition in the condition array should \"n\"\n" }, "timeZone": { "type": "string", "description": "only needed for some MTA alert condition" } } } } } }, "alert-response": { "type": "object", "properties": { "account": { "description": "account id", "type": "string" }, "order_id": { "type": "integer" }, "alert_name": { "description": "name of alert", "type": "string" }, "alert_message": { "type": "string", "description": "The message you want to receive via email or text message" }, "alert_active": { "description": "whether alert is active or not, so value can only be 0 or 1", "type": "integer" }, "alert_repeatable": { "description": "whether alert is repeatable or not, so value can only be 0 or 1", "type": "integer" }, "alert_email": { "description": "email address to receive alert", "type": "string" }, "alert_send_message": { "description": "whether allowing to send email or not, so value can only be 0 or 1,\n", "type": "integer" }, "tif": { "description": "time in force, can only be GTC or GTD", "type": "string" }, "expire_time": { "description": "format, YYYYMMDD-HH:mm:ss\n", "type": "string", "example": "20201105-19:51:14" }, "order_status": { "description": "status of alert", "type": "string", "example": "Submitted" }, "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" }, "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" }, "alert_show_popup": { "type": "integer", "description": "value can only be 0 or 1, set to 1 to allow to show alert in pop-ups" }, "alert_triggered": { "type": "boolean", "description": "whether the alert has been triggered" }, "order_not_editable": { "type": "boolean", "description": "whether the alert can be edited" }, "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" }, "alert_play_audio": { "description": "audio message to play when alert is triggered", "type": "string" }, "alert_mta_currency": { "description": "MTA alert only", "type": "string" }, "alert_mta_defaults": { "description": "MTA alert only", "type": "string" }, "time_zone": { "description": "MTA alert only", "type": "string" }, "alert_default_type": { "description": "MTA alert only", "type": "string" }, "condition_size": { "type": "integer", "description": "size of conditions array" }, "condition_outside_rth": { "type": "integer", "description": "whether allowing the condition can be triggered outside of regular trading hours, 1 means allow" }, "conditions": { "type": "array", "items": { "type": "object", "properties": { "condition_type": { "type": "integer", "description": "Types: 1-Price, 3-Time, 4-Margin, 5-Trade, 6-Volume, 7: MTA market 8: MTA Position, 9: MTA Acc. Daily PN&\n" }, "conidex": { "type": "string", "description": "conid and exchange. Format supports conid or conid@exchange", "example": "8314@SMART" }, "contract_description_1": { "type": "string", "description": "Format contract name", "example": "FB Stock (NASDAQ.NMS)" }, "condition_operator": { "type": "string", "example": "- >= - <=\n", "description": "optional, operator for the current condition\n * >= Greater than or equal to\n * <= Less than or equal to\n" }, "condition_trigger_method": { "type": "string", "description": "optional, only some type of conditions have triggerMethod", "example": "0" }, "condition_value": { "type": "string", "description": "can not be empty, can pass default value \"*\"", "example": "220" }, "condition_logic_bind": { "type": "string", "description": "Condition array should end with \"n\"\n * a - AND\n * o - OR\n * n - END\n" }, "condition_time_zone": { "type": "string", "description": "only needed for some MTA alert condition" } } } } } }, "authStatus": { "type": "object", "properties": { "authenticated": { "description": "Brokerage session is authenticated", "type": "boolean" }, "connected": { "description": "Connected to backend", "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" }, "fail": { "description": "Authentication failed, why.", "type": "string" }, "message": { "description": "System messages that may affect trading", "type": "string" }, "prompts": { "type": "array", "description": "Prompt messages that may affect trading or the account", "items": { "type": "string" } } } }, "contract": { "description": "Contains all details of the contract, including rules you can use when placing orders", "type": "object", "properties": { "r_t_h": { "type": "boolean", "description": "true means you can trade outside RTH(regular trading hours)" }, "con_id": { "type": "string", "description": "same as that in request" }, "company_name": { "type": "string", "description": "Contracts company name" }, "exchange": { "type": "string" }, "local_symbol": { "type": "string", "description": "for exmple FB" }, "instrument_type": { "type": "string", "description": "for example STK" }, "currency": { "type": "string" }, "companyName": { "type": "string" }, "category": { "type": "string" }, "industry": { "type": "string" }, "rules": { "type": "object", "properties": { "orderTypes": { "type": "array", "items": { "type": "string", "description": "store available order types for this contract" } }, "orderTypesOutside": { "type": "array", "items": { "type": "string", "description": "store available order types for this contract outside regular hours" } }, "defaultSize": { "type": "number", "description": "default quantity you can use to place an order" }, "sizeIncrement": { "type": "number" }, "tifTypes": { "type": "array", "items": { "type": "string", "description": "store available time-in-force types" } }, "limitPrice": { "type": "number", "description": "default limit price you can use to prefill your order" }, "stopprice": { "type": "number", "description": "default stop price you can use to prefill your order" }, "preview": { "type": "boolean", "description": "if you can preview the order or not with the whatif endpoint" }, "displaySize": { "type": "string" }, "increment": { "type": "string" } } } } }, "secdef-info": { "description": "Contains some basic info of contract", "type": "object", "properties": { "conid": { "type": "number", "description": "IBKR contract identifier" }, "symbol": { "type": "string", "description": "Underlying symbol" }, "secType": { "type": "string", "description": "Security type" }, "exchange": { "type": "string", "description": "Primary Exchange, Routing or Trading Venue" }, "listingExchange": { "type": "string", "description": "Main Trading Venue" }, "right": { "type": "string", "description": "Put or Call of the option. C = Call Option, P = Put Option" }, "strike": { "type": "number", "description": "Set price at which a derivative contract can be bought or sold. The strike price also known as exercise price." }, "currency": { "type": "string", "description": "Currency the contract trades in" }, "cusip": { "type": "string", "description": "Committee on Uniform Securities Identification Procedures number" }, "coupon": { "type": "string", "description": "Annual interest rate paid on a bond" }, "desc1": { "type": "string", "description": "Currency pairs for Forex e.g. EUR.AUD, EUR.CAD, EUR.CHF etc." }, "desc2": { "type": "string", "description": "Formatted expiration, strike and right" }, "maturityDate": { "type": "number", "description": "Format YYYYMMDD, the date on which the underlying transaction settles if the option is exercised" }, "multiplier": { "type": "string", "description": "Multiplier for total premium paid or received for derivative contract." }, "tradingClass": { "type": "string", "description": "Designation of the contract." }, "validExchanges": { "type": "string", "description": "Comma separated list of exchanges or trading venues." } } }, "history-data": { "type": "object", "properties": { "symbol": { "type": "string", "description": "Underlying symbol" }, "text": { "type": "string", "description": "companyName" }, "priceFactor": { "type": "integer", "description": "priceFactor is price increment obtained from display rule", "example": 100 }, "startTime": { "type": "string", "description": "start date time in the format YYYYMMDD-HH:mm:ss" }, "high": { "type": "string", "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" }, "low": { "type": "string", "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" }, "timePeriod": { "type": "string", "description": "The duration for the historical data request" }, "barLength": { "type": "integer", "description": "The number of seconds in a bar" }, "mdAvailability": { "type": "string", "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" }, "mktDataDelay": { "type": "integer", "description": "The time it takes, in milliseconds, to process the historical data request" }, "outsideRth": { "type": "boolean", "description": "The historical data returned includes outside of regular trading hours\n" }, "tradingDayDuration": { "type": "integer", "description": "The number of seconds in the trading day" }, "volumeFactor": { "type": "integer" }, "priceDisplayRule": { "type": "integer" }, "priceDisplayValue": { "type": "string" }, "negativeCapable": { "type": "boolean" }, "messageVersion": { "type": "integer" }, "data": { "type": "array", "items": { "type": "object", "properties": { "o": { "type": "number", "description": "open price" }, "c": { "type": "number", "description": "close price" }, "h": { "type": "number", "description": "high price" }, "l": { "type": "number", "description": "low price" }, "v": { "type": "number", "description": "volume" }, "t": { "type": "number", "description": "unix time stamp" } } } }, "points": { "type": "integer", "description": "total number of points" }, "travelTime": { "type": "integer" } } }, "trade": { "type": "object", "properties": { "execution_id": { "type": "string", "description": "execution identifier for the order" }, "symbol": { "type": "string", "description": "Underlying Symbol" }, "side": { "type": "string", "enum": [ "B", "S", "X" ], "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" }, "order_description": { "type": "string", "description": "Formatted description of the order \"%side% %size% @ %price% on %exchange%\"." }, "trade_time": { "type": "string", "description": "Time of Status update in format \"YYYYMMDD-hh:mm:ss\"." }, "trade_time_r": { "type": "number", "description": "Time of status update in format unix time." }, "size": { "type": "string", "description": "Quantity of the order" }, "price": { "type": "string", "description": "Average Price" }, "order_ref": { "type": "string", "description": "User defined string used to identify the order. Value is set using \"cOID\" field while placing an order." }, "submitter": { "type": "string", "description": "User that submitted order" }, "exchange": { "type": "string", "description": "Exchange or venue of order" }, "commission": { "type": "number", "description": "Commission of the order" }, "net_amount": { "type": "number", "description": "Net cost of the order, including contract multiplier and quantity." }, "account": { "type": "string", "description": "accountCode" }, "acountCode": { "type": "string", "description": "Account Number" }, "company_name": { "type": "string", "description": "Contracts company name" }, "contract_description_1": { "type": "string", "description": "Format contract name", "example": "FB Stock (NASDAQ.NMS)" }, "sec_type": { "type": "string", "description": "Asset class", "example": "STK, FUT, OPT" }, "conid": { "type": "string", "description": "IBKR's contract identifier" }, "conidex": { "type": "string", "description": "conid and exchange. Format supports conid or conid@exchange" }, "position": { "type": "string", "description": "Total quantity owned for this contract" }, "clearing_id": { "type": "string", "description": "Firm which will settle the trade. For IBExecution customers only." }, "clearing_name": { "type": "string", "description": "Specifies the true beneficiary of the order. For IBExecution customers only." }, "liquidation_trade": { "type": "number", "description": "If order adds liquidity to the market." } } }, "modify-order": { "type": "object", "properties": { "acctId": { "type": "string" }, "conid": { "type": "integer" }, "orderType": { "type": "string", "description": "for example LMT" }, "outsideRTH": { "type": "boolean" }, "price": { "type": "number" }, "auxPrice": { "type": "number" }, "side": { "type": "string", "description": "SELL or BUY" }, "listingExchange": { "type": "string", "description": "optional, not required" }, "ticker": { "type": "string", "description": "The ticker symbol of the original place order" }, "tif": { "type": "string", "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" }, "quantity": { "type": "number", "description": "usually integer, for some special cases can be float numbers" }, "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" } } }, "order-request": { "type": "object", "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" }, "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" }, "conidex": { "description": "Conid and Exchange - Can be used instead of conid when specifying the contract identifier of a security.\n", "type": "string", "example": "conidex = 265598" }, "secType": { "type": "string", "description": "The contract-identifier (conid) and security type (type) specified as a concatenated value, conid:type", "example": "secType = 265598:STK" }, "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" }, "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" }, "orderType": { "description": "The order-type determines what type of order you want to send.\n * LMT - A limit order is an order to buy or sell at the specified price or better.\n * MKT - A market order is an order to buy or sell at the markets current NBBO.\n * STP - A stop order becomes a market order once the specified stop price is attained or penetrated.\n * STOP_LIMIT - A stop limit order becomes a limit order once the specified stop price is attained or penetrated.\n * MIDPRICE - A MidPrice order attempts to fill at the current midpoint of the NBBO or better.\n * TRAIL - A sell trailing stop order sets the stop price at a fixed amount below the market price with an attached \"trailing\" amount. See more details here: https://ndcdyn.interactivebrokers.com/en/index.php?f=605\n * TRAILLMT - A trailing stop limit order is designed to allow an investor to specify a limit on the maximum possible loss, without setting a limit on the maximum possible gain.\n See more details here: https://ndcdyn.interactivebrokers.com/en/index.php?f=606\n", "type": "string" }, "listingExchange": { "description": "listingExchange is optional. By default we use \"SMART\" routing. Possible values are available via the endpoint: /iserver/contract/{conid}/info,\nsee **valid_exchange** e.g: SMART,AMEX,NYSE,CBOE,ISE,CHX,ARCA,ISLAND,DRCTEDGE,BEX,BATS,EDGEA,CSFBALGO,JE FFALGO,BYX,IEX,FOXRIVER,TPLUS1,NYSENAT,PSX\n", "type": "string" }, "isSingleGroup": { "type": "boolean", "description": "set to true if you want to place a single group orders(OCA)\n" }, "outsideRTH": { "description": "set to true if the order can be executed outside regular trading hours.\n", "type": "boolean" }, "price": { "description": "optional if order is LMT, or STOP_LIMIT, this is the limit price. For STP|TRAIL this is the stop price. For MIDPRICE this is the option price cap.\n", "type": "number" }, "auxPrice": { "description": "optional if order is STOP_LIMIT|TRAILLMT, this is the stop price. You must specify both price and auxPrice for STOP_LIMIT|TRAILLMT orders.\n" }, "side": { "type": "string", "description": "SELL or BUY" }, "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" }, "trailingAmt": { "description": "optional if order is TRAIL, or TRAILLMT. When trailingType is amt, this is the trailing amount, when trailingType is %, it means percentage.\nYou must specify both trailingType and trailingAmt for TRAIL and TRAILLMT order\n", "type": "number" }, "trailingType": { "description": "This is the trailing type for trailing amount. We only support two types here: amt or %.\nYou must specify both trailingType and trailingAmt for TRAIL and TRAILLMT order\n", "example": "amt", "type": "string" }, "referrer": { "description": "Custom order reference\n", "example": "QuickTrade", "type": "string" }, "quantity": { "description": "Usually integer, for some special cases such as fractional orders can specify as a float, e.g. quantity = 0.001.\nIn some special cases quantity is not specified, such as when using 'cashQty' or 'fxQty'.\n", "type": "number" }, "cashQty": { "description": "Cash Quantity - used to specify the monetary value of an order instead of the number of shares. When using 'cashQty' don't specify 'quantity'\nOrders that express size using a monetary value, e.g. cash quantity can result in fractional shares and are provided on a non-guaranteed basis.\nThe system simulates the order by canceling it once the specified amount is spent (for buy orders) or collected (for sell orders).\nIn addition to the monetary value, the order uses a maximum size that is calculated using the Cash Quantity Estimated Factor, which can be modified in Order Presets. \n", "type": "number" }, "fxQty": { "description": "double number, this is the cash quantity field which can only be used for Currency Conversion Orders. When using 'fxQty' don't specify 'quantity'.\n", "type": "number" }, "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" }, "isCcyConv": { "description": "set to true if the order is a FX conversion order\n", "type": "boolean" }, "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" }, "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" } } }, "order": { "description": "contains all the order related info", "type": "object", "properties": { "acct": { "type": "string", "description": "account id" }, "conid": { "type": "integer" }, "orderDesc": { "type": "string" }, "description1": { "type": "string" }, "ticker": { "type": "string", "description": "for example FB" }, "secType": { "type": "string", "description": "for example STK" }, "listingExchange": { "type": "string", "description": "for example NASDAQ.NMS" }, "remainingQuantity": { "type": "string" }, "filledQuantity": { "type": "string" }, "companyName": { "type": "string" }, "status": { "type": "string", "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" }, "origOrderType": { "type": "string", "description": "for example Limit" }, "side": { "type": "string", "description": "BUY or SELL" }, "price": { "type": "number" }, "bgColor": { "type": "string", "description": "back-ground color" }, "fgColor": { "type": "string" }, "orderId": { "type": "integer" }, "parentId": { "description": "Only exists in child order of bracket", "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" } } }, "order-status": { "description": "contains all the details of an order", "type": "object", "properties": { "sub_type": { "type": "string", "description": "order sub-type" }, "request_id": { "type": "string", "description": "order request id" }, "order_id": { "type": "integer", "description": "system generated order id, unique per account" }, "conidex": { "type": "string", "description": "conid and exchange. Format supports conid or conid@exchange" }, "symbol": { "type": "string", "description": "Underlying symbol" }, "side": { "type": "string", "enum": [ "B", "S", "X" ], "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" }, "contract_description_1": { "type": "string", "description": "Format contract name", "example": "FB Stock (NASDAQ.NMS)" }, "listing_exchange": { "type": "string", "description": "Trading Exchange or Venue", "example": "NASDAQ.NMS" }, "option_acct": { "type": "string" }, "company_name": { "type": "string", "description": "Contracts company name", "example": "APPLE INC" }, "size": { "type": "string", "description": "Quantity updated" }, "total_size": { "type": "string", "description": "Total quantity" }, "currency": { "type": "string", "description": "Contract traded currency" }, "account": { "type": "string", "description": "account id" }, "order_type": { "type": "string", "description": "Types of orders", "example": "LIMIT" }, "limit_price": { "type": "string", "description": "Limit price" }, "stop_price": { "type": "string", "description": "Stop price" }, "cum_fill": { "type": "string", "description": "Cumulative fill" }, "order_status": { "type": "string", "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" }, "order_status_description": { "type": "string", "description": "Description of the order status" }, "tif": { "type": "string", "description": "Time-in-Force - length of time order will continue working before it is canceled." }, "fg_color": { "type": "string", "description": "Foreground color in hex format" }, "bg_color": { "type": "string", "description": "Background color in hex format" }, "order_not_editable": { "type": "boolean", "description": "If true not allowed to modify order" }, "editable_fields": { "type": "string", "description": "Fields that can be edited in escaped unicode characters", "example": "\\u001E" }, "cannot_cancel_order": { "type": "boolean", "description": "If true not allowed to cancel order" }, "outside_rth": { "type": "boolean", "description": "If true order trades outside regular trading hours" }, "deactivate_order": { "type": "boolean", "description": "If true order is de-activated" }, "use_price_mgmt_algo": { "type": "boolean", "description": "If true price management algo is enabled, refer to https://www.interactivebrokers.com/en/index.php?f=43423" }, "sec_type": { "type": "string", "description": "Asset class", "example": "STK" }, "available_chart_periods": { "type": "string", "description": "List of available chart periods" }, "order_description": { "type": "string", "description": "Format description of order", "example": "BUY 100 LIMIT 125.0 DAY" }, "order_description_with_contract": { "type": "string", "description": "order_description with the symbol", "example": "BUY 100 AAPL LIMIT 125.0 DAY" }, "alert_active": { "type": "integer" }, "child_order_type": { "type": "string", "description": "type of the child order", "example": "A=attached, B=beta-hedge, etc" }, "size_and_fills": { "type": "string", "description": "Format fillQuantity\\totalQuantity", "example": "0/9" }, "exit_strategy_display_price": { "type": "string", "description": "Position display price" }, "exit_strategy_chart_description": { "type": "string", "description": "Position description to display on chart" }, "exit_strategy_tool_availability": { "type": "string", "enum": [ 1, 0 ], "description": "* 1: If your account has position or order for contract * 0: If your account has no position or order for contract\n" }, "allowed_duplicate_opposite": { "type": "boolean", "description": "Returns true if contract supports duplicate/opposite side order." }, "order_time": { "type": "string", "description": "Time of status update in unix time" }, "oca_group_id": { "type": "string", "description": "only exists for oca orders, oca orders in same group will have same id" } } }, "set-account": { "type": "object", "properties": { "acctId": { "type": "string", "description": "Account ID" } } }, "system-error": { "type": "object", "properties": { "error": { "type": "string" } } } } }