{"uid":"cap_UMesmoLRo-Xfz5i90y7TH","slug":"x402stock-historical-ohlcv-aggregates-ad2e5b49","name":"x402stock Historical 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?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"pathParams":{"type":"object","ticker":{"type":"string"}},"queryParams":{"type":"object","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},"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}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":1,"rating":{"score":"1.00","successRate":"1.00","reviews":1,"stars":"5.0","state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_RsqCOlyHfiRBE9Ah0N53n","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns historical OHLCV (open, high, low, close, volume) bar data for a US stock ticker at a specified timespan and multiplier between two dates","exampleAgentPrompt":"Pull daily adjusted OHLCV bars for AAPL from 2024-01-01 to 2024-12-31, sorted ascending — I want to chart the full-year price history.","exampleUseCases":[{"title":"Backtesting a trading strategy","prompt":"Get me hourly OHLCV bars for NVDA from 2024-01-01 to 2024-06-30, sorted ascending, so I can backtest a momentum strategy over the first half of last year."},{"title":"Charting long-term trend","prompt":"Fetch weekly adjusted price bars for SPY from 2020-01-01 to 2025-01-01 — I want to visualize the 5-year bull market trend."},{"title":"Intraday price analysis","prompt":"Pull 5-minute bars for TSLA for just today, 2025-07-25, sorted ascending — I need to analyze intraday price movement this morning."}],"resultDescription":"An array of OHLCV aggregate bar objects, each containing open, high, low, close, volume, and timestamp for the requested ticker and time interval. Bars are returned in the specified sort order (asc or desc) and reflect split/dividend-adjusted prices when adjusted=true.","failureModes":["Invalid ticker symbol returns empty results or 404","Date range outside available data returns empty bar array","Multiplier or limit exceeding maximum (50000) returns validation error","Invalid timespan enum value returns 400 bad request","Payment failure via x402 protocol returns 402 Payment Required","Future date range returns empty results"],"whenToPreferThis":"Use this endpoint when you need multi-period historical OHLCV data for charting, backtesting, or trend analysis over any custom date range. Prefer this over the single-day snapshot endpoint when you need more than one bar or need data spanning days, weeks, months, or years. Ideal for technical analysis workflows, strategy backtesting engines, and visualization pipelines that require flexible granularity (minute through year).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":3,"lastUsedAt":"2026-08-28T14:29:19.627Z","lastSuccessfullyRanAt":"2026-08-28T14:29:19.627Z","lastHealthCheckAt":"2026-10-02T01:45:37.767Z","isFirstParty":false,"canonicalSlug":"x402stock-historical-ohlcv-aggregates-ad2e5b49"}