{ "basePath": "/v1/api", "host": "localhost:5000", "produces": [ "application/json" ], "schemes": [ "https" ], "swagger": "2.0", "info": { "title": "Client Portal Web API", "description": "Client Portal Web API", "version": "1.0.0" }, "paths": { "/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" } } } } } } }, "/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" } } } } }, "/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": "body", "name": "body", "description": "an array of filters", "schema": { "type": "object", "properties": { "filters": { "type": "array", "items": { "type": "string", "description": "Only return list of orders for filter value. More than one filter can be specified comma separated. \nAcceptable values are inactive,pending_submit,pre_submitted,submitted,filled,pending_cancel,cancelled,warn_state,sort_by_time.\n" } } } } } ], "responses": { "200": { "description": "An object contains two arrays", "schema": { "type": "object", "properties": { "orders": { "type": "array", "items": { "type": "object", "properties": { "acct": { "type": "string", "description": "Account number" }, "exchange": { "type": "string", "description": "Exchange or trading venue" }, "conid": { "type": "number", "description": "Contract identifier" }, "orderId": { "type": "string", "description": "Order identifier" }, "cashCcy": { "type": "string", "description": "Cash currency" }, "sizeAndFills": { "type": "number", "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", "description": "Side of order" }, "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", "description": "Please 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 (Support bracket orders)", "description": "You can pass a list of orders here\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 Financial Advisor Groups", "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", "description": "This 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}/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" }, "55": { "type": "string", "description": "Symbol" }, "58": { "type": "string", "description": "Text" }, "70": { "type": "string", "description": "High" }, "71": { "type": "string", "description": "Low" }, "72": { "type": "string", "description": "Position" }, "73": { "type": "string", "description": "Market Value" }, "74": { "type": "string", "description": "Average Price" }, "75": { "description": "Unrealized PnL", "type": "string" }, "76": { "description": "Formatted position", "type": "string" }, "77": { "description": "Formatted Unrealized PnL", "type": "string" }, "78": { "description": "Daily PnL", "type": "string" }, "82": { "type": "string", "description": "Change Price" }, "83": { "type": "string", "description": "Change Percent" }, "84": { "type": "string", "description": "Bid Price" }, "85": { "type": "string", "description": "Ask Size" }, "86": { "type": "string", "description": "Ask Price" }, "87": { "type": "string", "description": "Volume" }, "88": { "type": "string", "description": "Bid Size" }, "6004": { "type": "string", "description": "Exchange" }, "6008": { "type": "string", "description": "Conid" }, "6070": { "type": "string", "description": "Security Type" }, "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": "string", "description": "Underlying Conid. Use /trsrv/secdef to get more information about the security" }, "6509": { "type": "string", "description": "Market Data Availability. The field may contain two chars. The first char is the primary code: R = Realtime, D = Delayed,\nZ = Frozen, Y = Frozen Delayed. The second char is the secondary code: P = Snapshot Available, p = Consolidated.\n" }, "7051": { "type": "string", "description": "Company name" }, "7059": { "type": "string", "description": "Last Size" }, "7094": { "type": "string", "description": "Conid + Exchange" }, "7219": { "type": "string", "description": "Contract Description" }, "7220": { "type": "string", "description": "Contract Description" }, "7221": { "type": "string", "description": "Listing Exchange" }, "7280": { "type": "string", "description": "Industry" }, "7281": { "type": "string", "description": "Category" }, "7282": { "type": "string", "description": "Average Daily Volume" }, "7633": { "type": "string", "description": "Implied volatility of the option" }, "7284": { "type": "string", "description": "Historic Volume (30d)" }, "7285": { "type": "string", "description": "Put/Call Ratio" }, "7286": { "type": "string", "description": "Dividend Amount" }, "7287": { "type": "string", "description": "Dividend Yield %" }, "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" }, "7293": { "type": "string", "description": "52 Week High" }, "7294": { "type": "string", "description": "52 Week Low" }, "7295": { "type": "string", "description": "Open Price" }, "7296": { "type": "string", "description": "Close Price" }, "7308": { "type": "string", "description": "Delta" }, "7309": { "type": "string", "description": "Gamma" }, "7310": { "type": "string", "description": "Theta" }, "7311": { "type": "string", "description": "Vega" } } } } }, "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 canceled", "schema": { "type": "object", "properties": { "confirmed": { "description": "success means market data was canceled.", "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 canceled", "schema": { "type": "object", "properties": { "confirmed": { "description": "true means market data is canceled, 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 or company name. Relays back what derivative contract(s) it has. This endpoint must be called before using /secdef/info", "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": { "type": "string", "description": "Exchange" }, "restricted": { "type": "string" }, "fop": { "type": "string" }, "opt": { "type": "string" }, "war": { "type": "string" }, "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" }, "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 available contract months and exchanges use \"/iserver/secdef/search\"", "tags": [ "Contract" ], "parameters": [ { "in": "query", "name": "conid", "description": "contract id", "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" } }, "put": { "type": "array", "items": { "type": "string" } } } } }, "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": "string" }, { "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}/info-and-rules": { "get": { "summary": "Info and Rules", "description": "Returns trading related rules and info for contract", "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 for contract" }, "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": { "error": { "type": "string" }, "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 cqt 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": "run scanner to get a list of contracts", "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" }, "conidex": { "type": "string" }, "con_id": { "type": "number" }, "available_chart_periods": { "type": "string" }, "company_name": { "type": "string" }, "contract_description_1": { "type": "string" }, "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" } } } } } } }, "/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" } ], "responses": { "200": { "description": "Returns an object", "schema": { "type": "object", "properties": { "id": { "type": "string" }, "tradeVenueId": { "description": "null is returned.", "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" } } } } } } }, "/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 sub-accounts for which the user can view position and account-related information. This endpoint must be called prior to calling other /portfolio endpoints for those subaccounts. To query a list of accounts the user can trade, see /iserver/accounts.", "tags": [ "Account", "Portfolio" ], "responses": { "200": { "description": "An array", "schema": { "$ref": "#/definitions/account" } } } } }, "/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" } } } } } } }, "/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" } } } } } } }, "/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", "description": "Returns a summary of all account balances 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" } } } } } ], "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", "description": "optional, default value is 90" } } } } ], "responses": { "200": { "description": "returns an object", "schema": { "$ref": "#/definitions/transactions" } } } } }, "/ibcust/entity/info": { "get": { "summary": "IBCust Entity Info", "description": "Returns Applicant Id with all owner related entities", "tags": [ "IBCust" ], "responses": { "200": { "description": "Search result", "schema": { "type": "array", "items": { "type": "object", "properties": { "applicantId": { "type": "number" }, "entities": { "type": "array", "items": { "type": "object", "properties": { "canTrade": { "type": "boolean" }, "canSign": { "type": "boolean" }, "type": { "type": "string" }, "name": { "type": "object", "properties": { "salutation": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" } } }, "address": { "type": "object", "properties": { "street": { "type": "string" }, "street2": { "type": "string" }, "city": { "type": "string" }, "state": { "type": "string" }, "postalCode": { "type": "string" }, "country": { "type": "string" }, "countryCode": { "type": "string" }, "compact": { "type": "string" } } }, "identDocs": { "type": "array", "items": { "type": "object", "items": { "type": "object", "properties": { "country": { "type": "string" }, "state": { "type": "string" }, "type": { "type": "string" }, "value": { "type": "string" } } } } } } } } } } } } } } } }, "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" } } } }, "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": "format, 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": "format, conid@exchange", "example": "8314@SMART" }, "contract_description_1": { "type": "string", "example": "FB Stock (NASDAQ.NMS)" }, "condition_operator": { "type": "string", "description": "optional, operator for the current condition, can be >= or <=", "example": ">=" }, "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": "\"a\" means \"AND\", \"o\" means \"OR\", \"n\" means \"END\",\nthe last one condition in the condition array should \"n\"\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" }, "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" }, "symbol": { "type": "string", "description": "For example IBKR" }, "secType": { "type": "string" }, "exchange": { "type": "string" }, "listingExchange": { "type": "string" }, "right": { "type": "string", "description": "C = Call Option, P = Put Option" }, "strike": { "type": "string", "description": "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": "Formatted symbol" }, "desc2": { "type": "string", "description": "Formatted expiration, strike and right" }, "maturityDate": { "type": "string", "description": "Format YYYYMMDD, the date on which the underlying transaction settles if the option is exercised" }, "multiplier": { "type": "string", "description": "total premium paid or received for an option contract" }, "tradingClass": { "type": "string" }, "validExchanges": { "type": "string" } } }, "history-data": { "type": "object", "properties": { "symbol": { "type": "string", "description": "Underlying Symbol of the corresponding contract" }, "text": { "type": "string", "description": "companyName of the corresponding contract" }, "priceFactor": { "type": "integer", "description": "priceFactor is price increment obtained from display rule" }, "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" }, "symbol": { "type": "string" }, "side": { "type": "string" }, "order_description": { "type": "string" }, "trade_time": { "type": "string" }, "trade_time_r": { "type": "number" }, "size": { "type": "string" }, "price": { "type": "string" }, "submitter": { "type": "string" }, "exchange": { "type": "string" }, "comission": { "type": "number" }, "net_amount": { "type": "number" }, "account": { "type": "string" }, "company_name": { "type": "string" }, "contract_description_1": { "type": "string" }, "sec_type": { "type": "string" }, "conidex": { "type": "string" }, "position": { "type": "string" }, "clearing_id": { "type": "string" }, "clearing_name": { "type": "string" }, "order_ref": { "description": "User defined string used to identify the order. Value is set using \"cOID\" field while placing an order.", "type": "string" } } }, "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" }, "tif": { "type": "string", "description": "for example DAY" }, "quantity": { "type": "number", "description": "usually integer, for some special cases can be float numbers" } } }, "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" }, "secType": { "type": "string", "description": "conid:type for example 265598:STK" }, "cOID": { "description": "Customer Order ID. An arbitraty 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": "When placing bracket orders, the child parentId must be equal to the cOId (customer order id) of the parent.\n", "type": "string" }, "orderType": { "description": "orderType can be one of MKT (Market), LMT (Limit), STP (Stop) or STP_LIMIT (stop limit)\n", "type": "string" }, "listingExchange": { "description": "listingExchange is optional. By default we use \"SMART\" routing. Possible values are available via this end\npoint: /v1/portal/iserver/contract/{{conid}}/info, see valid_exchange: e.g: SMART,AMEX,NYSE,\nCBOE,ISE,CHX,ARCA,ISLAND,DRCTEDGE,BEX,BATS,EDGEA,CSFBALGO,JE FFALGO,BYX,IEX,FOXRIVER,TPLUS1,NYSENAT,PSX\n", "type": "string" }, "outsideRTH": { "description": "set to true if the order can be executed outside regular trading hours.\n", "type": "boolean" }, "price": { "description": "optional if order is MKT, for LMT, this is the limit price. For STP this is the stop price.\n", "type": "number" }, "side": { "type": "string", "description": "SELL or BUY" }, "ticker": { "description": "", "type": "string" }, "tif": { "description": "GTC (Good Till Cancel) or DAY. DAY orders are automatically cancelled at the end of the Day or Trading hours.\n", "type": "string" }, "referrer": { "description": "for example QuickTrade", "type": "string" }, "quantity": { "description": "usually integer, for some special cases can be float numbers", "type": "number" }, "fxQty": { "description": "double number, this is the cash quantity field which can only be used for FX conversion order.\n", "type": "number" }, "useAdaptive": { "description": "If true, the system will use the Adaptive Algo to submit the order\nhttps://www.interactivebrokers.com/en/index.php?f=19091\n", "type": "boolean" }, "isCurrencyConversion": { "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" } } }, "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 exmple 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.\nPendingCancel - 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. \nSubmitted - 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. \nFilled - 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" } } }, "scanner-params": { "type": "object", "properties": { "InstrumentList": { "type": "object", "description": "Contains list of instruments for which scanner can be ran", "properties": { "Instrument": { "type": "array", "description": "Contains information like name, supported filters, etc. for an instrument", "items": { "type": "object", "properties": { "type": { "type": "string", "description": "Type of the asset" }, "name": { "type": "string", "description": "Display name for the instrument" }, "shortName": { "type": "string" }, "secType": { "type": "string", "description": "Sec Type of the instrument. This field is not provided if its value is same as 'type'" }, "filters": { "type": "string", "description": "Supported filters for the instrument separated by a comma" } } } } } }, "LocationTree": { "type": "object", "description": "Contains list of instruments for which scanner can be ran", "properties": { "Location": { "type": "array", "description": "Contains information like name, supported filters, etc. for an instrument. A location can contain more locations forming a tree-like structure which allows user to control the lcoation at more granular level. locationCode has to be used to specify lcoations while querying a scanner.", "items": { "type": "object", "properties": { "instruments": { "type": "string" }, "displayName": { "type": "string" }, "locationCode": { "type": "string" }, "routeExchange": { "type": "string" } } } } } }, "FilterList": { "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." } }, "ScanTypeList": { "type": "object", "description": "Contains list of scan types for which scanner can be ran", "properties": { "ScanType": { "type": "array", "items": { "type": "object", "properties": { "instruments": { "type": "string", "description": "Instrument types separated by a comma which are supported for this scan type" }, "displayName": { "type": "string" }, "scanCode": { "type": "string", "description": "scan code which ahs to be provided while querying scanner with this scan type" } } } } } } } }, "set-account": { "type": "object", "properties": { "acctId": { "type": "string", "description": "Account ID" } } }, "system-error": { "type": "object", "properties": { "error": { "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" }, "name": { "type": "string" }, "assetClass": { "type": "string" }, "expiry": { "type": "string" }, "lastTradingDay": { "type": "string" }, "group": { "type": "string" }, "putOrCall": { "type": "string" }, "sector": { "type": "string" }, "sectorGroup": { "type": "string" }, "strike": { "type": "number" }, "ticker": { "type": "string" }, "undConid": { "type": "integer" }, "fullName": { "type": "string" }, "pageSize": { "type": "integer" } } } }, "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" } } } } } } }, "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" }, "accountId": { "type": "string" }, "accountVan": { "type": "string" }, "accountTitle": { "type": "string" }, "displayName": { "type": "string" }, "accountAlias": { "type": "string" }, "accountStatus": { "type": "number" }, "currency": { "type": "string" }, "type": { "type": "string" }, "tradingType": { "type": "string" }, "faclient": { "type": "boolean" }, "parent": { "type": "string" }, "desc": { "type": "string" }, "covestor": { "type": "boolean" }, "master": { "type": "object", "properties": { "title": { "type": "string" }, "officialTitle": { "type": "string" } } } } }, "summary": { "type": "object", "description": "account information", "properties": { "total": { "type": "object", "properties": { "chg": { "type": "string", "description": "total change amount" }, "rtn": { "type": "string", "description": "change percent" }, "incompleteData": { "type": "boolean", "description": "set to true if any external account data is not available for starting or ending date, resulting in potentially unusual total values." }, "endVal": { "type": "string" }, "startVal": { "type": "string" } } }, "startDate": { "type": "string", "description": "date format-- yyyy-MM-dd" }, "excludedAccounts": { "type": "array", "items": { "type": "object", "properties": { "lastUpdateAttempt": { "type": "string" }, "fiName": { "type": "string" }, "acctTitle": { "type": "string" }, "acctNumAtFI": { "type": "string" }, "acctId": { "type": "string" }, "lastUpdate": { "type": "string" }, "harvestCode": { "type": "integer" }, "lastUpdateStatusCode": { "type": "string" }, "rc": { "type": "integer" } } } }, "lastSuccessfulUpdate": { "type": "string" }, "accountSummaries": { "type": "array", "items": { "type": "object", "properties": { "chg": { "type": "string" }, "hasAccounts": { "type": "string" }, "accountTypeName": { "type": "string" }, "rtn": { "type": "string" }, "endVal": { "type": "string" }, "accountTypeCode": { "type": "string" }, "startVal": { "type": "string" } } } }, "endDate": { "type": "string" }, "hasExternalAccounts": { "type": "boolean", "description": "indicator of user having configured any external accounts" }, "rc": { "type": "integer" }, "currency": { "type": "string" }, "userId": { "type": "string" }, "pm": { "type": "string" }, "view": { "type": "string" }, "balanceByDate": { "type": "object", "properties": { "series": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "groupId": { "type": "string" }, "name": { "type": "string" }, "date": { "type": "array", "items": { "type": "array", "items": { "type": "number" } } } } } } } } } }, "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" } } }, "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" } } } }, "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" } } }, "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" } } } } } }, "history-result": { "type": "object", "properties": { "bars": { "type": "object", "properties": { "open": { "type": "number" }, "high": { "type": "number" }, "low": { "type": "number" }, "close": { "type": "number" }, "volume": { "type": "number" }, "time": { "type": "string" }, "endTime": { "type": "string" }, "weightedAvg": { "type": "number" }, "count": { "type": "number" } } } } }, "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": { "Conid": { "description": "IBKR Contract ID", "type": "number" }, "Exchange": { "description": "Exchange", "type": "string" }, "minTick": { "type": "number" }, "Last": { "type": "number" }, "LastSize": { "type": "number" }, "Bid": { "type": "number" }, "BidSize": { "type": "number" }, "Ask": { "type": "number" }, "AskSize": { "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" } } } } } } } } } }