{"uid":"cap_4JI8XCFnubneiXoToVdkw","slug":"massive-x402-api-stock-aggregate-bars-6caab36d","name":"Massive x402 API – Stock Aggregate Bars","description":"US stock market data, sold per request over x402. Every path here answers 402 with the payment terms in the PAYMENT-REQUIRED header, and answers with the data once the payment settles. No account, no API key, no subscription.","url":"https://agent.massive.com/v2/aggs/ticker/%7BstocksTicker%7D/range/%7Bmultiplier%7D/%7Btimespan%7D/%7Bfrom%7D/%7Bto%7D","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":{"type":"json","example":{"status":"OK","ticker":"AAPL","results":[{"c":75.0875,"h":75.15,"l":73.7975,"n":1,"o":74.06,"t":1577941200000,"v":135647456,"vw":74.6099},{"c":74.3575,"h":75.145,"l":74.125,"n":1,"o":74.2875,"t":1578027600000,"v":146535512,"vw":74.7026}],"adjusted":true,"next_url":"https://api.massive.com/v2/aggs/ticker/AAPL/range/1/day/1578114000000/2020-01-10?cursor=bGltaXQ9MiZzb3J0PWFzYw","queryCount":2,"request_id":"6a7e466379af0a71039d60cc78e72282","resultsCount":2}},"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_cafDCosVvzL9byodagLcN","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 US stock ticker over a specified time range and timespan granularity, billed per request via x402 micropayment.","exampleAgentPrompt":"Pull daily adjusted OHLCV bars for AAPL from 2024-01-01 to 2024-06-30, sorted ascending — I need every required/open/high/low/close/volume candle for that half-year period.","exampleUseCases":[{"title":"Backtesting a momentum strategy","prompt":"Get me daily OHLCV bars for NVDA from 2023-01-01 to 2023-12-31, sorted ascending, adjusted for splits — I'm building a momentum backtest and need the full year of candles."},{"title":"Intraday price chart for a trading dashboard","prompt":"Fetch 5-minute aggregate bars for SPY on 2024-11-15 — give me the open, high, low, close, and volume for every 5-minute window that day, sorted ascending."},{"title":"Quarterly earnings price-move analysis","prompt":"Pull weekly adjusted bars for TSLA from 2024-07-01 to 2024-09-30 so I can see how the stock moved quarter over quarter leading into earnings."}],"resultDescription":"A JSON object containing the ticker symbol, an array of aggregate bar objects (each with open, high, low, close, volume, volume-weighted average price, number of transactions, and a millisecond timestamp), adjusted flag, result count, query count, request ID, and an optional next_url for cursor-based pagination.","failureModes":["402 Payment Required returned when x402 payment has not yet settled — normal flow, agent must complete payment before data is returned","Invalid ticker symbol returns an empty results array or error status","Date range produces no results if market was closed or range is invalid","Malformed date format (not YYYY-MM-DD or millisecond timestamp) causes a 400 error","Limit exceeding 50000 is rejected","Network timeout if payment settlement is slow"],"whenToPreferThis":"Choose this endpoint when you need historical or recent US stock OHLCV aggregate bars at any granularity (minute through year) without setting up an account or subscription — payment is per-request via x402 USDC micropayment. Prefer this over subscription-based data APIs when running ad-hoc or low-frequency queries where paying per call is more economical than a monthly plan.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T04:07:04.459Z","isFirstParty":false}