### Get Latest One-Minute Implied Monies Data (API Examples) Source: https://orats.com/docs/live-intraday-api Provides example API calls in cURL, JavaScript, and Python for retrieving the latest one-minute implied monies data. These examples demonstrate how to authenticate and specify parameters like the ticker. ```bash curl -L "https://api.orats.io/datav2/live/one-minute/monies/implied?token=my-token&ticker=AAPL" ``` ```javascript fetch("https://api.orats.io/datav2/live/one-minute/monies/implied?token=my-token&ticker=AAPL") .then(response => response.json()) .then(data => console.log(data)); ``` ```python import requests url = "https://api.orats.io/datav2/live/one-minute/monies/implied" params = { "token": "my-token", "ticker": "AAPL" } response = requests.get(url, params=params) print(response.json()) ``` -------------------------------- ### Orats API Summaries History Request (JavaScript) Source: https://orats.com/docs/live-intraday-api JavaScript code snippet to make a GET request to the Orats API for historical one-minute summaries. This example uses the fetch API to construct the URL with necessary query parameters like token, ticker, and tradeDate. Error handling for the response is included. ```javascript async function getSummariesHistory(token, ticker, tradeDate) { const url = `https://api.orats.io/datav2/hist/live/one-minute/summaries?token=${token}&ticker=${ticker}&tradeDate=${tradeDate}`; try { const response = await fetch(url); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.text(); // Or response.json() if the API returns JSON console.log(data); return data; } catch (error) { console.error('Error fetching summaries history:', error); } } // Example usage: // const myToken = 'your-api-token'; // const stockTicker = 'AAPL'; // const dateRange = '202203211200,202204201300'; // Max 40 trading days // getSummariesHistory(myToken, stockTicker, dateRange); ``` -------------------------------- ### GET /datav2/live/summaries Source: https://orats.com/docs/live-data-api Retrieves live SMV summary data, optionally filtered by ticker. ```APIDOC ## GET /datav2/live/summaries ### Description Retrieves live SMV summary data. ### Method GET ### Endpoint https://api.orats.io/datav2/live/summaries ### Parameters #### Query Parameters - **token** (string) - Required - API token for authentication. - **ticker** (string) - Optional - The ticker symbol to retrieve data for (e.g., AAPL). ### Request Example ```bash curl -L "https://api.orats.io/datav2/live/summaries?token=your-token&ticker=AAPL" ``` ### Response #### Success Response (200) - **data** (array) - An array of summary data objects. The structure of these objects is not detailed in the provided text but would typically include relevant summary metrics for the requested ticker or all tickers if none is specified. #### Response Example (Specific example not provided in the source text) ``` -------------------------------- ### GET /websites/orats Source: https://orats.com/docs/live-intraday-api This endpoint appears to be an internal or legacy endpoint and is not publicly documented for external API use. ```APIDOC ## GET /websites/orats ### Description This endpoint is part of the orats website and may serve internal or legacy functions. It is not part of the documented public API for external use. ### Method GET ### Endpoint `/websites/orats` ### Parameters None documented for public use. ### Request Example (Not applicable for public API) ### Response (Not documented for public API) ``` -------------------------------- ### Retrieve Core Stock Data (JSON Example) Source: https://orats.com/docs/delayed-data-api This JSON object represents the core data response for a stock, including various financial metrics like trade date, stock price, dividends, and implied volatility. It serves as an example of the data structure returned by the ORATS API. ```json { "data": [ { "ticker": "AAPL", "tradeDate": "2023-11-03", "stockPrice": 176.78, "annActDiv": 0.982574, "annIdiv": 0.287519, "borrow30": 0.0537541, "borrow2y": 0.04751, "confidence": 0.710872, "exErnIv10d": 0.195644, "exErnIv20d": 0.188896, "exErnIv30d": 0.185834, "exErnIv60d": 0.192219, "exErnIv90d": 0.20357, "exErnIv6m": 0.217763, "exErnIv1y": 0.228013, "ieeEarnEffect": 1.85201, "impliedMove": 0.028577, "impliedNextDiv": 0.200508, "iv10d": 0.195644, "iv20d": 0.188896, "iv30d": 0.185834, "iv60d": 0.192219, "iv90d": 0.205658, "iv6m": 0.221108, "iv1y": 0.233177, "mwAdj30": 0.002342, "mwAdj2y": 0.004672, "nextDiv": 0.24, "rDrv30": 0.077746, "rDrv2y": 0.096629, "rSlp30": 3.91465, "rSlp2y": 4.49114, "rVol30": 0.183112, "rVol2y": 0.248168, "rip": 1.84319, "riskFree30": 0.055331, "riskFree2y": 0.052577, "skewing": -0.18824, "contango": -0.018600000475998968, "totalErrorConf": 0.000128, "dlt5Iv10d": 0.206691, "dlt5Iv20d": 0.202587, "dlt5Iv30d": 0.189626, "dlt5Iv60d": 0.180344, "dlt5Iv90d": 0.189285, "dlt5Iv6m": 0.196934, "dlt5Iv1y": 0.206532, "exErnDlt5Iv10d": 0.206691, "exErnDlt5Iv20d": 0.202587, "exErnDlt5Iv30d": 0.189626, "exErnDlt5Iv60d": 0.180344, "exErnDlt5Iv90d": 0.187198, "exErnDlt5Iv6m": 0.193588, "exErnDlt5Iv1y": 0.201367, "dlt25Iv10d": 0.189584, "dlt25Iv20d": 0.175341, "dlt25Iv30d": 0.173086, "dlt25Iv60d": 0.180378, "dlt25Iv90d": 0.187436, "dlt25Iv6m": 0.200198, "dlt25Iv1y": 0.211505, "exErnDlt25Iv10d": 0.189584, "exErnDlt25Iv20d": 0.175341, "exErnDlt25Iv30d": 0.173086, "exErnDlt25Iv60d": 0.180378, "exErnDlt25Iv90d": 0.185349, "exErnDlt25Iv6m": 0.196852, "exErnDlt25Iv1y": 0.206341, "dlt75Iv10d": 0.22289, "dlt75Iv20d": 0.212007, "dlt75Iv30d": 0.209122, "dlt75Iv60d": 0.219619, "dlt75Iv90d": 0.23408, "dlt75Iv6m": 0.251754, "dlt75Iv1y": 0.266157, "exErnDlt75Iv10d": 0.22289, "exErnDlt75Iv20d": 0.212007, "exErnDlt75Iv30d": 0.209122, "exErnDlt75Iv60d": 0.219619, "exErnDlt75Iv90d": 0.231993, "exErnDlt75Iv6m": 0.248408, "exErnDlt75Iv1y": 0.260993, "dlt95Iv10d": 0.350401, "dlt95Iv20d": 0.331203, "dlt95Iv30d": 0.329991, "dlt95Iv60d": 0.316906, "dlt95Iv90d": 0.329715, "dlt95Iv6m": 0.353314, "dlt95Iv1y": 0.353414, "exErnDlt95Iv10d": 0.350401, "exErnDlt95Iv20d": 0.331203, "exErnDlt95Iv30d": 0.329991, "exErnDlt95Iv60d": 0.316906, "exErnDlt95Iv90d": 0.327628, "exErnDlt95Iv6m": 0.349969, "exErnDlt95Iv1y": 0.34825, "fwd30_20": 0.179554, "fwd60_30": 0.198399, "fwd90_30": 0.214885, "fwd90_60": 0.230193, "fwd180_90": 0.235547, "fexErn30_20": 0.179554, "fexErn60_30": 0.198399, "fexErn90_30": 0.211882, "fexErn90_60": 0.224557, "fexErn180_90": 0.231085, "ffwd30_20": 0.17336, "ffwd60_30": 0.208361, "ffwd90_30": 0.233676, "ffwd90_60": 0.267796, "ffwd180_90": 0.260775, "ffexErn30_20": 0.17336, "ffexErn60_30": 0.208361, "ffexErn90_30": 0.228623, "ffexErn90_60": 0.2563, "ffexErn180_90": 0.25421, "fbfwd30_20": 0.965506, "fbfwd60_30": 1.05021, "fbfwd90_30": 1.08745, "fbfwd90_60": 1.16336, "fbfwd180_90": 1.1071, "fbfexErn30_20": 0.965506, "fbfexErn60_30": 1.05021, "fbfexErn90_30": 1.07901, "fbfexErn90_60": 1.14136, "fbfexErn180_90": 1.10007, "impliedEarningsMove": 0.036148, "quoteDate": "2023-11-03T19:59:44Z", "updatedAt": "2023-11-03T19:59:57Z", "snapShotEstTime": "1600", "snapShotDate": "2023-11-03T20:00:00Z" } ] } ``` -------------------------------- ### GET /datav2/live/strikes/options Source: https://orats.com/docs/live-data-api Retrieves live options data for a list of specific option symbols. ```APIDOC ## GET /datav2/live/strikes/options ### Description Retrieves live options data for a provided list of OCC option symbols or underlying tickers. ### Method GET ### Endpoint `/datav2/live/strikes/options` ### Parameters #### Query Parameters - **token** (string) - Required - Your API authentication token. - **tickers** (string) - Required - A comma-delimited string of OCC option symbols or underlying tickers. OCC option symbols follow the format: `[Root Symbol (6 chars)] [YYMMDD] [Type (P/C)] [Strike Price (x1000, 8 digits)]`. Example: `AAPL 231117C00175000`. ### Request Example ```http GET https://api.orats.io/datav2/live/strikes/options?token=my-token&tickers=AAPL,MSFT ``` ### Response #### Success Response (200) - **data** (array) - An array of option data objects matching the specified symbols. - The structure of objects within the 'data' array is similar to the response of `/datav2/live/strikes`, providing details for each requested option. #### Response Example (Response structure is similar to `/datav2/live/strikes`, tailored for the specific options requested.) ```json { "data": [ { ... option data for AAPL ... }, { ... option data for MSFT ... } ] } ``` ``` -------------------------------- ### Live Intraday API Source: https://orats.com/docs/index Access live data for the Intraday API, calculated in real-time with less than 10 seconds of market delay. ```APIDOC ## GET /api/data/intraday/live ### Description Fetches live one-minute options data with minimal market delay. ### Method GET ### Endpoint /api/data/intraday/live ### Parameters #### Query Parameters - **symbol** (string) - Required - The stock symbol to get live intraday data for. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **symbol** (string) - The stock symbol. - **timestamp** (string) - The timestamp of the live intraday data. - **price** (float) - The current live price. - **volume** (integer) - The current trading volume for the minute. #### Response Example { "symbol": "GOOG", "timestamp": "2023-10-27T10:31:00Z", "price": 125.80, "volume": 8000 } ``` -------------------------------- ### Live Data API Source: https://orats.com/docs/index Access live options data, calculated in real-time with less than 10 seconds of market delay. ```APIDOC ## GET /api/data/live ### Description Fetches live options data with minimal market delay. ### Method GET ### Endpoint /api/data/live ### Parameters #### Query Parameters - **symbol** (string) - Required - The stock symbol to get live data for. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **symbol** (string) - The stock symbol. - **timestamp** (string) - The timestamp of the live data. - **price** (float) - The current live price. - **change** (float) - The change in price from the previous close. - **volume** (integer) - The current trading volume. #### Response Example { "symbol": "MSFT", "timestamp": "2023-10-27T10:30:00Z", "price": 330.50, "change": 1.25, "volume": 1500000 } ``` -------------------------------- ### Fetch Latest Strikes Chain Data (JavaScript) Source: https://orats.com/docs/delayed-intraday-api Example of fetching the latest one-minute strikes chain data using JavaScript. This code demonstrates how to make a GET request to the ORATS API endpoint with necessary parameters. ```javascript fetch("https://api.orats.io/datav2/one-minute/strikes/chain?token=my-token&ticker=AAPL") .then(response => response.text()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Fetch Historical Strikes Chain Data (JavaScript) Source: https://orats.com/docs/delayed-intraday-api Example of fetching historical one-minute strikes chain data using JavaScript. This code makes a GET request to the historical endpoint, requiring a token, ticker, and trade date. ```javascript const token = 'my-token'; const ticker = 'AAPL'; const tradeDate = '202206071100'; const url = `https://api.orats.io/datav2/hist/one-minute/strikes/chain?token=${token}&ticker=${ticker}&tradeDate=${tradeDate}`; fetch(url) .then(response => response.text()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Fetch Latest Strikes Chain Data (PHP) Source: https://orats.com/docs/delayed-intraday-api Example using PHP to fetch the latest one-minute strikes chain data from the ORATS API. This code utilizes cURL to make the HTTP GET request and outputs the received data. ```php ``` -------------------------------- ### Sample CSV Response Data Source: https://orats.com/docs/live-derived-intraday-api Example of the CSV formatted response data returned by the ORATS API for option strike information. This includes various metrics like volume, open interest, bid/ask prices, and implied volatility for both call and put options. ```csv ticker,tradeDate,expirDate,dte,strike,stockPrice,callVolume,callOpenInterest,callBidSize,callAskSize,putVolume,putOpenInterest,putBidSize,putAskSize,callBidPrice,callValue,callAskPrice,putBidPrice,putValue,putAskPrice,callBidIv,callMidIv,callAskIv,smvVol,putBidIv,putMidIv,putAskIv,residualRate,delta,gamma,theta,vega,rho,phi,driftlessTheta,callSmvVol,putSmvVol,extSmvVol,extCallValue,extPutValue,spotPrice,quoteDate,updatedAt,snapShotEstTime,snapShotDate,expiryTod,tickerId,monthId AAPL,2022-06-07,2022-06-10,4,95,147.76,null,2,null,null,null,336,null,null,null,52.76710955986100,null,null,0,null,0,2.084174177089490,2.084174177089490,0.648,0,1.6377716355668900,1.6377716355668900,-0.002010611708955640,0.9999999999999990,-8.8473889634821E-15,-0.002214926596611270,0.000019999998193297900,0.008353445283981190,-0.012988378941258800,-1.92955550532992E-09,0.5605747284419510,0.6517013469914320,0.5670216551072180,52.767109559860800,-1.32157095836055E-17,147.76,2022-06-07T14:59:53Z,2022-06-07T14:59:54Z,1100,2022-06-07T15:00:01Z,pm,101594,1 AAPL,2022-06-07,2022-06-10,4,100,147.76,null,16,null,null,null,3274,null,null,null,47.767483747222100,null,null,4.20377052399816E-14,null,0,1.864781840275740,1.864781840275740,0.648,0,1.4595764595205100,1.4595764595205100,-0.002010611708955640,0.9999999999999670,2.88945980653781E-14,-0.002331501680987540,0.000019999998193297900,0.008793100367150070,-0.012988379296530200,-2.0133658883167E-09,0.560574728441489,0.6517013469909700,0.5670216551072180,47.76748374722190,1.98338019042476E-15,147.76,2022-06-07T14:59:53Z,2022-06-07T14:59:54Z,1100,2022-06-07T15:00:01Z,pm,101594,1 AAPL,2022-08-08,2024-06-21,684,160,164.93,null,4685,null,null,null,3486,null,null,null,34.1585,null,null,21.283,null,0.296369,0.307393,0.318417,0.315,0.313132,0.315868,0.318604,-0.0047467,0.658228,0.00507431,-0.0250176,0.816399,1.38544,-2.02985,-0.0188118,0.313009,0.315965,0.316357,34.4318,21.3147,164.93,2022-08-08T20:14:38Z,2022-08-08T20:14:47Z,1615,2022-08-08T20:15:01Z,pm,101594,18 ``` -------------------------------- ### GET /datav2/one-minute/summaries Source: https://orats.com/docs/delayed-intraday-api Retrieves the latest one-minute summary data for stocks. This endpoint is useful for getting real-time snapshots. An optional ticker can be provided to filter results. ```APIDOC ## GET /datav2/one-minute/summaries ### Description Retrieves the latest one-minute summary data for stocks. This endpoint is useful for getting real-time snapshots. An optional ticker can be provided to filter results. ### Method GET ### Endpoint https://api.orats.io/datav2/one-minute/summaries ### Parameters #### Query Parameters - **token** (string) - Required - Your API authentication token. - **ticker** (string) - Optional - The stock ticker symbol to filter results. Ex: AAPL ### Request Example ```bash curl -L "https://api.orats.io/datav2/one-minute/summaries?token=my-token&ticker=AAPL" ``` ### Response (Response structure is similar to the historical data but contains latest summary information. Specific fields may vary.) #### Success Response (200) - (Fields will represent the latest one-minute summary data for the requested ticker or all tickers if none is specified.) #### Response Example (Example response structure will be provided upon further API specification. It will contain fields relevant to a one-minute summary.) ``` -------------------------------- ### ORATS API: Get Live Option Strikes (Sample Response) Source: https://orats.com/docs/live-intraday-api This snippet shows a sample CSV response for the live option strikes API endpoint. It details strike data, including bid/ask prices, volumes, and implied volatility for both call and put options. ```csv ticker,tradeDate,expirDate,dte,strike,stockPrice,callVolume,callOpenInterest,callBidSize,callAskSize,putVolume,putOpenInterest,putBidSize,putAskSize,callBidPrice,callValue,callAskPrice,putBidPrice,putValue,putAskPrice,callBidIv,callMidIv,callAskIv,smvVol,putBidIv,putMidIv,putAskIv,residualRate,delta,gamma,theta,vega,rho,phi,driftlessTheta,callSmvVol,putSmvVol,extSmvVol,extCallValue,extPutValue,spotPrice,quoteDate,updatedAt,snapShotEstTime,snapShotDate,expiryTod,tickerId,monthId AAPL,2022-08-08,2024-06-21,684,160,164.93,28,4685,537,26,5,3486,14,24,32.8,34.1585,34.6,21.05,21.283,21.5,0.296369,0.307393,0.318417,0.315,0.313132,0.315868,0.318604,-0.0047467,0.658228,0.00507431,-0.0250176,0.816399,1.38544,-2.02985,-0.0188118,0.313009,0.315965,0.316357,34.4318,21.3147,164.93,2022-08-08T20:14:38Z,2022-08-08T20:14:47Z,1615,2022-08-08T20:15:01Z,pm,101594,18 ``` -------------------------------- ### Get Strikes History Data with JavaScript Source: https://orats.com/docs/historical-data-api Retrieves end-of-day strikes data using JavaScript. This function makes a GET request to the ORATS API for strike history, allowing users to specify the ticker and trade date. ```JavaScript async function getStrikesHistory(token, ticker, tradeDate) { const url = `https://api.orats.io/datav2/hist/strikes?token=${token}&ticker=${ticker}&tradeDate=${tradeDate}`; const response = await fetch(url); return await response.json(); } ``` -------------------------------- ### GET /datav2/live/derived/strikes/options Source: https://orats.com/docs/live-derived-data-api Fetches live derived strike and option data. Requires a token and a comma-delimited list of tickers. ```APIDOC ## GET /datav2/live/derived/strikes/options ### Description This endpoint retrieves live derived strike and option data based on the provided tickers. The tickers can be OCC option symbols or underlying stock/ETF symbols. ### Method GET ### Endpoint https://api.orats.io/datav2/live/derived/strikes/options ### Parameters #### Query Parameters - **token** (string) - Required - Your API authentication token. - **tickers** (string) - Required - A comma-delimited string of OCC option symbols or underlying symbols. OCC option symbols have a specific format: 6-character root symbol, 6-digit expiration date (YYMMDD), option type (P or C), and 8-digit strike price (price x 1000, zero-padded). ### Request Example ``` curl -L "https://api.orats.io/datav2/live/derived/strikes/options?token=my-token&tickers=AAPL230915C00175000,SPXW230317C04000000,VIXW230222P00020000,MSFT,IBM,AMZN" ``` ### Response #### Success Response (200) - **data** (array) - An array of objects, where each object contains information about the requested ticker, including derived strike and option data. #### Response Example ```json { "data": [ { "ticker": "AAPL230915C00175000", "strike": "175.00", "expiration": "2023-09-15", "option_type": "C", "root_symbol": "AAPL ", "option_symbol": "AAPL230915C00175000", "bid": 1.23, "ask": 1.25, "last": 1.24, "volume": 1000, "open_interest": 5000 } // ... other ticker data ] } ``` ``` -------------------------------- ### Get Implied Monies History Data with PHP Source: https://orats.com/docs/historical-data-api Retrieves end-of-day monthly implied monies history data using PHP. This function sends a GET request to the ORATS API, requiring ticker symbols and a trade date. ```PHP ``` -------------------------------- ### Get Implied Monies History Data with JavaScript Source: https://orats.com/docs/historical-data-api Retrieves end-of-day monthly implied monies history data using JavaScript. This function makes a GET request to the ORATS API, accepting ticker symbols and a trade date. ```JavaScript async function getImpliedMoniesHistory(token, tickers, tradeDate) { const url = `https://api.orats.io/datav2/hist/monies/implied?token=${token}&ticker=${tickers}&tradeDate=${tradeDate}`; const response = await fetch(url); return await response.json(); } ``` -------------------------------- ### Live Data Retrieval Source: https://orats.com/docs/authentication This endpoint allows you to connect to live options data, which is calculated in real-time with minimal delay. Agreements must be signed to access live data. ```APIDOC ## GET /datav2/live/strikes ### Description Retrieves live options data, including strikes, for a specified ticker. Requires prior completion of agreements for live data access. ### Method GET ### Endpoint `https://api.orats.io/datav2/live/strikes` ### Parameters #### Query Parameters - **token** (string) - Required - Your unique API token for authentication. - **ticker** (string) - Required - The stock ticker symbol (e.g., AAPL). ### Request Example ```bash curl -L "https://api.orats.io/datav2/live/strikes?token=my-token&ticker=AAPL" ``` ### Response #### Success Response (200) - **live_data** (object) - Contains the real-time live options data. #### Response Example ```json { "live_data": { ... } } ``` ``` -------------------------------- ### Get Strikes History Data with Python Source: https://orats.com/docs/historical-data-api Retrieves end-of-day strikes data using Python. This code snippet demonstrates how to make a GET request to the ORATS API for strike history, accepting ticker and trade date as parameters. ```Python import requests def get_strikes_history(token, ticker, trade_date): url = f"https://api.orats.io/datav2/hist/strikes?token={token}&ticker={ticker}&tradeDate={trade_date}" response = requests.get(url) return response.json() ``` -------------------------------- ### Retrieve Historical IV Rank Data (Python) Source: https://orats.com/docs/historical-data-api This Python snippet shows how to make a request to the ORATS Data API to get historical implied volatility rank data. It uses the 'requests' library to handle the HTTP GET request. ```python import requests def get_iv_rank(token, ticker, trade_date): url = f"https://api.orats.io/datav2/hist/ivrank" params = { 'token': token, 'ticker': ticker, 'tradeDate': trade_date } try: response = requests.get(url, params=params) response.raise_for_status() # Raise an exception for bad status codes return response.json() except requests.exceptions.RequestException as e: print(f"Error fetching IV Rank data: {e}") return None # Example usage: # token = 'my-token' # ticker = 'AAPL' # trade_date = '2021-01-20' # data = get_iv_rank(token, ticker, trade_date) # print(data) ``` -------------------------------- ### Retrieve Live One-Minute Summaries (JavaScript) Source: https://orats.com/docs/live-intraday-api Fetches the latest one-minute summaries data using JavaScript's fetch API. Requires an API token and optionally a ticker symbol. The response contains live summary data. ```javascript fetch("https://api.orats.io/datav2/live/one-minute/summaries?token=my-token&ticker=AAPL") .then(response => response.json()) .then(data => console.log(data)); ``` -------------------------------- ### Orats API Summaries History Request (PHP) Source: https://orats.com/docs/live-intraday-api PHP code to fetch historical one-minute summaries from the Orats API using cURL. This example constructs the API request URL with query parameters for the token, ticker, and a specified trade date range. It includes basic error checking for the cURL request. ```php $token, 'ticker' => $ticker, 'tradeDate' => $tradeDate ]; $queryString = http_build_query($queryParams); $fullUrl = $url . '?' . $queryString; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $fullUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'cURL Error:' . curl_error($ch); } else { echo $response; } curl_close($ch); return $response; } // Example usage: // $myToken = 'your-api-token'; // $stockTicker = 'AAPL'; // $dateRange = '202203211200,202204201300'; // Max 40 trading days // getSummariesHistory($myToken, $stockTicker, $dateRange); ?> ``` -------------------------------- ### Get Core Data History (JavaScript) Source: https://orats.com/docs/historical-data-api This JavaScript code snippet shows how to fetch historical core data using the ORATS API. It makes a GET request to the `/datav2/hist/cores` endpoint, passing the API token, ticker, and trade date as query parameters. The response data is then logged to the console. ```javascript async function getCoreHistory(token, ticker, tradeDate) { const url = `https://api.orats.io/datav2/hist/cores?token=${token}&ticker=${ticker}&tradeDate=${tradeDate}`; try { const response = await fetch(url); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); console.log(data); return data; } catch (error) { console.error('Error fetching core history:', error); } } // Example usage: // getCoreHistory('my-token', 'AAPL', '2019-11-29'); ``` -------------------------------- ### Retrieve Live SMV Summary Data (Python) Source: https://orats.com/docs/live-data-api Fetches live SMV summary data using Python. An API token is required, and the ticker symbol is an optional parameter. ```python import requests def get_summaries(token, ticker=None): url = f"https://api.orats.io/datav2/live/summaries?token={token}" if ticker: url += f"&ticker={ticker}" response = requests.get(url) response.raise_for_status() # Raise an exception for bad status codes return response.json() ``` -------------------------------- ### Get Core Data History (Python) Source: https://orats.com/docs/historical-data-api This Python code uses the `requests` library to retrieve historical core data from the ORATS API. It constructs the API endpoint URL with the provided token, ticker, and trade date. The script then sends a GET request and prints the JSON response, handling potential errors. ```python import requests def get_core_history(token, ticker, trade_date): url = "https://api.orats.io/datav2/hist/cores" params = { "token": token, "ticker": ticker, "tradeDate": trade_date } try: response = requests.get(url, params=params) response.raise_for_status() # Raise an exception for bad status codes data = response.json() print(data) return data except requests.exceptions.RequestException as e: print(f"Error fetching core history: {e}") return None # Example usage: # get_core_history("my-token", "AAPL", "2019-11-29") ``` -------------------------------- ### GET /websites/orats/stock-split-history Source: https://orats.com/docs/definitions Retrieves stock split history for a given ticker. This includes the date of the split and the divisor. ```APIDOC ## GET /websites/orats/stock-split-history ### Description Retrieves stock split history for a given ticker. This includes the date of the split and the divisor. ### Method GET ### Endpoint `/websites/orats/stock-split-history` ### Parameters #### Query Parameters - **ticker** (string) - Required - The underlying symbol for which to retrieve stock split history. #### Response ##### Success Response (200) - **ticker** (string) - Underlying symbol. - **splitDate** (date) - Stock split date. - **divisor** (float) - Ratio of stock split. #### Response Example { "example": "[\n {\n \"ticker\": \"NVDA\",\n \"splitDate\": \"2021-07-20\",\n \"divisor\": 4.0\n }\n]" } ``` -------------------------------- ### Retrieve Live SMV Summary Data (PHP) Source: https://orats.com/docs/live-data-api Fetches live SMV summary data using PHP. An API token is required, and the ticker symbol is an optional parameter. ```php ``` -------------------------------- ### Sample CSV Data for Option Strikes Source: https://orats.com/docs/live-intraday-api This snippet displays a sample of the CSV data returned by the ORATS API for option strikes. It includes various details such as ticker, trade date, expiration date, strike price, and volume. This data is crucial for analyzing option market activity. ```csv ticker,tradeDate,expirDate,dte,strike,stockPrice,callVolume,callOpenInterest,callBidSize,callAskSize,putVolume,putOpenInterest,putBidSize,putAskSize,callBidPrice,callValue,callAskPrice,putBidPrice,putValue,putAskPrice,callBidIv,callMidIv,callAskIv,smvVol,putBidIv,putMidIv,putAskIv,residualRate,delta,gamma,theta,vega,rho,phi,driftlessTheta,callSmvVol,putSmvVol,extSmvVol,extCallValue,extPutValue,spotPrice,quoteDate,updatedAt,snapShotEstTime,snapShotDate,expiryTod,tickerId,monthId AAPL,2022-06-07,2022-06-10,4,95,147.76,0,2,1,1,0,336,0,586,52.7,52.76710955986101,52.85,0,0,0.01,0,2.084174177089487,2.084174177089487,0.648,0,1.6377716355668939,1.6377716355668939,-0.002010611708955635,0.9999999999999994,-8.847388963482095e-15,-0.002214926596611274,0.000019999998193297865,0.008353445283981194,-0.012988378941258816,-1.929555505329921e-9,0.5605747284419511,0.6517013469914322,0.5670216551072182,52.767109559860835,-1.3215709583605508e-17,147.76,2022-06-07T14:59:53Z,2022-06-07T14:59:54Z,1100,2022-06-07T15:00:01Z,pm,101594,1 AAPL,2022-06-07,2022-06-10,4,100,147.76,0,16,1,1,0,3274,0,590,47.7,47.767483747222116,47.85,0,4.203770523998158e-14,0.01,0,1.864781840275735,1.864781840275735,0.648,0,1.4595764595205079,1.4595764595205079,-0.002010611708955635,0.9999999999999672,2.8894598065378106e-14,-0.002331501680987543,0.000019999998193297865,0.008793100367150072,-0.012988379296530184,-2.013365888316701e-9,0.560574728441489,0.6517013469909696,0.5670216551072182,47.76748374722192,1.9833801904247632e-15,147.76,2022-06-07T14:59:53Z,2022-06-07T14:59:54Z,1100,2022-06-07T15:00:01Z,pm,101594,1 ``` -------------------------------- ### GET /datav2/hist/earnings Source: https://orats.com/docs/historical-data-api Retrieves historical earnings data for a specified ticker symbol. ```APIDOC ## GET /datav2/hist/earnings ### Description Retrieves historical earnings data for a specified ticker symbol. ### Method GET ### Endpoint https://api.orats.io/datav2/hist/earnings ### Parameters #### Query Parameters - **token** (string) - Required - Your API token. - **ticker** (string) - Required - The ticker symbol to retrieve data for (e.g., AAPL). ### Request Example ``` curl -L "https://api.orats.io/datav2/hist/earnings?token=my-token&ticker=AAPL" ``` ### Response #### Success Response (200) - **data** (array) - An array of earnings data objects. - **ticker** (string) - The ticker symbol. - **earnDate** (string) - The earnings date. - **anncTod** (string) - Announcement time (e.g., '1630' for 4:30 PM). - **updatedAt** (string) - Timestamp of the last update. #### Response Example ```json { "data": [ { "ticker": "AAPL", "earnDate": "1987-09-25", "anncTod": "1630", "updatedAt": "2018-01-12T17:31:59Z" }, { "ticker": "AAPL", "earnDate": "1988-09-30", "anncTod": "1630", "updatedAt": "2018-01-12T17:31:59Z" }, { "ticker": "AAPL", "earnDate": "1989-09-29", "anncTod": "1630", "updatedAt": "2018-01-12T17:31:59Z" }, ... ] } ``` ```