================================================================================ MARKETDATA.APP API ISSUE - HISTORICAL OPTIONS DATA ================================================================================ Date: 2026-06-07 Issue: Historical options data endpoint returns current quote instead of historical data ================================================================================ API ENDPOINT BEING USED ================================================================================ Endpoint: https://api.marketdata.app/v1/options/quotes/{OCC_SYMBOL} Method: GET Parameters: - from: YYYY-MM-DD (start date) - to: YYYY-MM-DD (end date) - columns: bid,mid,ask,last - token: [API_TOKEN] Example Query: https://api.marketdata.app/v1/options/quotes/AMZN260918P00175000?from=2026-05-17&to=2026-06-07&columns=bid,mid,ask,last&token=[API_TOKEN] ================================================================================ EXPECTED BEHAVIOR (per API documentation) ================================================================================ According to the API documentation at: https://api.marketdata.app/#/v1/v1_options_quotes_retrieve The endpoint should return historical end-of-day quotes when using: - from parameter: oldest date to return (inclusive) - to parameter: newest date to return (exclusive) Expected response format should include timestamp arrays: { "t": [timestamp1, timestamp2, ...], "bid": [bid1, bid2, ...], "ask": [ask1, ask2, ...], "mid": [mid1, mid2, ...], "last": [last1, last2, ...] } ================================================================================ ACTUAL BEHAVIOR ================================================================================ The API returns a single current quote instead of historical data: Actual response: { "bid": 1.23, "mid": 1.25, "ask": 1.27, "last": 1.25 } Response does NOT contain: - Timestamp array ('t') - Historical data arrays - Multiple data points ================================================================================ TECHNICAL DETAILS ================================================================================ Request made from PHP backend (server-side): - File: /var/www/html/lexpatia_14/PHP/historicalDataManager.php - Function: fetchOptionHistoricalFromAPI() - Timestamp: 2026-06-07 15:16:14 Server log entry (Apache error log): [Sun Jun 07 15:16:14.133828 2026] [php:notice] [pid 7495:tid 7495] [client 127.0.0.1:34724] Fetching option historical data from API: https://api.marketdata.app/v1/options/quotes/AMZN260918P00175000?from=2026-05-17&to=2026-06-07&columns=bid%2Cmid%2Cask%2Clast&token=[TOKEN] Response received: 300 bytes Response keys: bid, mid, ask, last (no 't' key for timestamps) ================================================================================ WHY THIS REQUEST DOESN'T APPEAR IN BROWSER CONSOLE ================================================================================ Important distinction: 1. JAVASCRIPT XHR REQUESTS (appear in browser console): - Made from browser to external APIs - Example: optionMngr.js fetching current option quotes - Visible in browser Network tab - These are the requests you see in your console logs 2. PHP HTTP REQUESTS (do NOT appear in browser console): - Made from server (PHP) to external APIs - Example: historicalDataManager.php fetching historical data - Visible only in server error logs (/var/log/apache2/error.log) - These do NOT appear in browser Network tab The historical data request is made server-side by PHP, so it appears in Apache error logs, not browser console logs. This is normal behavior. ================================================================================ TESTED OPTION SYMBOLS ================================================================================ - AMZN260918P00175000 (AMZN Put, $175 strike, expires 2026-09-18) - MSFT20260618P000150000 (MSFT Put, $150 strike, expires 2026-06-18) Both returned current quotes instead of historical data. ================================================================================ QUESTIONS FOR SUPPORT ================================================================================ 1. Does the /v1/options/quotes/{optionSymbol} endpoint support historical data? 2. If yes, what is the correct format for the from/to parameters? 3. Is there a different endpoint for historical options data? 4. Are there additional parameters required to get historical data? 5. Is historical data available for all options or only certain ones? ================================================================================ API TOKEN ================================================================================ Token being used: xxxx ================================================================================ CONTACT INFORMATION ================================================================================ Application: lexPatia (option trading management system) Developer: Hugh A. Tucker Email: hugh@infomenta.com Date: 2026-06-07 ================================================================================