{"uid":"cap_MCt4FW1jzSuZod0GpnE1r","slug":"custom-stock-bars-e29be846","name":"Custom Stock Bars","description":"Get aggregate bars for a stock over a given date range in custom time window sizes. For example, if timespan = ‘minute’ and multiplier = ‘5’ then 5-minute bars will be returned. Can't find what you're looking for? POST feedback to /feedback, no charge.","url":"https://agent.massive.com/v2/aggs/ticker/:stocksTicker/range/:multiplier/:timespan/:from/:to","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"},"pathParams":{"type":"object","required":["from","multiplier","stocksTicker","timespan","to"],"properties":{"to":{"type":"string","description":"The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp."},"from":{"type":"string","description":"The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp."},"timespan":{"enum":["minute","hour","day","week","month","quarter","year"],"type":"string","description":"The size of the time window."},"multiplier":{"type":"string","pattern":"^[0-9]+$","description":"The size of the timespan multiplier."},"stocksTicker":{"type":"string","description":"Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc."}}},"queryParams":{"type":"object","properties":{"sort":{"enum":["asc","desc"],"type":"string","description":"Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top)."},"limit":{"type":"integer","description":"Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements ."},"adjusted":{"type":"boolean","description":"Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_s685NkrtjCFI1wHyLIcB5","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns OHLCV aggregate bars for a stock ticker over a specified date range with configurable timespan multipliers (e.g. 5-minute, 2-hour, 3-day bars).","exampleAgentPrompt":"Can you pull 5-minute OHLCV bars for AAPL from 2024-01-01 to 2024-01-31, sorted oldest to newest?","exampleUseCases":[{"title":"Backtesting intraday trading strategy","prompt":"Fetch 15-minute bars for TSLA from 2023-06-01 to 2023-09-30, sorted ascending, so I can run my momentum strategy backtest on them."},{"title":"Building a daily candlestick chart","prompt":"Get split-adjusted daily OHLC bars for NVDA from 2023-01-01 to 2024-01-01, sorted ascending — I want to plot a full-year candlestick chart."},{"title":"Monitoring weekly price trends for a portfolio","prompt":"Pull weekly aggregate bars for SPY from 2024-01-01 to 2024-06-30, sorted descending, and limit to the last 26 bars so I can review the recent trend."}],"resultDescription":"Returns a list of aggregate bar objects for the requested ticker and time range, each containing open, high, low, close, volume, VWAP, and timestamp fields at the specified bar resolution. Results can be split-adjusted or raw, sorted ascending or descending, and paginated by a limit parameter.","failureModes":["Invalid ticker symbol returns empty results or error","Date range with no trading data (e.g. holidays, weekends with daily bars) may return empty results","Multiplier must be a positive integer string; invalid format returns a validation error","Timespan enum must be one of: minute, hour, day, week, month, quarter, year — otherwise 400 error","Limit exceeds 50000 — request will fail or be capped","From date after To date returns an error or empty results","Network or payment failure (x402 protocol issue) returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need flexible OHLCV bar data at any custom resolution (e.g. 5-minute, 2-hour, 3-day) for a single stock ticker over a specific date range. Prefer this over the Daily Ticker Summary endpoint when you need intraday or multi-period aggregates rather than a single day's open/close, and over technical indicator endpoints (SMA, EMA) when you need raw price data rather than derived signals.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T06:30:35.712Z","isFirstParty":false}