### Account Activities Response Format Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-activities Example JSON response structure for an account activities query. ```json { "activities": [ { "tradeDate": "2011-02-16T00:00:00.000000-05:00", "transactionDate": "2011-02-16T00:00:00.000000-05:00", "settlementDate": "2011-02-16T00:00:00.000000-05:00", "action": "", "symbol": "", "symbolId": 0, "description": "INT FR 02/04 THRU02/15@ 4 3/4%BAL 205,006 AVBAL 204,966", "currency": "USD", "quantity": 0, "price": 0, "grossAmount": 0, "commission": 0, "netAmount": -320.08, "type": "Interest" }, ... ] } ``` -------------------------------- ### Retrieve Supported Markets Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/markets Use this GET request to retrieve information about supported markets. No parameters are required. ```http GET https://api01.iq.questrade.com/v1/markets ``` -------------------------------- ### Sample Account Response JSON Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts This is a sample JSON response for the 'GET accounts' operation, illustrating the structure of account data returned. ```json { "accounts": [ { "type": "Margin", "number": "26598145", "status": "Active", "isPrimary": true, "isBilling": true, "clientAccountType": "Individual" } ] } ``` -------------------------------- ### Account balances JSON response structure Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-balances Example of the JSON payload returned when querying account balances. ```JSON { "perCurrencyBalances": [ { "currency": "CAD", "cash": 243971.7, "marketValue": 6017, "totalEquity": 249988.7, "buyingPower": 496367.2, "maintenanceExcess": 248183.6, "isRealTime": false }, { "currency": "USD", "cash": 198259.05, "marketValue": 53745, "totalEquity": 252004.05, "buyingPower": 461013.3, "maintenanceExcess": 230506.65, "isRealTime": false } ], "combinedBalances": [ ... ], "sodPerCurrencyBalances": [ ... ], "sodCombinedBalances": [ ... ] } ``` -------------------------------- ### GET symbols/search Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/symbols-search Retrieves symbol information based on search criteria such as a prefix. ```APIDOC ## GET symbols/search ### Description Retrieves symbol(s) using several search criteria. ### Method GET ### Endpoint https://api01.iq.questrade.com/v1/symbols/search ### Parameters #### Query Parameters - **prefix** (String) - Optional - Prefix of a symbol or any word in the description. - **offset** (Integer) - Optional - Offset in number of records from the beginning of a result set. ### Response #### Success Response (200) - **symbols** (Complex) - List of EquitySymbol elements. - **EquitySymbol** (Complex) - Contains symbol, symbolId, description, securityType, listingExchange, isQuotable, isTradable, and currency. #### Response Example { "symbol": [ { "symbol": "BMO", "symbolId": 9292, "description": "BANK OF MONTREAL", "securityType": "Stock", "listingExchange": "NYSE", "isTradable": true, "isQuotable": true, "currency": "USD" } ] } ``` -------------------------------- ### Sample Rate Limit Headers Source: https://www.questrade.com/api/documentation/rate-limiting This example shows the HTTP headers returned by the API to communicate rate limit information. It includes the remaining requests and the timestamp for limit expiration. ```http HTTP/1.1 200 OK Content-Length: 123 Content-Type: application/json; charset=utf-8 Date: Fri, 18 Aug 2014 22:17:16 GMT X-RateLimit-Remaining: 100 X-RateLimit-Reset: 1300286940 ``` -------------------------------- ### GET /accounts Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts Retrieves a list of accounts associated with the authenticated user. ```APIDOC ## GET /accounts ### Description Retrieves the accounts associated with the user on behalf of which the API client is authorized. ### Method GET ### Endpoint /v1/accounts ### Parameters No parameters. ### Request Example ``` GET https://api01.iq.questrade.com/v1/accounts ``` ### Response #### Success Response (200) - **accounts** (Complex) - List of account records. - **type** (String) - Type of the account (e.g., "Cash", "Margin"). - **number** (string) - Eight-digit account number (e.g., "26598145"). - **status** (Enumeration) - Status of the account (e.g., Active). - **isPrimary** (Boolean) - Whether this is a primary account for the holder. - **isBilling** (Boolean) - Whether this account is one that gets billed for various expenses. - **clientAccountType** (String) - Type of client holding the account (e.g., "Individual"). - **userId** (Integer) - Internal identifier of the user making the request. #### Response Example ```json { "accounts": [ { "type": "Margin", "number": "26598145", "status": "Active", "isPrimary": true, "isBilling": true, "clientAccountType": "Individual" } ] } ``` ``` -------------------------------- ### Retrieve Accounts - GET Request Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts Use this GET request to retrieve a list of accounts associated with the user. No request parameters are required. ```http GET https://api01.iq.questrade.com/v1/accounts ``` -------------------------------- ### GET /accounts/:id/balances Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-balances Retrieves per-currency and combined balances for a specified account. ```APIDOC ## GET /accounts/:id/balances ### Description Retrieves per-currency and combined balances for a specified account. ### Method GET ### Endpoint /accounts/:id/balances ### Parameters #### Path Parameters - **id** (String) - Required - Account number. ### Response properties #### Success Response (200) - **perCurrencyBalances** (Complex) - List of account records. - **Balance** (Complex) - See below. - **combinedBalances** (Complex) - List of Balance records. - **Balance** (Complex) - See below. - **sodPerCurrencyBalances** (Complex) - List of Balance records. - **Balance** (Complex) - See below. - **sodCombinedBalances** (Complex) - List of Balance records. - **Balance** (Complex) - - **currency** (Enumeration) - Currency of the balance figure (e.g., "USD" or "CAD"). See Currency section for all allowed values. - **cash** (Double) - Balance amount. - **marketValue** (Double) - Market value of all securities in the account in a given currency. - **totalEquity** (Double) - Equity as a difference between cash and marketValue properties. - **buyingPower** (Double) - Buying power for that particular currency side of the account. - **maintenanceExcess** (Double) - Maintenance excess for that particular side of the account. - **isRealTime** (Boolean) - Whether real-time data was used to calculate the above values. ### Request Example ``` GET https://api01.iq.questrade.com/v1/accounts/26598145/balances ``` ### Response Example ```json { "perCurrencyBalances": [ { "currency": "CAD", "cash": 243971.7, "marketValue": 6017, "totalEquity": 249988.7, "buyingPower": 496367.2, "maintenanceExcess": 248183.6, "isRealTime": false }, { "currency": "USD", "cash": 198259.05, "marketValue": 53745, "totalEquity": 252004.05, "buyingPower": 461013.3, "maintenanceExcess": 230506.65, "isRealTime": false } ], "combinedBalances": [ ... ], "sodPerCurrencyBalances": [ ... ], "sodCombinedBalances": [ ... ] } ``` ``` -------------------------------- ### Make Authorized API Call Source: https://www.questrade.com/api/documentation/getting-started Use the obtained access token and server URL to make an authorized API call. This example shows how to request account information. ```http GET /v1/accounts HTTP/1.1 Host: https://api01.iq.questrade.com Authorization: Bearer C3lTUKuNQrAAmSD/TPjuV/HI7aNrAwDp ``` -------------------------------- ### Retrieve account balances via GET request Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-balances Use this endpoint to fetch balance details for a specific account ID. ```HTTP GET https://api01.iq.questrade.com/v1/accounts/26598145/balances ``` -------------------------------- ### GET /v1/time Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/time Retrieves the current server time in ISO format and Eastern time zone. ```APIDOC ## GET /v1/time ### Description Retrieves current server time. ### Method GET ### Endpoint https://api01.iq.questrade.com/v1/time ### Parameters No parameters. ### Response #### Success Response (200) - **time** (DateTime) - Current server time in ISO format and Eastern time zone. #### Response Example ```json { "time": "2014-10-24T12:14:42.730000-04:00" } ``` ``` -------------------------------- ### Retrieve Account Executions Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-executions Use this GET request to retrieve execution details for a specific account. Parameters like startTime and endTime can filter the results. ```http GET https://api01.iq.questrade.com/v1/accounts/26598145/executions ``` -------------------------------- ### GET /markets/quotes/options Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/markets-quotes-options Retrieves Level 1 market data and Greek data for one or more option symbols. ```APIDOC ## GET /markets/quotes/options ### Description Retrieves a single Level 1 market data quote and Greek data for one or more option symbols. ### Method GET ### Endpoint /markets/quotes/options ### Parameters #### Query Parameters - **filters** (Complex) - Input array of OptionIdFilter structures - **ids** (Integer[]) - Input array of option IDs. ### OptionIdFilter Option filters based on underlying Ids - **optionType** (Enumeration) - Optional - Option type - **underlyingId** (Integer) - Optional - Underlying ID - **expiryDate** (DateTime) - Optional - Expiry date - **minstrikePrice** (Double) - Optional - Min strike price (Default: 0) - **maxstrikePrice** (Double) - Optional - Max strike price (Default: 0) ### Response Properties #### Success Response (200) - **quotes** (Complex) - List of Level1OptionData records. ### Level1OptionData - **underlying** (String) - Underlying name - **underlyingId** (Integer) - Underlying ID - **symbol** (String) - Symbol name - **symbolId** (Integer) - Symbol ID - **bidPrice** (Double) - Bid price - **bidSize** (Integer) - Bid size - **askPrice** (Double) - Ask price - **askSize** (Integer) - Ask size - **lastTradePriceTrHrs** (Double) - Last trade price trade hours - **lastTradePrice** (Double) - Last trade price - **lastTradeSize** (Integer) - Last trade size - **lastTradeTick** (Enumeration) - Last trade tick - **lastTradeTime** (DateTime) - Last trade time - **volume** (Integer) - Volume - **openPrice** (Double) - Open price - **highPrice** (Double) - High price - **lowPrice** (Double) - Low price - **volatility** (Double) - Volatility - **delta** (Double) - Delta - **gamma** (Double) - Gamma - **theta** (Double) - Theta - **vega** (Double) - Vega - **rho** (Double) - Rho - **openInterest** (Integer) - Open interest - **delay** (Integer) - How much is data delayed - **isHalted** (Boolean) - Whether or not the symbol was halted - **VWAP** (Double) - Volume Weighted Average Price ### Request Example ```json { "filters": [ { "optionType": "Call", "underlyingId": 27426, "expiryDate": "2017-01-20T00:00:00.000000-05:00", "minstrikePrice": 70, "maxstrikePrice": 80 } ], "optionIds": [ 9907637, 9907638 ] } ``` ### Response Example ```json { "optionQuotes": [ { "underlying": "MSFT", "underlyingId": 27426, "symbol": "MSFT20Jan17C70.00", "symbolId": 7413503, "bidPrice": 4.90, "bidSize": 0, "askPrice": 4.95, "askSize": 0, "lastTradePriceTrHrs": 4.93, "lastTradePrice": 4.93, "lastTradeSize": 0, "lastTradeTick": "Equal", "lastTradeTime": "2015-08-17T00:00:00.000000-04:00", "volume": 0, "openPrice": 0, "highPricehighPrice": 4.93, "lowPrice": 0, "volatility": 52.374257, "delta": 0.06985, "gamma": 0.01038, "theta": -0.001406, "vega": 0.074554, "rho": 0.04153, "openInterest": 2292, "delay": 0, "isHalted": false, "VWAP": 0 } ] } ``` ``` -------------------------------- ### GET /v1/markets Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/markets Retrieves information about supported markets, including trading venues, order routes, and market hours. ```APIDOC ## GET /v1/markets ### Description Retrieves information about supported markets. ### Method GET ### Endpoint https://api01.iq.questrade.com/v1/markets ### Response #### Success Response (200) - **markets** (Complex) - List of Quote records. - **name** (String) - Market name. - **tradingVenues** (Complex) - List of trading venue codes. - **defaultTradingVenue** (Enumeration) - Default trading venue code. - **primaryOrderRoutes** (Complex) - List of primary order route codes. - **secondaryOrderRoutes** (Complex) - List of secondary order route codes. - **level1Feeds** (Complex) - List of level 1 market data feed codes. - **level2Feeds** (Complex) - List of level 2 market data feed codes. - **extendedStartTime** (DateTime) - Pre-market opening time for current trading date. - **startTime** (DateTime) - Regular market opening time for current trading date. - **endTime** (DateTime) - Regular market closing time for current trading date. - **extendedEndTime** (DateTime) - Extended market closing time for current trading date. - **currency** (Enumeration) - Currency code (ISO format). - **snapQuotesLimit** (Integer) - Number of snap quotes that the user can retrieve from a market. #### Response Example { "markets": [ { "name": "TSX", "tradingVenues": [ "TSX", "ALPH", "CHIC", "OMGA", "PURE" ], "defaultTradingVenue": "AUTO", "primaryOrderRoutes": [ "AUTO" ], "secondaryOrderRoutes": [ "TSX", "AUTO" ], "level1Feeds": [ "ALPH", "CHIC", "OMGA", "PURE", "TSX" ], "extendedStartTime": "2014-10-06T07:00:00.000000-04:00", "startTime": "2014-10-06T09:30:00.000000-04:00", "endTime": "2014-10-06T16:00:00.000000-04:00", "currency": "CAD", "snapQuotesLimit": 99999 } ] } ``` -------------------------------- ### Retrieve Option Quotes Request Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/markets-quotes-options Example of a POST request to fetch option quotes using filters and specific option IDs. ```HTTP POST https://api01.iq.questrade.com/v1/markets/quotes/options { “filters”: [ { “optionType”: ”Call”, “underlyingId”: 27426, “expiryDate”: ”2017-01-20T00:00:00.000000-05:00”, “minstrikePrice”: 70, “maxstrikePrice”: 80 }, ... ], “optionIds”: [ 9907637, 9907638, ... ] } ``` -------------------------------- ### Option Chain JSON Response Structure Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/symbols-id-options Example of the JSON response returned by the option chain endpoint, containing expiry dates and strike price details. ```JSON { "options": [ { "expiryDate": "2015-01-17T00:00:00.000000-05:00", "description": "BANK OF MONTREAL", "listingExchange": "MX", "optionExerciseType": "American", "chainPerRoot": [ { "root": "BMO", "chainPerStrikePrice": [ { "strikePrice": 60, "callSymbolId": 6101993, "putSymbolId": 6102009 }, { "strikePrice": 62, "callSymbolId": 6101994, "putSymbolId": 6102010 }, { "strikePrice": 64, "callSymbolId": 6101995, "putSymbolId": 6102011 }, ... ], "multiplier": 100 } ] } ] } ``` -------------------------------- ### Retrieve Account Activities Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-activities Use this GET request to fetch account activities. Note that the requested time interval must not exceed 31 days. ```http GET https://api01.iq.questrade.com/v1/accounts/26598145/activities?startTime=2011-02-01T00:00:00-05:00&endTime=2011-02-28T00:00:00-05:00& ``` -------------------------------- ### Sample JSON Response for Market Quotes Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/markets-quotes-id This is an example of the JSON response structure for market quote requests. It includes details such as symbol, prices, volume, and delay status. ```json { "quotes": [ { "symbol": "THI.TO", "symbolId": 38738, "tier": " ", "bidPrice": 83.65, "bidSize":6500, "askPrice": 83.67, "askSize": 9100, "lastTradePriceTrHrs": 83.66, "lastTradePrice": 83.66, "lastTradeSize": 3100, "lastTradeTick": "Equal", "lastTradeTime": "2014-10-24T20:06:40.131000-04:00", "volume": 80483500, "openPrice": 83.66, "highPrice": 83.86, "lowPrice": 83.66, "delay": 0, "isHalted": false }, ... ] } ``` -------------------------------- ### GET symbols/:id/options Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/symbols-id-options Retrieves an option chain for a particular underlying symbol using its internal identifier. ```APIDOC ## GET symbols/:id/options ### Description Retrieves an option chain for a particular underlying symbol. ### Method GET ### Endpoint https://api01.iq.questrade.com/v1/symbols/:id/options ### Parameters #### Path Parameters - **id** (Integer) - Required - Internal symbol identifier. ### Response #### Success Response (200) - **symbols** (Complex) - List of ChainPerExpiryDate elements. - **expiryDate** (DateTime) - Option expiry date. - **description** (String) - Description of the underlying option. - **listingExchange** (Enumeration) - Primary listing exchange. - **optionExerciseType** (Enumeration) - Option exercise style. - **chainPerRoot** (Complex) - List of ChainPerRoot elements. - **optionRoot** (String) - Option root symbol. - **chainPerStrikePrice** (Complex) - List of ChainPerStrikePrice elements. - **strikePrice** (Double) - Option strike price. - **callSymbolId** (Integer) - Internal identifier of the call option symbol. - **putSymbolId** (Integer) - Internal identifier of the put option symbol. #### Response Example { "options": [ { "expiryDate": "2015-01-17T00:00:00.000000-05:00", "description": "BANK OF MONTREAL", "listingExchange": "MX", "optionExerciseType": "American", "chainPerRoot": [ { "root": "BMO", "chainPerStrikePrice": [ { "strikePrice": 60, "callSymbolId": 6101993, "putSymbolId": 6102009 }, { "strikePrice": 62, "callSymbolId": 6101994, "putSymbolId": 6102010 } ], "multiplier": 100 } ] } ] } ``` -------------------------------- ### Retrieve Account Positions Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-positions Use this GET request to fetch the positions for a specific account. Ensure the account ID is correctly provided in the URL. ```http GET https://api01.iq.questrade.com/v1/accounts/26598145/positions ``` -------------------------------- ### Sample JSON Response for Market Candles Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/markets-candles-id This is a sample JSON response structure for the markets/candles endpoint, detailing the format of candlestick data including start and end times, open, high, low, close prices, and volume. ```json { "candles": [ { "start": "2014-01-02T00:00:00.000000-05:00", "end": "2014-01-03T00:00:00.000000-05:00", "low": 70.3, "high": 70.78, "open": 70.68, "close": 70.73, "volume": 983609 }, ... ] } ``` -------------------------------- ### Sample Response for Market Data Quotes/Strategies Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/markets-quotes-strategies This is a sample response structure for the /markets/quotes/strategies endpoint. It includes details for each strategy quote, such as variant ID, bid and ask prices, underlying asset information, and various Greeks. ```json { “stategyQuotes”: [ { “variantId”: 1, “bidPrice”: 27.2, “askPrice”: 27.23, “underlying”: ”MSFT”, “underlyingId”: 27426, “openPrice”: null, “volatility”: 0, “delta”: 1, “gamma”: 0, “theta”: 0, “vega”: 0, “rho”: 0, “isRealTime”: true }, ... ] } ``` -------------------------------- ### General Error Response Source: https://www.questrade.com/api/documentation/error-handling Example of a standard error response returned when a request cannot be serviced. ```http HTTP/1.1 400 Bad Request Content-Length: 63 Content-Type: application/json; charset=utf-8 Date: Fri, 18 Aug 2014 22:17:16 GMT { "code": 3139 , "message": "Invalid route" } ``` -------------------------------- ### Sample Execution Response Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-executions This JSON structure represents a sample response when retrieving account executions, detailing each trade's properties. ```json { "executions": [ { "symbol": "AAPL", "symbolId": 8049, "quantity": 10, "side": "Buy", "price": 536.87, "id": 53817310, "orderId": 177106005, "orderChainId": 17710600, "exchangeExecId": "XS1771060050147", "timestam": 2014-03-31T13:38:29.000000-04:00, "notes": "", "venue": "LAMP", "totalCost": 5368.7, "orderPlacementCommission": 0, "commission": 4.95, "executionFee": 0, "secFee": 0, "canadianExecutionFee": 0, "parentId": 0, } ] } ``` -------------------------------- ### GET /markets/quotes/strategies Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/markets-quotes-strategies Retrieve calculated L1 market data quotes for single or multi-leg strategies. ```APIDOC ## GET /markets/quotes/strategies ### Description Retrieve a calculated L1 market data quote for a single or many multi-leg strategies. ### Method GET ### Endpoint /markets/quotes/strategies ### Parameters #### Query Parameters - **variants** (Complex) - Required - Input array of Strategy Variants ### Request Body #### StrategyVariantRequest Strategy record for strategy quotes. - **variantId** (Integer) - Required - Variant ID - **strategy** (Enumeration) - Required - Strategy type (e.g. “Custom”) - **legs** (Complex) - Required - Array of Strategy legs #### StrategyVariantLeg Strategy record for strategy quotes - **symbolId** (Integer) - Required - Internal symbol identifier - **action** (Enumeration) - Required - Order side (e.g. “Buy”) - **ratio** (Integer) - Required - Numeric ration of the leg in strategy ### Request Example ```json { "variants": [ { "variantId": 1, "strategy": "Custom", "legs": [ { "symbolId": 27426, "ratio": 1000, "action": "Buy" }, { "symbolId": 10550014, "ratio": 10, "action": "Sell" } ] } ] } ``` ### Response #### Success Response (200) - **strategyQuotes** (Array) - Array of strategy quotes - **variantId** (Integer) - Variant ID corresponding to variant in request - **bidPrice** (Double) - Bid price - **askPrice** (Double) - Ask price - **underlying** (String) - Underlying name - **underlyingId** (Integer) - Underlying ID - **openPrice** (Double) - Open price - **volatility** (Double) - Volatility - **delta** (Double) - Delta - **gamma** (Double) - Gamma - **theta** (Double) - Theta - **vega** (Double) - Vega - **rho** (Double) - Rho - **isRealTime** (Boolean) - Whether or not the data is real-time #### Response Example ```json { "strategyQuotes": [ { "variantId": 1, "bidPrice": 27.2, "askPrice": 27.23, "underlying": "MSFT", "underlyingId": 27426, "openPrice": null, "volatility": 0, "delta": 1, "gamma": 0, "theta": 0, "vega": 0, "rho": 0, "isRealTime": true } ] } ``` ### NOTES: * Leg quantities will be factorized. For example, if you place quantities of 10 and 1000, they will be sent as an order quantity of 10 and leg ratio quantities 1 and 100. Price uses a factorized strategy. * Maximum of 4 legs is allowed. * The variantId parameter will be echoed so you can match the quotes to the request. ``` -------------------------------- ### Order Configuration Reference Source: https://www.questrade.com/api/documentation/rest-operations/enumerations/enumerations Reference documentation for supported order types, time-in-force instructions, and order states. ```APIDOC ## Order Configuration Reference ### Order Types - Market - Limit - Stop - StopLimit - TrailStopInPercentage - TrailStopInDollar - TrailStopLimitInPercentage - TrailStopLimitInDollar - LimitOnOpen - LimitOnClose ### Order Time-In-Force - Day - GoodTillCanceled - GoodTillExtendedDay - GoodTillDate - ImmediateOrCancel - FillOrKill ### Order State - Failed, Pending, Accepted, Rejected, CancelPending, Canceled, PartialCanceled, Partial, Executed, ReplacePending, Replaced, Stopped, Suspended, Expired, Queued, Triggered, Activated, PendingRiskReview, ContingentOrder ``` -------------------------------- ### Sample Market Data Response Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/markets This is a sample JSON response for the markets endpoint, illustrating the structure of market data. ```json { "markets": [ { "name": "TSX", "tradingVenues": [ "TSX", "ALPH", "CHIC", "OMGA", "PURE" ] "defaultTradingVenue": "AUTO", "primaryOrderRoutes": [ "AUTO" ], "secondaryOrderRoutes": [ "TSX", "AUTO" ], "level1Feeds": [ "ALPH", "CHIC", "OMGA", "PURE", "TSX" ], "extendedStartTime": "2014-10-06T07:00:00.000000-04:00", "startTime": "2014-10-06T09:30:00.000000-04:00", "endTime": "2014-10-06T16:00:00.000000-04:00", "currency": "CAD", "snapQuotesLimit": 99999 }, ... ] } ``` -------------------------------- ### GET /symbols/:id Source: https://www.questrade.com/api/documentation/rest-operations/market-calls/symbols-id Retrieves detailed information about one or more symbols using their internal identifiers or names. ```APIDOC ## GET /symbols/:id ### Description Retrieves detailed information about one or more symbols. You can specify symbols by their internal ID or by their name. Note that you must use either `ids` or `names`, but not both. ### Method GET ### Endpoint `/v1/symbols` ### Parameters #### Query Parameters - **id** (integer) - Optional - Internal symbol identifier. Mutually exclusive with `ids` parameter. - **ids** (Complex) - Optional - Comma-separated list of symbol IDs. Each ID is an Integer. - **names** (Complex) - Optional - Comma-separated list of symbol names. Each name is a String. ### Response Properties - **symbol** (String) - Symbol that follows Questrade symbology (e.g., "TD.TO"). - **symbolId** (Integer) - Symbol identifier. - **prevDayClosePrice** (Double) - Closing trade price from the previous trading day. - **highPrice52** (Double) - 52-week high price. - **lowPrice52** (Double) - 52-week low price. - **averageVol3Months** (Integer) - Average trading volume over trailing 3 months. - **averageVol20Days** (Integer) - Average trading volume over trailing 20 days. - **outstandingShares** (Integer) - Total number of shares outstanding. - **eps** (Double) - Trailing 12-month earnings per share. - **pe** (Double) - Trailing 12-month price to earnings ratio. - **dividend** (Double) - Dividend amount per share. - **yield** (Double) - Dividend yield (dividend / prevDayClosePrice). - **exDate** (DateTime) - Dividend ex-date. - **marketCap** (Double) - Market capitalization (outstandingShares * prevDayClosePrice). - **optionType** (Enumeration) - Option type (e.g., "Call"). See Option Type section for all allowed values. - **optionDurationType** (Enumeration) - Option duration type (e.g., "Weekly"). See Option Duration Type section for all allowed values. - **optionRoot** (String) - Option root symbol (e.g., "MSFT"). - **optionContractDeliverables** (Complex) - Option contract deliverables. - **multiplier** (Integer) - Number of shares deliverable per contract (e.g., 100). - **underlyingSymbol** (String) - Underlying symbol for the deliverable (e.g., "MSFT"). - **underlyingSymbolId** (String) - Underlying symbol id for the deliverable (e.g., 2345343). - **cashInLieu** (Double) - Amount of cash in lieu deliverable per contract. - **optionExerciseType** (Enumeration) - Option exercise style (e.g., "American"). See Option Exercise Type section for all allowed values. - **listingExchange** (Enumeration) - Primary listing exchange. See Listing Exchange section for the list of all listing exchanges. - **description** (String) - Symbol description (e.g., "Microsoft Corp."). - **securityType** (Enumeration) - Security type (e.g., "Stock"). See Security Type section for all allowed values. - **optionExpiryDate** (DateTime) - Option expiry date. - **dividendDate** (DateTime) - Dividend declaration date. - **optionStrikePrice** (Double) - Option strike price. - **isQuotable** (Boolean) - Indicates whether the symbol is actively listed. - **hasOptions** (Boolean) - Indicates whether the symbol is an underlying option. - **currency** (String) - String Currency code (follows ISO format). - **minTicks** (Complex) - List of MinTickData records. - **pivot** (Double) - Beginning of the interval for a given minimum price increment. - **minTick** (Double) - Minimum price increment. - **industrySector** (Enumeration) - Industry sector classification. - **industryGroup** (Enumeration) - Industry group classification. - **industrySubGroup** (Enumeration) - Industry subgroup classification. ### Request Example ``` GET https://api01.iq.questrade.com/v1/symbols/8049 ``` ### Request Example (Multiple IDs) ``` GET https://api01.iq.questrade.com/v1/symbols?ids=8049,1234,5678 ``` ### Response Example (Success) ```json { "symbols": [ { "symbol": "TD.TO", "symbolId": 8049, "prevDayClosePrice": 85.50, "highPrice52": 92.00, "lowPrice52": 78.00, "averageVol3Months": 2500000, "averageVol20Days": 2300000, "outstandingShares": 1200000000, "eps": 5.25, "pe": 16.20, "dividend": 2.40, "yield": 2.80, "exDate": "2023-10-26T00:00:00", "marketCap": 102600000000, "optionType": null, "optionDurationType": null, "optionRoot": null, "optionContractDeliverables": null, "optionExerciseType": null, "listingExchange": "TSX", "description": "Toronto-Dominion Bank", "securityType": "Stock", "optionExpiryDate": null, "dividendDate": "2023-10-26T00:00:00", "optionStrikePrice": null, "isQuotable": true, "hasOptions": false, "currency": "CAD", "minTicks": [ { "pivot": 0.00, "minTick": 0.01 } ], "industrySector": "Financials", "industryGroup": "Banks", "industrySubGroup": "Diversified Banks" } ] } ``` ``` -------------------------------- ### Sample Account Activity Response Source: https://www.questrade.com/api/documentation/rest-operations/account-calls This is a sample JSON response structure for account activities, detailing fields like trade date, transaction details, and amounts. Note the structure for individual activity records. ```json { "activities": [ { "tradeDate": "2011-02-16T00:00:00.000000-05:00", "transactionDate": "2011-02-16T00:00:00.000000-05:00", "settlementDate": "2011-02-16T00:00:00.000000-05:00", "action": "", "symbol": "", "symbolId": 0, "description": "INT FR 02/04 THRU02/15@ 4 3/4%BAL 205,006 AVBAL 204,966", "currency": "USD", "quantity": 0, "price": 0, "grossAmount": 0, "commission": 0, "netAmount": -320.08, "type": "Interest" }, ... ] } ``` -------------------------------- ### Sample Account Positions Response Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-positions This is a sample JSON response structure for the account positions endpoint. It details individual positions with their market data and PnL. ```json { "positions": [ { "symbol": "THI.TO", "symbolId": 38738, "openQuantity": 100, "currentMarketValue": 6017, "currentPrice": 60.17, "averageEntryPrice": 60.23, "closedPnl": 0, "openPnl": -6, "totalCost": false, "isRealTime": "Individual", "isUnderReorg": false } ] } ``` -------------------------------- ### Sample API Response for Accounts Source: https://www.questrade.com/api/documentation/getting-started This is a sample JSON response for an API call to retrieve account information. It includes a list of accounts with their details and the user ID. ```json { "accounts": [ { "type": "Margin" "number":"26598145", "status": "Active", "isPrimary": true, "isBilling": true, "clientAccountType: "Individual" }, ... ], "userId": 3000124 } ``` -------------------------------- ### Order States Source: https://www.questrade.com/api/documentation/rest-operations/enumerations Lists all supported states an order can be in. ```APIDOC ## Order States ### Description Indicates the current status of an order within the trading system. ### Supported States - Failed - Pending - Accepted - Rejected - CancelPending - Canceled - PartialCanceled - Partial - Executed - ReplacePending - Replaced - Stopped - Suspended - Expired - Queued - Triggered - Activated - PendingRiskReview - ContingentOrder ``` -------------------------------- ### GET /accounts/:id/executions Source: https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-executions Retrieves execution records for a specific Questrade account within a given time range. ```APIDOC ## GET /accounts/:id/executions ### Description Retrieves executions for a specific account. ### Method GET ### Endpoint /accounts/:id/executions ### Parameters #### Path Parameters - **id** (String) - Required - Account number. #### Query Parameters - **startTime** (DateTime) - Optional - Start of time range in ISO format. By default – start of today, 12:00am. - **endTime** (DateTime) - Optional - End of time range in ISO format. By default – end of today, 11:59pm. ### Response #### Success Response (200) - **executions** (Complex) - List of execution records. - **Execution** (Complex) - **symbol** (String) - Execution symbol. - **symbolId** (Integer) - Internal symbol identifier. - **quantity** (Integer) - Execution quantity. - **side** (String) - Client side of the order to which execution belongs. See Client Order Side section for all allowed values. - **price** (Double) - Execution price. - **id** (Double) - Internal identifier of the execution. - **orderId** (Integer) - Internal identifier of the order to which the execution belongs. - **orderChainId** (Integer) - Internal identifier of the order chain to which the execution belongs. - **exchangeExecId** (string) - Identifier of the execution at the market where it originated. - **timestamp** (DateTime) - Execution timestamp. - **notes** (String) - Manual notes that may have been entered by Trade Desk staff. - **venue** (String) - Trading venue where execution originated. - **totalCost** (Double) - Execution cost (price x quantity). - **orderPlacementCommission** (Double) - Questrade commission for orders placed with Trade Desk. - **commission** (Double) - Questrade commission. - **executionFee** (Double) - Liquidity fee charged by execution venue. - **secFee** (Double) - SEC fee charged on all sales of US securities. - **canadianExecutionFee** (Integer) - Additional execution fee charged by TSX (if applicable). - **parentId** (Integer) - Internal identifier of the parent order. ### Request Example ``` GET https://api01.iq.questrade.com/v1/accounts/26598145/executions ``` ### Response Example ```json { "executions": [ { "symbol": "AAPL", "symbolId": 8049, "quantity": 10, "side": "Buy", "price": 536.87, "id": 53817310, "orderId": 177106005, "orderChainId": 17710600, "exchangeExecId": "XS1771060050147", "timestam": "2014-03-31T13:38:29.000000-04:00", "notes": "", "venue": "LAMP", "totalCost": 5368.7, "orderPlacementCommission": 0, "commission": 4.95, "executionFee": 0, "secFee": 0, "canadianExecutionFee": 0, "parentId": 0 } ] } ``` ``` -------------------------------- ### Order Processing Error Responses Source: https://www.questrade.com/api/documentation/error-handling Examples of error responses during trade calls, distinguishing between cases where an order was not created and where it was. ```http HTTP/1.1 400 Bad Request Content-Length: 63 Content-Type: application/json; charset=utf-8 Date: Fri, 18 Aug 2014 22:17:16 GMT { "code": 3139, "message": "Invalid route" } ``` ```http HTTP/1.1 200 OK Content-Length: 63 Content-Type: application/json; charset=utf-8 Date: Fri, 18 Aug 2014 22:17:16 GMT { "code": 3054 , "message": "Order was rejected by the exchange" , "orderId": 134353223 , "orders": [ ... ] } ```