### Example Custom Plan Configuration (JSON) Source: https://insightsentry.com/docs/organization Illustrates the structure of a custom plan object within a success response from the 'Get Plans' endpoint. This shows the properties that can be configured for custom plans. ```json { "name": "ultra_plus", "price": 40, "feature": "ultra", "rate_limit": 80, "websocket_connections": 1, "websocket_symbols": 5, "quota": 0 } ``` -------------------------------- ### JSON Quote Data Example Source: https://insightsentry.com/docs/enterprise An example of a real-time quote data response from the WebSocket API. It includes abbreviated fields for symbol, session status, last price timestamp, volume, last trade price, and ask/bid information. ```json { "c": "NASDAQ:AAPL", "ss": "OPEN", "lt": 1733432340.0, "v": 533779.0, "lp": 243.08, "a": 243.09, "b": 243.08, "as": 520.0, "bs": 430.0 } ``` -------------------------------- ### JSON Tick Data Example Source: https://insightsentry.com/docs/enterprise An example of a real-time tick data response, representing individual trades with microsecond precision timestamps. It includes abbreviated fields for symbol, timestamp, price, and volume. ```json { "c": "NASDAQ:AAPL", "t": 1749462520.177003, "p": 242.89, "v": 200.0 } ``` -------------------------------- ### Example Calculation for Subscription Cancellation Source: https://insightsentry.com/docs/organization An illustrative example demonstrating the application of the cancellation and refund formula. It shows how to calculate the refund amount for a specific plan and remaining days. ```plaintext Plan: Pro ($15/month) Days Remaining: 20 days Calculations: - Remaining Value = ($15 / 30) * 20 = $10.00 - Cancellation Fee (10%): $1.00 - Refund Amount (90%): $9.00 Result: Admin receives $9.00 credit back ``` -------------------------------- ### JSON Series Data Example Source: https://insightsentry.com/docs/enterprise An example of a real-time series data response, providing OHLCV (Open, High, Low, Close, Volume) bar information. It uses abbreviated fields for symbol, bar end timestamp, last update, bar type, and an array of bar data. ```json { "c": "NASDAQ:AAPL", "be": 1733432399.0, "lu": 1733432399820, "bt": "1m", "s": [ { "t": 1733432340.0, "o": 242.89, "h": 243.09, "l": 242.82, "c": 243.08, "v": 533779.0 } ] } ``` -------------------------------- ### Real-time Bar Data Subscription Example Source: https://insightsentry.com/docs/ws This JSON example demonstrates a subscription to real-time bar data for a specific stock symbol. It includes parameters for the bar type and interval, and shows the structure of the data received, including timestamps, open, high, low, close prices, and volume. ```JSON { "code": "NASDAQ:AAPL", "bar_end": 1733432399.0, "last_update": 1733432399820, "bar_type": "1m", "series": [ { "time": 1733432340.0, "open": 242.89, "high": 243.09, "low": 242.82, "close": 243.08, "volume": 533779.0 } ] } ``` -------------------------------- ### Real-time Quote Data Subscription Example Source: https://insightsentry.com/docs/ws This JSON example illustrates a subscription to real-time quote data for a stock symbol. It details the structure of the data received, including last update time, total items, and specific quote details like status, last price, volume, bid/ask spreads, and price change metrics. ```JSON { "last_update": 1757061265540, "_ct": 1757061265437, "total_items": 1, "data": [ { "code": "NASDAQ:AAPL", "status": "PRE", "lp_time": 1757061117.0, "volume": 47549429.0, "last_price": 239.42, "change_percent": -0.15, "change": -0.36, "ask": 239.47, "bid": 239.42, "ask_size": 2.0, "bid_size": 1.0, "prev_close_price": 238.47, "open_price": 238.45, "low_price": 236.74, "high_price": 239.8999, "market_cap": 3558428648118.0, "delay_seconds": 0 } ] } ``` -------------------------------- ### Options API Source: https://insightsentry.com/docs/index Guide on using the Options API for accessing option chains, real-time quotes, and historical data, including symbol search and discovery. ```APIDOC ## Options API ### Description Guidance on utilizing the Options API for retrieving option chains, real-time quotes, and historical data. Covers symbol search, discovery, and price/volume quote retrieval. ### Method N/A (API Group) ### Endpoint N/A (API Group) ### Parameters N/A (API Group) ### Request Example N/A (API Group) ### Response N/A (API Group) ``` -------------------------------- ### WebSocket Connection with Authentication Source: https://insightsentry.com/docs/enterprise This example illustrates how to establish a WebSocket connection to the InsightSentry service and include the authentication token in the request headers. The `authenticationToken` is added as the `X-ZUMO-AUTH` header. ```typescript // Example WebSocket connection with authentication const socket = new WebSocket('wss://{host_name}/ws'); // Set the authentication header before connecting socket.setRequestHeader('X-ZUMO-AUTH', authenticationToken); ``` -------------------------------- ### Retrieve Organization Plans (Bash) Source: https://insightsentry.com/docs/organization Example using cURL to retrieve all available plans for an organization, including regular and custom plans. This requires an Authorization header with a Bearer token. ```bash curl -X GET "https://insightsentry.com/api/organization/plans" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Example Option Chain Response (Strike Filter) Source: https://insightsentry.com/docs/options A sample JSON response for an option chain query filtered by strike price. It demonstrates the data structure returned, including option codes, pricing details, and Greeks for contracts matching the specified strike. ```json { "underlying_code": "NASDAQ:AAPL", "last_update": 1756912027000, "data": [ { "code": "OPRA:AAPL270617C210.0", "ask_price": 8.5, "bid_price": 8.0, "delta": 0.45, "gamma": 0.018, "implied_volatility": 0.28, "type": "CALL", "rho": 0.06, "strike_price": 210, "theoretical_price": 8.25, "theta": -0.08, "vega": 0.18, "bid_iv": 0.27, "ask_iv": 0.29, "expiration": 20270617 }, { "code": "OPRA:AAPL280115C210.0", "ask_price": 15.2, "bid_price": 14.8, "delta": 0.52, "gamma": 0.015, "implied_volatility": 0.26, "type": "CALL", "rho": 0.09, "strike_price": 210, "theoretical_price": 15.0, "theta": -0.06, "vega": 0.22, "bid_iv": 0.25, "ask_iv": 0.27, "expiration": 20280115 } ] } ``` -------------------------------- ### GET /v3/symbols/quotes - Real-time Option Prices Source: https://insightsentry.com/docs/options Retrieve real-time pricing and volume data for option contracts. Supports fetching quotes for multiple options (up to 10) by separating codes with commas. ```APIDOC ## GET /v3/symbols/quotes ### Description Retrieves real-time bid/ask prices, last trade information, and trading volume for option contracts. You can request quotes for multiple options (up to 10) by separating their codes with commas. ### Method GET ### Endpoint https://api.insightsentry.com/v3/symbols/quotes ### Parameters #### Query Parameters - **codes** (string) - Required - A comma-separated list of option codes (e.g., `OPRA:AAPL271217P370.0,OPRA:AAPL251219C145.0`). ### Request Example ```bash GET https://api.insightsentry.com/v3/symbols/quotes?codes=OPRA:AAPL271217P370.0,OPRA:AAPL251219C145.0,OPRA:AAPL261218P50.0 ``` ### Response #### Success Response (200) - **last_update** (integer) - Timestamp of the last update. - **_ct** (integer) - Client timestamp. - **total_items** (integer) - Total number of items returned. - **data** (array) - An array of quote objects, each containing: - **code** (string) - The option contract code. - **status** (string) - The trading status of the option (e.g., "CLOSED"). - **lp_time** (float) - Last price timestamp. - **volume** (float) - Trading volume for the option. - **last_price** (float) - The last traded price. - **change_percent** (float) - Percentage change from the previous close (if available). - **change** (float) - Price change from the previous close (if available). - **ask** (float) - The current ask price. - **bid** (float) - The current bid price. - **ask_size** (float) - The size of the ask order. - **bid_size** (float) - The size of the bid order. - **prev_close_price** (float) - The previous day's closing price (if available). - **open_price** (float) - The opening price for the current trading session. - **low_price** (float) - The lowest price reached in the current trading session. - **high_price** (float) - The highest price reached in the current trading session. - **delay_seconds** (integer) - Delay in seconds for the data. #### Response Example ```json { "last_update": 1756978199901, "_ct": 1756978199796, "total_items": 3, "data": [ { "code": "OPRA:AAPL271217P370.0", "status": "CLOSED", "lp_time": 1750065411.0, "volume": 0.0, "last_price": 166.14, "ask": 133.55, "bid": 129.75, "ask_size": 107.0, "bid_size": 107.0, "open_price": 166.14, "low_price": 166.14, "high_price": 166.14, "delay_seconds": 0 }, { "code": "OPRA:AAPL251219C145.0", "status": "CLOSED", "lp_time": 1756918904.0, "volume": 6.0, "last_price": 94.2, "change_percent": 10.02, "change": 8.6, "ask": 96.15, "bid": 94.4, "ask_size": 195.0, "bid_size": 258.0, "prev_close_price": 85.62, "open_price": 93.1, "low_price": 93.1, "high_price": 94.28, "delay_seconds": 0 }, { "code": "OPRA:AAPL261218P50.0", "status": "CLOSED", "lp_time": 1756910857.0, "volume": 1.0, "last_price": 0.09, "change_percent": -18.18, "change": -0.02, "ask": 0.12, "bid": 0.07, "ask_size": 111.0, "bid_size": 98.0, "prev_close_price": 0.11, "open_price": 0.09, "low_price": 0.09, "high_price": 0.09, "delay_seconds": 0 } ] } ``` ``` -------------------------------- ### Example Option Chain Response (Expiration Filter) Source: https://insightsentry.com/docs/options A sample JSON response for an option chain query filtered by expiration date. It includes details for both CALL and PUT options, such as strike price, bid/ask prices, and various option Greeks. ```json { "underlying_code": "NASDAQ:AAPL", "last_update": 1756912027000, "data": [ { "code": "OPRA:AAPL270617C150.0", "ask_price": 12.5, "bid_price": 12.0, "delta": 0.65, "gamma": 0.02, "implied_volatility": 0.25, "type": "CALL", "rho": 0.08, "strike_price": 150, "theoretical_price": 12.25, "theta": -0.05, "vega": 0.15, "bid_iv": 0.24, "ask_iv": 0.26, "expiration": 20270617 }, { "code": "OPRA:AAPL270617P150.0", "ask_price": 8.2, "bid_price": 7.8, "delta": -0.35, "gamma": 0.02, "implied_volatility": 0.23, "type": "PUT", "rho": -0.06, "strike_price": 150, "theoretical_price": 8.0, "theta": -0.04, "vega": 0.15, "bid_iv": 0.22, "ask_iv": 0.24, "expiration": 20270617 } ] } ``` -------------------------------- ### List Organization Members Request (Bash) Source: https://insightsentry.com/docs/organization Example of how to retrieve a paginated list of all organization members using cURL. Requires an API key for authentication and allows specifying page number and number of members per page. ```bash curl -X GET "https://insightsentry.com/api/organization/members?page=1&limit=10" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Get Available Options using BASH Source: https://insightsentry.com/docs/options Retrieve all available option contracts for a given underlying symbol using the `/v3/options/list` endpoint. This endpoint excludes expired options and requires the symbol code as a parameter. ```bash GET https://api.insightsentry.com/v3/options/list?code=NASDAQ:AAPL ``` -------------------------------- ### Get Symbol Info and Option Chain Metadata using BASH Source: https://insightsentry.com/docs/options Fetch comprehensive metadata for a symbol, including option chain details like expiration dates and strike prices, using the `/v3/symbols/:symbol/info` endpoint. This is crucial for understanding available option data. ```bash GET https://api.insightsentry.com/v3/symbols/CME_MINI:NQZ2025/info ``` -------------------------------- ### WebSocket API Subscription with Dividend Adjustment Source: https://insightsentry.com/docs/ws This JSON example demonstrates how to request dividend-adjusted price series for equities data. By setting `dadj: true`, all price values in the response will be adjusted for dividends. This is crucial for accurate historical analysis and backtesting. ```JSON { "api_key": "", "subscriptions": [ {"code": "NASDAQ:AAPL", "bar_type": "day", "bar_interval": 1, "dadj": true} ] } ``` -------------------------------- ### Get Symbol Info (Option Chain Metadata) API Source: https://insightsentry.com/docs/options The `/v3/symbols/:symbol/info` endpoint provides comprehensive metadata about a symbol, including the `option_info` field which contains available expiration dates and strike prices for all option series. ```APIDOC ## GET /v3/symbols/:symbol/info ### Description Retrieves metadata for a specific symbol, including detailed option chain information such as available expiration dates and strike prices. This is crucial for understanding the available option data for a symbol. ### Method GET ### Endpoint `/v3/symbols/:symbol/info` ### Path Parameters - **symbol** (string) - Required - The symbol code for which to retrieve information (e.g., 'CME_MINI:NQZ2025'). ### Request Example ``` GET https://api.insightsentry.com/v3/symbols/CME_MINI:NQZ2025/info ``` ### Response #### Success Response (200) - **code** (string) - The symbol code. - **type** (string) - The type of the symbol (e.g., 'FUTURES'). - **description** (string) - A description of the symbol. - **currency_code** (string) - The currency code for the symbol. - **expiration** (integer) - The main expiration date in YYYYMMDD format. - **option_info** (array) - An array containing information about option series. - **name** (string) - The name of the option series (e.g., 'E-mini Nasdaq-100 Options'). - **type** (string) - The exercise style ('AMERICAN' or 'EUROPEAN'). - **series** (array) - An array of option series. - **expiration_date** (integer) - The expiration date in YYYYMMDD format. - **underlying** (string) - The underlying contract code. - **strikes** (array of numbers or strings) - An array of available strike prices. #### Response Example ```json { "code": "CME_MINI:NQZ2025", "type": "FUTURES", "description": "E-mini Nasdaq-100 Futures (Dec 2025)", "currency_code": "USD", "expiration": 20251219, "option_info": [ { "name": "E-mini Nasdaq-100 Options", "type": "AMERICAN", "series": [ { "expiration_date": 20251219, "underlying": "CME_MINI:NQZ2025", "strikes": [2500.0, 3000.0, 3500.0, "...", 35500.0] } ] }, { "name": "E-mini Nasdaq-100 Monday Weekly Options - Week 2", "type": "EUROPEAN", "series": [ { "expiration_date": 20251013, "underlying": "CME_MINI:NQZ2025", "strikes": [17500.0, 18000.0, "...", 29000.0] } ] } ] } ``` ### Important Notes - Check for the existence of the `option_info` field, as not all symbols have options data. - For futures options, use specific futures contract codes (e.g., `CME_MINI:NQZ2025`), not continuous contracts (e.g., `CME_MINI:NQ1!`). - The `strikes` array can be extensive; the example shows truncated data. - Equity options usually have standardized expiration dates and strikes. ``` -------------------------------- ### WebSocket API Subscription with Extended Market Hours Source: https://insightsentry.com/docs/ws This JSON example shows how to configure a WebSocket API subscription to include extended market hours data. The `extended: false` parameter is used to restrict data to regular trading hours only. This is useful for applications that only need data during the main trading session. ```JSON { "api_key": "", "subscriptions": [ {"code": "NASDAQ:AAPL", "bar_type": "minute", "bar_interval": 1, "extended": false} ] } ``` -------------------------------- ### WebSocket Connection and Email Registration Source: https://insightsentry.com/docs/enterprise Demonstrates how to establish a WebSocket connection with the authentication token and register an email for support communications. ```APIDOC ## WebSocket Connection and Email Registration ### Description This section details how to connect to the WebSocket service using the obtained `authenticationToken` and how to register an email for support communications. ### Establishing WebSocket Connection 1. Add the `authenticationToken` to your WebSocket headers as `X-ZUMO-AUTH`. 2. This token authenticates all subsequent communications with the server. ### Request Example (JavaScript WebSocket) ```javascript // Example WebSocket connection with authentication const socket = new WebSocket('wss://{host_name}/ws'); // Set the authentication header before connecting socket.setRequestHeader('X-ZUMO-AUTH', authenticationToken); ``` ### Email Registration After a successful connection is established, send your email address to the server for support communications. **Important:** Repeat this registration after every reconnection. ### Request Example (JavaScript Send Email) ```javascript // Send email registration after connection is established socket.onopen = function() { // Register email for support purposes socket.send(JSON.stringify({ "email": "your-engineering-team@example.com" })); }; ``` **Note:** The registered email is solely for support communications and service updates, not for user verification. ``` -------------------------------- ### API Playground Source: https://insightsentry.com/docs/options Experiment with all Insightsentry API endpoints using an interactive demo. Fill in parameters, submit requests, view responses, and copy cURL commands. ```APIDOC ## Interactive REST API Demo ### Description You can experiment with all our endpoints using the interactive API playground. This tool allows you to test API requests directly within your browser. ### How to Use 1. **Choose an endpoint**: Select the desired API endpoint from the list. 2. **Fill in parameters**: Provide the necessary path, query, or request body parameters. 3. **Submit requests**: Click the "Send" or "Execute" button to make the API call. 4. **View responses**: Examine the returned data, status codes, and headers. 5. **Copy cURL**: Easily copy the generated cURL command to integrate into your projects or convert it to other programming languages using AI or other tools. ``` -------------------------------- ### Get Member API Source: https://insightsentry.com/docs/organization Retrieves detailed information about a specific organization member, including API key, quota, and usage statistics. ```APIDOC ## POST /api/organization/members/get ### Description Retrieves detailed information about a specific organization member, including API key, quota, and usage statistics. ### Method POST ### Endpoint /api/organization/members/get ### Parameters #### Request Body - **uid** (string) - Yes - Unique identifier. ### Request Example ```json { "uid": "john_doe" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **member** (object) - Contains detailed information about the member. - **uid** (string) - Unique identifier of the member. - **email** (string) - Email address of the member. - **full_name** (string) - Full name of the member. - **role** (string) - Role of the member in the organization. - **plan** (string) - Subscription plan ID. - **status** (string) - Current status of the member (e.g., "active"). - **created_at** (string) - Timestamp when the member was created. - **plan_end_at** (string) - Timestamp when the subscription plan ends. - **api_key** (string) - API key for the member. - **websocket_symbols** (number) - Number of websocket symbols allowed. - **websocket_connections** (number) - Number of websocket connections allowed. - **newsfeed** (boolean) - Indicates if newsfeed is enabled. - **rate_limit** (number) - Rate limit for API requests. - **quota** (number) - Data quota allocated to the member (0 for unlimited). - **quota_exceeded** (boolean) - Indicates if the quota has been exceeded. - **quota_reset_time** (string) - Timestamp when the quota resets. #### Response Example ```json { "success": true, "member": { "uid": "john_doe", "email": "org_john_doe@company.com", "full_name": "John Doe", "role": "member", "plan": "pro", "status": "active", "created_at": "2025-10-02T00:00:00.000Z", "plan_end_at": "2025-11-01T00:00:00.000Z", "api_key": "member_api_key_here", "websocket_symbols": 2, "websocket_connections": 1, "newsfeed": true, "rate_limit": 60, "quota": 50000, "quota_exceeded": false, "quota_reset_time": "2025-10-03T00:00:00.000Z" } } ``` ``` -------------------------------- ### Get Member Request Body (JSON) Source: https://insightsentry.com/docs/organization Specifies the JSON payload for retrieving detailed information about a specific member. Requires the unique identifier (uid) of the member. ```json { "uid": "john_doe" } ``` -------------------------------- ### Subscribe to Market Data Quote Source: https://insightsentry.com/docs/ws Example of subscribing to quote data for a specific symbol (e.g., TSLA) on the market data WebSocket endpoint. This message is part of the initial subscription request. ```json { "api_key": "", "subscriptions": [ {"code": "NASDAQ:TSLA", "type": "quote"} ] } ``` -------------------------------- ### WebSocket API Source: https://insightsentry.com/docs/index Documentation for connecting to the InsightSentry WebSocket API for real-time market data, news feeds, and streaming financial information. ```APIDOC ## WebSocket API Documentation ### Description Guides for connecting to the WebSocket API to receive real-time market data, news feeds, and streaming financial information. Includes connection and authentication details, message formats, and code examples. ### Method N/A (Connection Protocol) ### Endpoint N/A (Connection Protocol) ### Parameters N/A (Connection Protocol) ### Request Example N/A (Connection Protocol) ### Response N/A (Connection Protocol) ``` -------------------------------- ### Update Market Data Subscriptions Source: https://insightsentry.com/docs/ws Example of modifying existing subscriptions on the market data WebSocket. Sending a new subscription message replaces all previous subscriptions with the ones listed in the new message. ```json { "api_key": "", "subscriptions": [ {"code": "NASDAQ:AAPL", "type": "series", "bar_type": "minute", "bar_interval": 1}, {"code": "NASDAQ:AAPL", "type": "quote"} // NASDAQ:TSLA quote subscription is removed as it's not in the new list ] } ``` -------------------------------- ### Data Package (High-performance WebSocket/PubSub) Source: https://insightsentry.com/docs/index Information on enterprise-grade WebSocket and PubSub solutions for high-frequency analysis and large-scale applications. ```APIDOC ## Data Package (High-performance WebSocket/PubSub) ### Description Details on enterprise-grade WebSocket and PubSub solutions designed for high-frequency data streaming, PubSub architecture, scaling, and deployment. ### Method N/A (Service Offering) ### Endpoint N/A (Service Offering) ### Parameters N/A (Service Offering) ### Request Example N/A (Service Offering) ### Response N/A (Service Offering) ``` -------------------------------- ### Get Available Options API Source: https://insightsentry.com/docs/options Once you have the underlying symbol, retrieve all available option contracts using the `/v3/options/list` endpoint. This endpoint returns all available options for the specified underlying symbol, excluding expired options. ```APIDOC ## GET /v3/options/list ### Description Retrieves a list of all available option contracts for a given underlying symbol. This endpoint excludes expired options. ### Method GET ### Endpoint `/v3/options/list` ### Query Parameters - **code** (string) - Required - The symbol code of the underlying asset (e.g., 'NASDAQ:AAPL'). ### Request Example ``` GET https://api.insightsentry.com/v3/options/list?code=NASDAQ:AAPL ``` ### Response #### Success Response (200) - **last_update** (integer) - Timestamp of the last update. - **codes** (array of strings) - A list of option contract codes. #### Response Example ```json { "last_update": 1756912027000, "codes": [ "OPRA:AAPL260417P325.0", "OPRA:AAPL260618C5.0" ] } ``` ### Notes - For futures options, use specific contract codes (e.g., `CME_MINI:NQU2025`) instead of continuous contracts (e.g., `CME_MINI:NQ1!`). Each futures contract has its own set of options. ``` -------------------------------- ### Authenticate with InsightSentry Server Source: https://insightsentry.com/docs/enterprise This snippet demonstrates how to authenticate with the InsightSentry server using the access token obtained from Azure. It sends a POST request with the access token in the request body. The output is a JSON object containing the final authentication token. ```bash curl -X POST "https://{host_name}/.auth/login/aad" \ -H "Content-Type: application/json" \ -d '{"access_token": "JWT_TOKEN_HERE..."}' ``` -------------------------------- ### Search for Symbols using BASH Source: https://insightsentry.com/docs/options Use the `/v3/symbols/search` endpoint to find symbols. Provide a query parameter for the search term. This is the first step before working with options data. ```bash GET https://api.insightsentry.com/v3/symbols/search?query=apple ``` -------------------------------- ### Quote Data Format Source: https://insightsentry.com/docs/enterprise Real-time market quotes provide current pricing and volume information with optimized field names. ```APIDOC ## Quote Data Format Real-time market quotes provide current pricing and volume information. ### Parameters #### Request Body This endpoint does not typically have a request body for receiving data. Data is pushed from the server. ### Response #### Success Response (200) - **c** (string) - Symbol identifier - **ss** (string) - Session Status - **lt** (number) - Last price timestamp - **v** (number) - Trading volume - **lp** (number) - Last trade price - **a** (number) - Ask price - **b** (number) - Bid price - **as** (number) - Size of ask orders - **bs** (number) - Size of bid orders #### Response Example ```json { "c": "NASDAQ:AAPL", "ss": "OPEN", "lt": 1733432340.0, "v": 533779.0, "lp": 243.08, "a": 243.09, "b": 243.08, "as": 520.0, "bs": 430.0 } ``` ``` -------------------------------- ### Update Member Request Body - Upgrade (JSON) Source: https://insightsentry.com/docs/organization Example JSON request body for updating a member's subscription plan to 'ultra'. This operation can trigger proration if the plan is changed to a different tier. ```json { "uid": "john_doe", "plan": "ultra" } ``` -------------------------------- ### Subscription Rules and Limits Source: https://insightsentry.com/docs/ws Important guidelines for managing WebSocket subscriptions. ```APIDOC ## Subscription Rules & Limits ### Description Adhere to these rules and limits when interacting with the WebSocket API subscriptions to ensure stable service and avoid message rejection. ### Authentication Requirement - Every subscription message (initial or update) must include a valid `api_key`. ### Rate Limiting - **Limit:** Do not exceed 300 messages per 5-minute interval. - **Consequence:** Exceeding the limit will result in subsequent messages being temporarily ignored. - **Note:** Rate limiting applies only to new messages sent; existing data feeds remain active. ### Empty Subscriptions - Sending an empty `subscriptions` array is not permitted. - To unsubscribe from all data feeds, disconnect the WebSocket connection and reconnect when needed. ### Multiple Symbols - Subscribe to multiple symbols within a single message by including multiple subscription objects in the `subscriptions` array. - The number of concurrent subscriptions is subject to your account's plan limits. ``` -------------------------------- ### GET /v3/options/strike Source: https://insightsentry.com/docs/options Retrieves option chain data for options with a specific strike price. This endpoint is ideal for comparing options at the same strike across different expiration dates. Sorting by expiration can help analyze time decay. ```APIDOC ## GET /v3/options/strike ### Description Retrieves option chain data for options with a specific strike price. Allows filtering by underlying symbol and strike price, with options for sorting. ### Method GET ### Endpoint /v3/options/strike ### Parameters #### Query Parameters - **code** (string) - Required - The underlying symbol for the options (e.g., "NASDAQ:AAPL"). - **strike** (number) - Required - The strike price for the options (e.g., 210). - **sortBy** (string) - Optional - The field to sort the results by. Available fields include: `ask_price`, `bid_price`, `delta`, `gamma`, `expiration`, `implied_volatility`, `rho`, `strike_price`, `theoretical_price`, `theta`, `vega`. Defaults to `expiration`. - **sort** (string) - Optional - The sort order. Accepts `asc` (ascending) or `desc` (descending). Defaults to `asc`. ### Request Example ```bash GET https://api.insightsentry.com/v3/options/strike?code=NASDAQ:AAPL&strike=210&sortBy=expiration&sort=asc ``` ### Response #### Success Response (200) - **underlying_code** (string) - The underlying symbol for the options. - **last_update** (integer) - Timestamp of the last update. - **data** (array) - An array of option chain data objects. - **code** (string) - Unique identifier for the option contract. - **ask_price** (number) - The asking price for the option. - **bid_price** (number) - The bidding price for the option. - **delta** (number) - The option's delta, measuring sensitivity to underlying price changes. - **gamma** (number) - The option's gamma, measuring the rate of change of delta. - **implied_volatility** (number) - The implied volatility of the option. - **type** (string) - The type of option ('CALL' or 'PUT'). - **rho** (number) - The option's rho, measuring sensitivity to interest rate changes. - **strike_price** (number) - The strike price of the option. - **theoretical_price** (number) - The theoretical fair value of the option. - **theta** (number) - The option's theta, measuring time decay. - **vega** (number) - The option's vega, measuring sensitivity to implied volatility changes. - **bid_iv** (number) - The implied volatility at the bid price. - **ask_iv** (number) - The implied volatility at the ask price. - **expiration** (integer) - The expiration date in YYYYMMDD format. #### Response Example ```json { "underlying_code": "NASDAQ:AAPL", "last_update": 1756912027000, "data": [ { "code": "OPRA:AAPL270617C210.0", "ask_price": 8.5, "bid_price": 8.0, "delta": 0.45, "gamma": 0.018, "implied_volatility": 0.28, "type": "CALL", "rho": 0.06, "strike_price": 210, "theoretical_price": 8.25, "theta": -0.08, "vega": 0.18, "bid_iv": 0.27, "ask_iv": 0.29, "expiration": 20270617 } ] } ``` ``` -------------------------------- ### Obtain Azure OAuth Access Token Source: https://insightsentry.com/docs/enterprise This snippet shows how to obtain an OAuth access token from Microsoft Azure using client credentials. It requires your Azure tenant ID, client ID, scope, and client secret. The output is a JSON object containing the access token. ```bash curl -X POST "https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "client_id={client_id}&scope={scope}&client_secret={client_secret}&grant_type=client_credentials" ``` -------------------------------- ### Connect and Subscribe to WebSocket Data Source: https://insightsentry.com/docs/ws Establishes a connection to the Insightsentry WebSocket URI, sends a subscription message containing API key and desired data types ('quote', 'series'), and initiates background tasks for pinging and message handling. Manages connection lifecycle and exceptions. ```python async def connect_and_subscribe(): uri = "wss://realtime.insightsentry.com/live" try: async with websockets.connect(uri) as websocket: print("Connected to websocket") # Send subscription message subMsg = json.dumps({ "api_key": api_key, ## change "api_key" field name to be "auth" if you've obtained API key from our portal directly (not via RapidAPI) "subscriptions": [ # Subscribe to either "series" or "quote" types # With 1 Symbol Subscription you can subscribe to 1 "series" or 10 "quote" { "code": "NASDAQ:AAPL", "type": "quote" }, { "code": "CME_MINI:ES1!", "type": "quote" } #, # { # "code": "NASDAQ:GOOGL", # "type": "series", # "bar_type": "second", # "extended": "false", # to receive only regular trading hours data # "bar_interval": 1, # "recent_bars": 'true' # to receive recent bars whenever connected/reconnected # }, # { # "code": "NASDAQ:AAPL", # "type": "series", # "bar_type": "tick", # "bar_interval": 1, # "recent_bars": 'false' # } ] }) await websocket.send(subMsg) # Periodically sending 'ping' can help to keep connection sticky ping_task = asyncio.create_task(send_ping(websocket)) try: # Handle incoming messages await handle_messages(websocket) finally: # Cancel ping task when done ping_task.cancel() try: await ping_task except asyncio.CancelledError: pass except websockets.exceptions.ConnectionClosed as e: print(f"Connection closed: {e}") raise except Exception as e: print(f"Connection error: {e}") raise ``` -------------------------------- ### Subscribe to Market Data Series Source: https://insightsentry.com/docs/ws Example of subscribing to minute bar series data for a specific symbol (e.g., AAPL) on the market data WebSocket endpoint. This message handles both authentication and the initial data feed subscription. ```json { "api_key": "", "subscriptions": [ {"code": "NASDAQ:AAPL", "type": "series", "bar_type": "minute", "bar_interval": 1} ] } ``` -------------------------------- ### Series Data Format Source: https://insightsentry.com/docs/enterprise Series data provides OHLCV (Open, High, Low, Close, Volume) bar information for different time intervals with abbreviated field names. ```APIDOC ## Series Data Format Series data provides OHLCV (Open, High, Low, Close, Volume) bar information for different time intervals. ### Parameters #### Request Body This endpoint does not typically have a request body for receiving data. Data is pushed from the server. ### Response #### Success Response (200) - **c** (string) - Symbol identifier - **be** (number) - Bar end timestamp - **lu** (number) - Last update timestamp - **bt** (string) - Bar interval type - **s** (array) - Array of OHCLV data - **t** (number) - Bar timestamp - **o** (number) - Opening price - **h** (number) - Highest price - **l** (number) - Lowest price - **c** (number) - Closing price - **v** (number) - Trading volume #### Response Example ```json { "c": "NASDAQ:AAPL", "be": 1733432399.0, "lu": 1733432399820, "bt": "1m", "s": [ { "t": 1733432340.0, "o": 242.89, "h": 243.09, "l": 242.82, "c": 243.08, "v": 533779.0 } ] } ``` ``` -------------------------------- ### Authenticate Organization API Request (TypeScript) Source: https://insightsentry.com/docs/organization Example of how to authenticate an Organization API request using a Bearer token in TypeScript. This snippet demonstrates making a POST request to create a member, including the Authorization header and request body. ```typescript const apiKey = 'your_organization_api_key'; const response = await fetch('https://insightsentry.com/api/organization/members/create', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ uid: 'john_doe', // You can set any uid you want within 100 characters plan: 'pro', full_name: 'John Doe' }) }); const data = await response.json(); console.log(data); ``` -------------------------------- ### Market Data Initial Subscription Source: https://insightsentry.com/docs/ws Authenticate and subscribe to market data feeds on the WebSocket. ```APIDOC ## Market Data Initial Subscription ### Description After connecting to the market data WebSocket endpoint, send a JSON message to authenticate and subscribe to desired data feeds. This single message handles both authentication and initial symbol subscriptions. ### Method WebSocket Message (JSON) ### Parameters #### Request Body - **api_key** (string) - Required - Your unique WebSocket API key. - **subscriptions** (array) - Required - An array of subscription objects. ##### Subscription Object Parameters - **code** (string) - Required - Symbol identifier (e.g., `"NASDAQ:AAPL"`, `"BINANCE:BTCUSDT"`). - **type** (string) - Optional - Data feed type: `"series"` (default) or `"quote"`. - **bar_type** (string) - Optional - Time interval for series data: `"minute"`, `"hour"`, `"day"`, or `"tick"`. - **bar_interval** (integer) - Optional - Number of units per bar (e.g., 1, 5, 15). Required if `bar_type` is specified. - **extended** (boolean) - Optional - Include extended hours (default: true). - **dadj** (boolean) - Optional - Apply dividend adjustment (default: false). ### Request Example ```json { "api_key": "", "subscriptions": [ {"code": "NASDAQ:AAPL", "type": "series", "bar_type": "minute", "bar_interval": 1}, {"code": "NASDAQ:TSLA", "type": "quote"} ] } ``` ### Notes - The `type` parameter defaults to `"series"` if not provided. - For `"series"` data, `bar_type` and `bar_interval` are typically required for time-series data. ``` -------------------------------- ### Combined Market Data Subscription Source: https://insightsentry.com/docs/ws An example of an initial subscription message to the market data WebSocket, including both series data for AAPL and quote data for TSLA. This demonstrates how to subscribe to multiple data types and symbols in a single request. ```json { "api_key": "", "subscriptions": [ {"code": "NASDAQ:AAPL", "type": "series", "bar_type": "minute", "bar_interval": 1}, {"code": "NASDAQ:TSLA", "type": "quote"} ] } ``` -------------------------------- ### Organization API Source: https://insightsentry.com/docs/index Manage organization members programmatically via API, including creating, updating, and managing subscription plans using credits. ```APIDOC ## Organization API ### Description Allows programmatic management of organization members, including creation, updates, and subscription plan management using credits, with features like proration and credit systems. ### Method N/A (API Group) ### Endpoint N/A (API Group) ### Parameters N/A (API Group) ### Request Example N/A (API Group) ### Response N/A (API Group) ```