{"uid":"cap_UlABSUE0IEL7pKG7GPwAB","slug":"market-data-ohlc-candlestick-aggregates-37fc3af2","name":"Market Data OHLC Candlestick Aggregates","description":"Market data OHLC candlestick bars for stocks, crypto, forex and options — historical aggregates over any window by ticker.","url":"https://marketdata.use.x402atlas.com/aggregates?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"],"type":"string"},"queryParams":{"type":"object","required":["ticker","multiplier","timespan","from","to"],"properties":{"to":{"type":"string","description":"Window end: YYYY-MM-DD or millisecond epoch"},"from":{"type":"string","description":"Window start: YYYY-MM-DD or millisecond epoch. Historical depth is limited (~2 years); prefer recent windows"},"sort":{"enum":["asc","desc"],"type":"string","description":"Result ordering"},"limit":{"type":"integer","maximum":50000,"minimum":1,"description":"Max base aggregates returned"},"ticker":{"type":"string","description":"Asset-prefixed ticker, e.g. AAPL, X:BTCUSD, C:EURUSD"},"adjusted":{"type":"boolean","default":true,"description":"Adjust for splits"},"timespan":{"enum":["minute","hour","day","week","month","quarter","year"],"type":"string","description":"Aggregate window unit"},"multiplier":{"type":"integer","maximum":50000,"minimum":1,"description":"Size of the timespan multiplier (e.g. 5 for 5-minute bars)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["queried_at","ticker","multiplier","timespan","from","to","adjusted","candles"],"properties":{"to":{"type":"string","description":"Echo of the requested window end."},"from":{"type":"string","description":"Echo of the requested window start."},"ticker":{"type":"string","description":"Echo of the requested ticker."},"candles":{"type":"array","items":{"type":"object","required":["time","open","high","low","close","volume","vwap","transactions"],"properties":{"low":{"type":"number"},"high":{"type":"number"},"open":{"type":"number"},"time":{"type":"string","format":"date-time","description":"Bar start timestamp."},"vwap":{"type":"number","description":"Volume-weighted average price."},"close":{"type":"number"},"volume":{"type":"number"},"transactions":{"type":"integer","description":"Number of upstream transactions in the bar."}}},"description":"Normalized OHLCV bars for the requested window."},"adjusted":{"type":"boolean","description":"Whether prices are split-adjusted."},"timespan":{"type":"string","description":"Echo of the requested timespan unit."},"multiplier":{"type":"integer","description":"Echo of the requested timespan multiplier."},"queried_at":{"type":"string","format":"date-time","description":"UTC timestamp when this bridge queried the upstream."}}}}}}},"responseSchema":{"type":"json","example":{"to":"2024-01-31","from":"2024-01-01","ticker":"X:BTCUSD","candles":[{"low":41500,"high":43000,"open":42000,"time":"2024-01-01T00:00:00Z","vwap":42500,"close":42800,"volume":12000,"transactions":98000}],"adjusted":true,"timespan":"day","multiplier":1,"queried_at":"2026-07-06T12:00:00Z"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.015","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":{"p10Cents":"1.5000","medianCents":"1.5000","p90Cents":"1.5000","minCents":"1.5000","maxCents":"1.5000","p95Cents":"1.5000","sampleCount":1,"varies":false,"failureChargeRate":1},"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.015/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.015","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.015","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_8zsbGAL8_cJtOHDjo_YkS","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.015","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns historical OHLC candlestick bars (aggregates) for stocks, crypto, forex, and options over a configurable time window and bar size.","exampleAgentPrompt":"Can you pull the daily OHLC candlestick bars for AAPL from 2024-01-01 to 2024-06-30, adjusted for splits, sorted ascending?","exampleUseCases":[{"title":"Backtest momentum strategy on Bitcoin","prompt":"Can you fetch 1-hour candlestick bars for Bitcoin from 2023-01-01 to 2023-12-31 so I can backtest a momentum trading strategy using the open, high, low, and close prices?"},{"title":"Chart intraday price swings for Tesla","prompt":"Pull 15-minute OHLC bars for Tesla over the past 30 trading days so I can chart intraday price swings and identify support and resistance levels?"},{"title":"Analyze weekly EUR/USD forex trends","prompt":"Can you grab weekly candlestick bars for EUR/USD going back 12 months, including volume and VWAP, so I can analyze longer-term forex trends?"}],"resultDescription":"Returns a list of OHLC candlestick bar objects for the requested ticker and time window, each containing open, high, low, close prices, volume, VWAP, and timestamp. Bars are sized by the multiplier × timespan combination (e.g. 5-minute, 1-day, 1-week).","failureModes":["Missing required parameters (ticker, multiplier, timespan, from, to) returns a 400 error","Invalid ticker format (e.g. missing asset prefix for crypto like X:BTCUSD) returns no results or error","Date range with no trading activity returns empty results array","Limit exceeds 50000 returns a validation error","Invalid timespan value returns a 400 error","Payment not processed (x402 payment required) returns 402 status"],"whenToPreferThis":"Use this endpoint when you need historical candlestick OHLC bar data for any supported asset class (stocks, crypto, forex, options) at any granularity from minute to year. Prefer this over the previous-day endpoint when you need multi-period historical data or custom bar sizes for backtesting, charting, or technical analysis.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":1,"lastUsedAt":"2026-10-09T00:40:57.508Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T19:35:00.079Z","isFirstParty":false,"canonicalSlug":"market-data-ohlc-candlestick-aggregates-37fc3af2"}