{"uid":"cap_NJWFiqUrk1cHNzBgLF-iy","slug":"blockrun-us-stock-ohlc-history-spy-9d533b84","name":"Blockrun US Stock OHLC History — SPY","description":"US Stock OHLC bars for SPY @ D","url":"https://blockrun-web-vbsbhh7lea-uc.a.run.app/api/v1/stocks/us/history/SPY","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"input":{"type":"object","properties":{"path":{"type":"object","required":["symbol"],"properties":{"symbol":{"type":"string","example":"AAPL","description":"NYSE/Nasdaq/AMEX ticker (AAPL, TSLA, NVDA, CRCL, SPY, …)."}}},"query":{"type":"object","required":["from","to"],"properties":{"to":{"type":"integer","description":"Window end (Unix seconds)."},"from":{"type":"integer","description":"Window start (Unix seconds)."},"session":{"enum":["pre","post","on"],"type":"string","description":"Optional US market session."},"resolution":{"enum":["1","5","15","60","240","D","W","M"],"type":"string","default":"D","description":"Bar resolution (TradingView convention): 1/5/15/60/240 min, D day, W week, M month."}}}}},"output":{"type":"object","required":["symbol","resolution","bars","source"],"properties":{"to":{"type":"integer"},"bars":{"type":"array","items":{"type":"object","required":["t","o","h","l","c","v"],"properties":{"c":{"type":"number","description":"Close"},"h":{"type":"number","description":"High"},"l":{"type":"number","description":"Low"},"o":{"type":"number","description":"Open"},"t":{"type":"integer","description":"Bar start (Unix seconds)"},"v":{"type":"number","description":"Volume"}}}},"from":{"type":"integer"},"source":{"type":"string","const":"pyth"},"symbol":{"type":"string","example":"AAPL"},"resolution":{"type":"string","example":"D"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_hZ9ylO73lxNv19_nmpnYT","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns historical OHLC (open/high/low/close/volume) bar data for the SPY ETF at configurable resolutions from Pyth network","exampleAgentPrompt":"Pull daily OHLC bars for SPY from January 1, 2024 (Unix timestamp 1704067200) to March 31, 2024 (Unix timestamp 1711843200) using day resolution — I want to do a backtest on S&P 500 performance over that quarter.","exampleUseCases":[{"title":"Chart SPY performance over past year","prompt":"Can you grab the daily OHLC bars for SPY going back one year? I want to plot them on a chart to see how the S&P 500 has been trending."},{"title":"Backtest momentum strategy on SPY","prompt":"Pull weekly OHLC data for SPY from the start of 2023 through now — I'm testing a momentum strategy and need the high-low ranges for each week to calculate volatility."},{"title":"Analyze SPY intraday trading patterns","prompt":"Get me hourly OHLC bars for SPY over the last 20 trading days so I can identify recurring intraday price patterns and support/resistance levels."}],"resultDescription":"An array of OHLC bar objects each containing Unix timestamp (t), open (o), high (h), low (l), close (c), and volume (v) fields, along with metadata including symbol, resolution, source ('pyth'), and the window start/end timestamps.","failureModes":["Missing required 'from' or 'to' query parameters returns 400 error","Invalid symbol returns empty bars array or 404","Unix timestamp range too large may return partial data","Future timestamps return empty bars array","Payment not made results in 402 Payment Required","Invalid resolution enum value returns 400"],"whenToPreferThis":"Use this endpoint when you need historical OHLC candlestick bars for the SPY ETF specifically (S&P 500 tracker) sourced from Pyth network, especially for backtesting, charting, or time-series analysis across daily, weekly, monthly, or intraday resolutions. Prefer this over realtime price endpoints when you need a range of historical bars rather than a single current price.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:51:37.679Z","isFirstParty":false}