{"uid":"cap_-fnTJz4mZj_WiLzlNeiye","slug":"agents-x402stock-xyz-x402stock-stock-price-history-ohlcv-aggregates-6c81338d","name":"x402stock Stock Price History (OHLCV Aggregates)","description":"The stock price history endpoint. Returns historical OHLCV bars at the requested multiplier and timespan (minute, hour, day, week, month) between `from` and `to`. Use for price history, charting, backtesting, and trend analysis over any date range. From x402stock, a pay-per-call market & economic data API for AI agents. No API key or account; pay in USDC via x402.","url":"https://agents.x402stock.xyz/api/v1/aggregates/{ticker}","method":"GET","headers":{},"bodySchema":{"type":"object","required":["ticker"],"properties":{"to":{"type":"string","default":"2026-07-31","minLength":1},"from":{"type":"string","default":"2025-07-31","minLength":1},"sort":{"enum":["asc","desc"],"type":"string","default":"asc"},"limit":{"type":"integer","default":5000,"maximum":50000,"exclusiveMinimum":0},"ticker":{"type":"string","description":"US-listed ticker symbol (uppercase), e.g. AAPL."},"adjusted":{"type":"boolean","default":true},"timespan":{"enum":["minute","hour","day","week","month","quarter","year"],"type":"string","default":"day"},"multiplier":{"type":"integer","default":1,"maximum":50000,"exclusiveMinimum":0}}},"responseSchema":{"type":"object","required":["ticker","data","source","as_of"],"properties":{"data":{"type":"object","required":["bars","count"],"properties":{"bars":{"type":"array","items":{"type":"object","required":["open","high","low","close","volume","vwap","trade_count","timestamp"],"properties":{"low":{"type":"number"},"high":{"type":"number"},"open":{"type":"number"},"vwap":{"anyOf":[{"type":"number"},{"type":"null"}]},"close":{"type":"number"},"volume":{"type":"number"},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}]},"trade_count":{"anyOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},"count":{"type":"number"},"adjusted":{"type":"boolean"}},"additionalProperties":false},"as_of":{"type":"string"},"source":{"type":"string","const":"x402stock"},"ticker":{"type":"string"},"feedback":{"type":"object","required":["endpoint","method","free","note"],"properties":{"free":{"type":"boolean"},"note":{"type":"string"},"method":{"type":"string","const":"POST"},"endpoint":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.02","displayCostAsset":"USD","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"1.00","reviews":0,"stars":null,"state":"rated"},"availabilityStatus":"healthy","priceObserved":{"p10Cents":"2.0000","medianCents":"2.0000","p90Cents":"2.0000","minCents":"2.0000","maxCents":"2.0000","p95Cents":"2.0000","sampleCount":1,"varies":false,"failureChargeRate":null},"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lnJPMCrVOKteVYNL6ZHl0","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":null,"planRef":null}],"brandName":"agents.x402stock.xyz","brandSlug":"agents-x402stock-xyz-mpp","brandBaseUrl":"https://agents.x402stock.xyz","brandDocsUrl":null,"whatItDoes":"Returns historical OHLCV (open, high, low, close, volume) bars for a US-listed stock or ETF at a specified timespan and multiplier between two dates.","exampleAgentPrompt":"Can you pull the daily adjusted OHLCV price history for NVDA from January 1, 2024 to June 30, 2024, sorted ascending?","exampleUseCases":[{"title":"Backtest stock trading strategy","prompt":"Get me the daily OHLCV bars for SPY from January 1, 2023 through December 31, 2023, adjusted for splits, sorted ascending — I want to run a moving average crossover backtest."},{"title":"Chart recent intraday price action","prompt":"Fetch hourly price bars for TSLA for the past 30 days, from June 1, 2025 to June 30, 2025, so I can plot an intraday candlestick chart."},{"title":"Long-term trend analysis","prompt":"Pull monthly adjusted OHLCV data for AAPL going back 5 years, from July 2020 to July 2025, so I can analyze its long-term price trend."}],"resultDescription":"An array of OHLCV bar objects, each containing open, high, low, close, volume, VWAP, trade count, and timestamp, along with the total bar count, whether prices are adjusted, the ticker symbol, data source, and an as-of timestamp.","failureModes":["Invalid or unlisted ticker returns empty bars or error","Date range outside available data returns empty result","Exceeding limit of 50,000 bars may truncate results","Payment failure via x402/USDC blocks the request","Invalid timespan or multiplier value returns a 400 error","Future dates may return empty or partial data"],"whenToPreferThis":"Choose this endpoint when you need historical price bars (OHLCV) for a US-listed stock or ETF across any timeframe from minute to yearly granularity, especially for charting, trend analysis, or backtesting. Prefer it over real-time quote endpoints when historical depth matters. It requires no API key — only a USDC micropayment via x402, making it ideal for autonomous AI agents.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":1,"lastUsedAt":"2026-08-28T15:59:24.468Z","lastSuccessfullyRanAt":"2026-08-28T15:59:24.468Z","lastHealthCheckAt":"2026-09-18T12:30:03.110Z","isFirstParty":false}