### Example Field: Start Date Source: https://www.tiingo.com/documentation/end-of-day The 'startDate' field indicates the earliest date for which price data is available for the asset. Null means no price data is available. ```JSON startDate ``` -------------------------------- ### Example Field: Name Source: https://www.tiingo.com/documentation/end-of-day The 'name' field provides the full name of the asset. ```JSON name ``` -------------------------------- ### Example Field: Description Source: https://www.tiingo.com/documentation/end-of-day The 'description' field offers a long-form description of the asset. ```JSON description ``` -------------------------------- ### Websocket API Response Examples Source: https://www.tiingo.com/documentation/general/connecting These examples show typical responses from the Tiingo Websocket API, including subscription confirmation with a subscriptionId and periodic HeartBeat messages to maintain the connection. ```json #Notice the "HeartBeat" message. This is sent every 30 seconds {"data": {"subscriptionId": 61}, "response": {"message": "Success", "code": 200}, "messageType": "I"} {"response": {"message": "HeartBeat", "code": 200}, "messageType": "H"} ``` -------------------------------- ### Search Endpoint URL Examples Source: https://www.tiingo.com/documentation/utilities/search These are the base URLs for the search endpoint. You will need to append your query and API token. ```bash # Search Endpoint https://api.tiingo.com/tiingo/utilities/search/ # or https://api.tiingo.com/tiingo/utilities/search?query= ``` -------------------------------- ### Example Field: Date Source: https://www.tiingo.com/documentation/end-of-day The 'date' field represents the specific date to which the price data pertains. ```JSON date ``` -------------------------------- ### Example Field: Open Price Source: https://www.tiingo.com/documentation/end-of-day The 'open' field indicates the opening price of the asset for the given date. ```JSON open ``` -------------------------------- ### Example Field: Dividend Cash Source: https://www.tiingo.com/documentation/end-of-day The 'divCash' field indicates the amount of dividend paid out on the 'exDate'. ```JSON divCash ``` -------------------------------- ### Example Field: Volume Source: https://www.tiingo.com/documentation/end-of-day The 'volume' field indicates the total number of shares traded for the asset on that date. ```JSON volume ``` -------------------------------- ### Example Field: Exchange Code Source: https://www.tiingo.com/documentation/end-of-day The 'exchangeCode' field identifies the exchange where the asset is listed. ```JSON exchangeCode ``` -------------------------------- ### Example Field: Ticker Source: https://www.tiingo.com/documentation/end-of-day The 'ticker' field is an identifier for the asset. ```JSON ticker ``` -------------------------------- ### Example Field: Adjusted Open Price Source: https://www.tiingo.com/documentation/end-of-day The 'adjOpen' field provides the opening price adjusted for corporate actions like splits and dividends. ```JSON adjOpen ``` -------------------------------- ### Get Crypto Meta Data Source: https://www.tiingo.com/documentation/crypto Request meta information for all available cryptocurrency tickers. Requires an API token. ```bash https://api.tiingo.com/tiingo/crypto ``` -------------------------------- ### Example Field: Adjusted Volume Source: https://www.tiingo.com/documentation/end-of-day The 'adjVolume' field shows the volume adjusted for stock splits. ```JSON adjVolume ``` -------------------------------- ### Example Field: Close Price Source: https://www.tiingo.com/documentation/end-of-day The 'close' field denotes the closing price of the asset for the specified date. ```JSON close ``` -------------------------------- ### Get Crypto Top-of-Book Data Source: https://www.tiingo.com/documentation/crypto Retrieve top-of-book (bid/ask) data for specified cryptocurrency tickers. Requires an API token. ```bash https://api.tiingo.com/tiingo/crypto/top?tickers=btcusd,fldcbtc ``` -------------------------------- ### Get Detailed Fund Fee Metrics Source: https://www.tiingo.com/documentation/mutual-fund-and-etf-fees Use this endpoint to obtain detailed current and historical fee data for a specific fund. Requires a valid API token. ```bash # To obtain detailed current and historical fee data, use the following REST endpoint https://api.tiingo.com/tiingo/funds//metrics ``` -------------------------------- ### Get Top-Level Fund Data Source: https://www.tiingo.com/documentation/mutual-fund-and-etf-fees Use this endpoint to retrieve general information about a fund, including its description and share classes. Requires a valid API token. ```bash # To obtain top-level fund data, including description and share classes, use the following REST endpoint https://api.tiingo.com/tiingo/funds/ ``` -------------------------------- ### Example Field: Low Price Source: https://www.tiingo.com/documentation/end-of-day The 'low' field represents the lowest price of the asset during the trading day. ```JSON low ``` -------------------------------- ### Python Websocket Connection and Subscription Source: https://www.tiingo.com/documentation/general/connecting Connect to the Tiingo websocket API using Python and subscribe to data. This example continuously receives messages, including heartbeats and subscription confirmations. ```python from websocket import create_connection import simplejson as json ws = create_connection("wss://api.tiingo.com/test") subscribe = { 'eventName':'subscribe', 'eventData': { 'authToken': 'Not logged-in or registered. Please login or register to see your API Token' } } ws.send(json.dumps(subscribe)) while True: print(ws.recv()) ``` -------------------------------- ### Example Field: End Date Source: https://www.tiingo.com/documentation/end-of-day The 'endDate' field shows the latest date for which price data is available for the asset. Null means no price data is available. ```JSON endDate ``` -------------------------------- ### Get Latest Crypto Prices Source: https://www.tiingo.com/documentation/crypto Fetch the latest real-time (last sale) prices for specified cryptocurrency tickers. Requires an API token. ```bash https://api.tiingo.com/tiingo/crypto/prices?tickers=btcusd,fldcbtc ``` -------------------------------- ### Request Historical Intraday Prices Source: https://www.tiingo.com/documentation/forex This REST endpoint allows you to fetch historical intraday OHLC (Open, High, Low, Close) bar data for a forex pair. Specify a start date and resampling frequency for historical data, or use '1day' for current day's OHLC. ```bash https://api.tiingo.com/tiingo/fx//prices?startDate=2019-06-30&resampleFreq=5min ``` ```bash https://api.tiingo.com/tiingo/fx//prices?resampleFreq=1day ``` -------------------------------- ### Connect via Authorization Header (Python) Source: https://www.tiingo.com/documentation/general/connecting Pass your API token in the 'Authorization' header as 'Token YOUR_API_TOKEN'. This is a more secure method for passing credentials. ```python import requests headers = { 'Content-Type': 'application/json', 'Authorization' : 'Token Not logged-in or registered. Please login or register to see your API Token' } requestResponse = requests.get("https://api.tiingo.com/api/test/", headers=headers) print(requestResponse.json()) ``` -------------------------------- ### Request Daily Metric Data (Active Tickers) Source: https://www.tiingo.com/documentation/fundamentals This endpoint retrieves daily updated fundamental metrics such as Market Capitalization, P/E Ratios, etc., for active stock tickers. It's recommended not to rely on the order of fields as new metrics are added over time. Use the 'columns' parameter to ensure a consistent output order if necessary. ```bash # To request daily metric data, use this endpoint (ticker for active symbols) https://api.tiingo.com/tiingo/fundamentals//daily ``` -------------------------------- ### List Bulk Download Files Source: https://www.tiingo.com/documentation/news Obtain a list of all available bulk download files for the news database. This endpoint is typically for institutional clients. ```http https://api.tiingo.com/tiingo/news/bulk_download ``` -------------------------------- ### Connect via URL Parameter (Python) Source: https://www.tiingo.com/documentation/general/connecting Pass your API token directly in the request URL using the 'token' parameter. This method is straightforward for simple requests. ```python import requests headers = { 'Content-Type': 'application/json' } requestResponse = requests.get("https://api.tiingo.com/api/test?token=Not logged-in or registered. Please login or register to see your API Token", headers=headers) print(requestResponse.json()) ``` -------------------------------- ### Connect to Websocket Forex API Source: https://www.tiingo.com/documentation/websockets/forex Use this endpoint to connect to the Forex API for Top-of-Book and last trade data. Ensure your API token is kept secure. ```bash # Websocket Forex API Top-of-Book Endpoint wss://api.tiingo.com/fx ``` ```bash # Websocket Top-of-Book Endpoint wss://api.tiingo.com/fx ``` -------------------------------- ### Example Field: Adjusted Close Price Source: https://www.tiingo.com/documentation/end-of-day The 'adjClose' field provides the closing price adjusted for splits and dividends. ```JSON adjClose ``` -------------------------------- ### Example Field: High Price Source: https://www.tiingo.com/documentation/end-of-day The 'high' field shows the highest price reached by the asset on the given date. ```JSON high ``` -------------------------------- ### Get Fund Metrics Source: https://www.tiingo.com/documentation/mutual-fund-and-etf-fees This endpoint retrieves detailed fee metrics for a specific fund using its ticker symbol. ```APIDOC ## GET /tiingo/funds//metrics ### Description Retrieves detailed current and historical fee data for a specific fund. ### Method GET ### Endpoint https://api.tiingo.com/tiingo/funds//metrics ### Parameters #### Path Parameters - **ticker** (string) - Required - The ticker symbol of the fund. ### Response #### Success Response (200) - **prospectusDate** (date) - The prospectus date when the corresponding fund expense data was published. - **netExpense** (float) - Fund's net expense ratio, or the net expenses related to the fund. - **grossExpense** (float) - Fund's gross expense ratio, or the expenses related to running the fund. - **managementFee** (float) - Fund's management fee, or the fees paid to the manager and/or advisors. - **12b1** (float) - Fund's fee related to marketing expenses. - **non12b1** (float) - Fund's fee related to distribution and similar non 12b-1 fees. - **otherExpenses** (float) - Fund's other expenses, or expenses related to legal, administrative, custodial, etc. - **acquiredFundFees** (float) - Fund's acquired fund fees, or expenses related to underlying businesses or funds. - **feeWaiver** (float) - Fund's fee waiver, or discount on fees. - **exchangeFeeUSD** (float) - Fund's exchange fee if charged in USD, or expenses related to exchanging or transferring funds to another fund in the fund's family. - **exchangeFeePercent** (float) - Fund's exchange fee if charged as a percentage, or expenses related to exchanging or transferring funds to another fund in the fund's family. - **frontLoad** (float) - Fund's front load fee, or the upfront fee charged when investing in the fund. - **backLoad** (float) - Fund's back load fee, or the back-end fee charged when redeeming from the fund. - **dividendLoad** (float) - Dividend load fee, or charges on reinvested dividends. - **shareholderFee** (float) - Fund's shareholder fees, or the potential fees when buying/selling a fund. - **accountFeeUSD** (float) - Fund's account fees if charged in USD, or the fee required to maintain your account in USD. - **accountFeePercent** (float) - Fund's account fees if charged as a percentage, or the fee required to maintain your account in percentage terms. - **redemptionFeeUSD** (float) - Fund's redemption fees if charged in USD, or the fee charged if funds are redeemed early (as defined by the fund company). - **redemptionFeePercent** (float) - Fund's redemption fees as a percentage, or the fee charged if funds are redeemed early (as defined by the fund company). - **portfolioTurnover** (float) - Portfolio turnover. - **miscFees** (float) - Fund's miscellaneous fees. - **customFees** (object[]) - Fund's custom fees. For a full breakdown, see the nested structure below. - **label** (string) - Label related to the custom fee. - **value** (float) - Value of the custom fee field. - **units** (char) - "$" if the value is in dollars or "%" if the value is in percentage terms. - **parentFee** (string) - The parent fee the custom fee's belongs under. ``` -------------------------------- ### Connect to IEX Websocket API Source: https://www.tiingo.com/documentation/websockets/iex Use this endpoint to connect to the IEX Websocket API for real-time price, Top-of-Book, and Last Trade data. Ensure you include your API token for authentication. ```shell # Websocket IEX API Reference Price, Top-of-Book, & Last Trade Endpoint wss://api.tiingo.com/iex ``` ```shell # Websocket Top-of-Book & Last Trade Endpoint wss://api.tiingo.com/iex ``` -------------------------------- ### Example Field: Adjusted Low Price Source: https://www.tiingo.com/documentation/end-of-day The 'adjLow' field represents the adjusted low price, reflecting corporate actions. ```JSON adjLow ``` -------------------------------- ### Example Field: Adjusted High Price Source: https://www.tiingo.com/documentation/end-of-day The 'adjHigh' field shows the adjusted high price, accounting for corporate actions. ```JSON adjHigh ``` -------------------------------- ### Fund Overview Response Fields Source: https://www.tiingo.com/documentation/mutual-fund-and-etf-fees Illustrates the JSON fields returned for fund overview data, including ticker, name, description, share class, net expense ratio, and other share classes. ```json ticker ``` ```json name ``` ```json description ``` ```json shareClass ``` ```json netExpense ``` ```json otherShareClasses ``` -------------------------------- ### Example Field: Split Factor Source: https://www.tiingo.com/documentation/end-of-day The 'splitFactor' field represents the factor used to adjust prices during stock splits or reverse splits. ```JSON splitFactor ``` -------------------------------- ### Display API Token (Placeholder) Source: https://www.tiingo.com/documentation/general/overview This placeholder indicates where a user's API token would be displayed if they are logged in. It is not actual code. ```text Not logged-in or registered. Please login or register to see your API Token ``` -------------------------------- ### Get All Tickers Top-of-Book/Last Price Source: https://www.tiingo.com/documentation/iex Retrieve the current top-of-book (bid/ask) and last sale data for all available tickers from the IEX Exchange. ```APIDOC ## GET /iex ### Description Retrieves the current top-of-book and last price data for all tickers available through the IEX feed. ### Method GET ### Endpoint https://api.tiingo.com/iex ### Parameters This endpoint does not require any parameters. ### Request Example ``` GET https://api.tiingo.com/iex ``` ### Response #### Success Response (200) - **Data**: An array of objects, where each object contains top-of-book and last sale data for a ticker. - **ticker** (string) - The stock ticker symbol. - **lastSaleTmstp** (string) - Timestamp of the last sale. - **lastSalePrice** (number) - Price of the last sale. - **lastSaleSize** (integer) - Size of the last sale. - **lastSaleCondition** (string) - Condition flags for the last sale. - **bidPrice** (number) - The current highest bid price. - **bidSize** (integer) - The size of the current highest bid. - **askPrice** (number) - The current lowest ask price. - **askSize** (integer) - The size of the current lowest ask. - **volume** (integer) - The total trading volume for the day. - **lastUpdated** (string) - Timestamp when the data was last updated. #### Response Example ```json [ { "ticker": "AAPL", "lastSaleTmstp": "2023-10-27T15:59:59.123456789Z", "lastSalePrice": 170.50, "lastSaleSize": 100, "lastSaleCondition": "F", "bidPrice": 170.49, "bidSize": 50, "askPrice": 170.51, "askSize": 75, "volume": 5000000, "lastUpdated": "2023-10-27T15:59:59.123456789Z" } ] ``` ``` -------------------------------- ### Request Top-of-Book/Last for Multiple Tickers Source: https://www.tiingo.com/documentation/forex To request top-of-book and last price data for multiple forex pairs simultaneously, use this REST endpoint. Separate ticker symbols with commas. ```bash https://api.tiingo.com/tiingo/fx/top?tickers=,,... ``` -------------------------------- ### Get Specific Ticker Top-of-Book/Last Price Source: https://www.tiingo.com/documentation/iex Retrieve the current top-of-book (bid/ask) and last sale data for a specific ticker from the IEX Exchange. ```APIDOC ## GET /iex/ ### Description Retrieves the current top-of-book and last price data for a specific stock ticker from the IEX Exchange. ### Method GET ### Endpoint https://api.tiingo.com/iex/ ### Parameters #### Path Parameters - **ticker** (string) - Required - The stock ticker symbol (e.g., AAPL, MSFT). ### Request Example ``` GET https://api.tiingo.com/iex/AAPL ``` ### Response #### Success Response (200) - **Data**: An object containing top-of-book and last sale data for the specified ticker. - **ticker** (string) - The stock ticker symbol. - **lastSaleTmstp** (string) - Timestamp of the last sale. - **lastSalePrice** (number) - Price of the last sale. - **lastSaleSize** (integer) - Size of the last sale. - **lastSaleCondition** (string) - Condition flags for the last sale. - **bidPrice** (number) - The current highest bid price. - **bidSize** (integer) - The size of the current highest bid. - **askPrice** (number) - The current lowest ask price. - **askSize** (integer) - The size of the current lowest ask. - **volume** (integer) - The total trading volume for the day. - **lastUpdated** (string) - Timestamp when the data was last updated. #### Response Example ```json { "ticker": "AAPL", "lastSaleTmstp": "2023-10-27T15:59:59.123456789Z", "lastSalePrice": 170.50, "lastSaleSize": 100, "lastSaleCondition": "F", "bidPrice": 170.49, "bidSize": 50, "askPrice": 170.51, "askSize": 75, "volume": 5000000, "lastUpdated": "2023-10-27T15:59:59.123456789Z" } ``` ``` -------------------------------- ### Request All Ticker IEX Data Source: https://www.tiingo.com/documentation/iex Use this endpoint to retrieve top-of-book and last price data for all tickers. Requires an API token. ```bash https://api.tiingo.com/iex ``` -------------------------------- ### Search Tiingo Database for Specific Assets Source: https://www.tiingo.com/documentation/utilities/search Use these endpoints to search the Tiingo database for specific assets by name or ticker. Ensure you include your API token in the request. ```bash # Search Tiingo database for specific assets https://api.tiingo.com/tiingo/utilities/search/apple # or https://api.tiingo.com/tiingo/utilities/search?query=apple ``` -------------------------------- ### Get Latest News Source: https://www.tiingo.com/documentation/news Retrieve the latest financial news articles. You can fetch all articles or filter them by specific tickers, tags, countries, or topics. ```APIDOC ## GET /tiingo/news ### Description Retrieves the latest financial news articles. Supports filtering by tickers, tags, countries, and topics. ### Method GET ### Endpoint https://api.tiingo.com/tiingo/news ### Query Parameters - **tickers** (string) - Optional - Comma-separated list of stock tickers (e.g., aapl,googl). - **tags** (string) - Optional - Comma-separated list of tags (e.g., election,argentina). ### Response #### Success Response (200) - **id** (int32) - Unique identifier for the news article. - **title** (string) - Title of the news article. - **url** (string) - URL of the news article. - **description** (string) - Long-form description of the news story. - **publishedDate** (datetime) - The datetime the news story was published in UTC. - **crawlDate** (datetime) - The datetime the news story was added to the database in UTC. - **source** (string) - The domain the news source is from. - **tickers** (string[]) - Stock tickers mentioned in the news story. - **tags** (string[]) - Tags associated with the news article. ### Response Example { "example": "[\n {\n \"id\": 123456789,\n \"title\": \"Example News Title\",\n \"url\": \"http://example.com/news\",\n \"description\": \"This is a detailed description of the news article.\",\n \"publishedDate\": \"2023-10-27T10:00:00Z\",\n \"crawlDate\": \"2023-10-27T10:05:00Z\",\n \"source\": \"example.com\",\n \"tickers\": [\"AAPL\", \"GOOGL\"],\n \"tags\": [\"technology\", \"earnings\"]\n }\n]" } ``` -------------------------------- ### Connect to IEX Websocket Endpoint Source: https://www.tiingo.com/documentation/websockets/iex Use this WebSocket endpoint to receive real-time Top-of-Book and Last Trade updates from IEX via Tiingo. ```shell wss://api.tiingo.com/iex ``` -------------------------------- ### Ticker-Specific Split Data Endpoint Source: https://www.tiingo.com/documentation/corporate-actions/splits Retrieve split data for a specific ticker, including historical time-series data. This endpoint allows filtering by a start ex-date. ```bash https://api.tiingo.com/tiingo/corporate-actions/cvs/splits ``` ```bash https://api.tiingo.com/tiingo/corporate-actions/cvs/splits?startExDate=2002-08-25 ``` -------------------------------- ### Fund Overview Endpoint Source: https://www.tiingo.com/documentation/mutual-fund-and-etf-fees Retrieve top-level fund data, including its description and share classes. ```APIDOC ## GET /tiingo/funds/ ### Description Retrieves top-level fund data, including description and share classes. ### Method GET ### Endpoint https://api.tiingo.com/tiingo/funds/ ### Parameters #### Path Parameters - **ticker** (string) - Required - The ticker symbol of the fund. ### Response #### Success Response (200) - **ticker** (string) - Ticker related to the fund. - **name** (string) - Full-length name of the fund. - **description** (string) - Long-form description of the fund. - **shareClass** (string) - Share class of the fund as described by the parent fund company. - **netExpense** (float) - The top-level net expense ratio for the fund. - **otherShareClasses** (object[]) - An array of objects representing related share classes of the given fund. - **ticker** (string) - Ticker related to the fund. - **name** (string) - Full-length name of the fund. - **shareClass** (string) - Share class of the fund as described by the parent fund company. - **netExpense** (float) - The top-level net expense ratio for the fund. ``` -------------------------------- ### Get Top-of-Book and Last Price Data Source: https://www.tiingo.com/documentation/forex Retrieve the current top-of-book (bid/ask) and last price for specified forex pairs. This endpoint is useful for real-time market monitoring. ```APIDOC ## GET /tiingo/fx//top ### Description To request top-of-book/last for specific tickers, use this REST endpoint. ### Method GET ### Endpoint https://api.tiingo.com/tiingo/fx//top ### Parameters #### Path Parameters - **ticker** (string) - Required - The forex ticker symbol (e.g., EURUSD). ### Response #### Success Response (200) - **ticker** (string) - Ticker related to the asset. - **quoteTimestamp** (datetime) - The timestamp the data was last refresh on. - **midPrice** (float) - The mid price of the current timestamp. - **bidSize** (float) - The amount of units at the bid price. - **bidPrice** (float) - The current bid price. - **askSize** (float) - The amount of units at the ask price. - **askPrice** (float) - The current ask price. ### Response Example ```json { "ticker": "EURUSD", "quoteTimestamp": "2023-10-27T10:00:00.000Z", "midPrice": 1.06500, "bidSize": 1000000.0, "bidPrice": 1.06495, "askSize": 1500000.0, "askPrice": 1.06505 } ``` ``` ```APIDOC ## GET /tiingo/fx/top ### Description To request top-of-book/last for multiple base and quote pairs, use this REST endpoint. ### Method GET ### Endpoint https://api.tiingo.com/tiingo/fx/top?tickers=,,... ### Parameters #### Query Parameters - **tickers** (string) - Required - A comma-separated list of forex ticker symbols (e.g., EURUSD,GBPUSD). ### Response #### Success Response (200) - **ticker** (string) - Ticker related to the asset. - **quoteTimestamp** (datetime) - The timestamp the data was last refresh on. - **midPrice** (float) - The mid price of the current timestamp. - **bidSize** (float) - The amount of units at the bid price. - **bidPrice** (float) - The current bid price. - **askSize** (float) - The amount of units at the ask price. - **askPrice** (float) - The current ask price. ### Response Example ```json [ { "ticker": "EURUSD", "quoteTimestamp": "2023-10-27T10:00:00.000Z", "midPrice": 1.06500, "bidSize": 1000000.0, "bidPrice": 1.06495, "askSize": 1500000.0, "askPrice": 1.06505 }, { "ticker": "GBPUSD", "quoteTimestamp": "2023-10-27T10:00:00.000Z", "midPrice": 1.21500, "bidSize": 800000.0, "bidPrice": 1.21490, "askSize": 1200000.0, "askPrice": 1.21510 } ] ``` ``` -------------------------------- ### Request Daily Metric Data (Delisted/Recycled Symbols) Source: https://www.tiingo.com/documentation/fundamentals Use this endpoint with a Tiingo permaTicker to retrieve daily fundamental metrics for symbols that have been delisted or recycled. Similar to the active ticker endpoint, the order of fields may change, so use the 'columns' parameter for consistent output. ```bash # For delisted or recycled symbols, use Tiingo permaTicker (stable identifier) https://api.tiingo.com/tiingo/fundamentals//daily ``` -------------------------------- ### Get Historical Distribution Yield Source: https://www.tiingo.com/documentation/corporate-actions/dividends Obtain historical yield data for a given Stock, ETF, or Mutual Fund. This endpoint provides daily metrics related to dividend yields. ```APIDOC ## GET /tiingo/corporate-actions//distribution-yield ### Description Retrieve historical distribution yield data for a specific ticker. ### Method GET ### Endpoint https://api.tiingo.com/tiingo/corporate-actions//distribution-yield ### Parameters #### Query Parameters - **columns** (string) - Optional - Specify which columns to return for consistent output. Example: `columns=trailingDiv1Y`. ### Response #### Success Response (200) - **date** (datetime) - Date associated with the yield. - **trailingDiv1Y** (string) - The trailing distribution yield for the asset based on the previous 1 year of distributions. ``` -------------------------------- ### Connect to IEX Websocket API Source: https://www.tiingo.com/documentation/websockets/iex Use the following WebSocket endpoint to connect to the IEX API and receive real-time Top-of-Book and Last Trade data. You can control the data volume using the 'thresholdLevel' parameter in your connection request. ```APIDOC ## Websocket Top-of-Book & Last Trade Endpoint ### Description Connect to this endpoint to receive real-time IEX Top-of-Book and Last Trade data. The `thresholdLevel` parameter can be used to filter the data stream. - `thresholdLevel` 0: Receive ALL Top-of-Book AND Last Trade updates. - `thresholdLevel` 5: Receive all Last Trade updates and only Quote updates deemed major by the system. ### Endpoint `wss://api.tiingo.com/iex` ### Request Example ``` { "eventName": "subscribe", "authorization": "YOUR_API_KEY", "eventData": { "thresholdLevel": 0 } } ``` ### Response Example (Trade Update) ```json { "service": "iex", "messageType": "A", "data": [ "T", "2023-10-26T09:30:00.123456Z", 1698316200123456789, "AAPL", null, null, null, null, null, 170.50, 100, 0, 0, 0, 0, 0 ] } ``` ### Response Example (Quote Update) ```json { "service": "iex", "messageType": "A", "data": [ "Q", "2023-10-26T09:30:00.123456Z", 1698316200123456789, "AAPL", 500, 170.45, 170.475, 170.50, 300, null, null, 0, 0, 0, 0, 0 ] } ``` ``` -------------------------------- ### Get Historical Intraday Prices Source: https://www.tiingo.com/documentation/iex Retrieve historical intraday OHLC (Open, High, Low, Close) bar data for a specific ticker, with options for date range and resampling frequency. ```APIDOC ## GET /iex//prices ### Description Retrieves historical intraday OHLC bar data for a specified ticker. You can define the date range and the resampling frequency for the bars. ### Method GET ### Endpoint https://api.tiingo.com/iex//prices ### Parameters #### Path Parameters - **ticker** (string) - Required - The stock ticker symbol (e.g., AAPL, MSFT). #### Query Parameters - **startDate** (string) - Required - The start date for the historical data in 'YYYY-MM-DD' format. - **resampleFreq** (string) - Optional - The frequency for resampling the data (e.g., '5min', '15min', '1hour', '1day'). Defaults to '5min' if not provided. ### Request Example ``` GET https://api.tiingo.com/iex/AAPL/prices?startDate=2019-01-02&resampleFreq=5min ``` ### Response #### Success Response (200) - **Data**: An array of objects, where each object represents an intraday OHLC bar. - **date** (string) - The timestamp of the bar. - **open** (number) - The opening price for the bar. - **high** (number) - The highest price during the bar. - **low** (number) - The lowest price during the bar. - **close** (number) - The closing price for the bar. - **volume** (integer) - The trading volume during the bar. #### Response Example ```json [ { "date": "2019-01-02T09:30:00.000Z", "open": 150.00, "high": 151.50, "low": 149.80, "close": 151.20, "volume": 1200000 } ] ``` ```