{"uid":"cap_O22WzvnG5CkvvAp4akkgx","slug":"x402stock-aggregate-bars-ohlcv-endpoint-8dbb5775","name":"x402stock Aggregate Bars (OHLCV) Endpoint","description":"Pay-per-call market and economic data API for AI agents: US stocks, ETFs and options, forex, crypto and on-chain perps, energy commodities, US and global macro (Fed, CPI, jobs, GDP, Treasury, World Bank), SEC filings, congressional trades, and market sentiment. No API keys, no accounts. Pay per request in USDC via x402 on Base.","url":"https://x402stock.xyz/api/v1/aggregates/%7Bticker%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","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["multiplier","timespan","from","to","adjusted","sort","limit"],"properties":{"to":{"type":"string","default":"2026-09-15","minLength":1},"from":{"type":"string","default":"2025-09-15","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}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","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}}}}},"responseSchema":{"type":"json","example":{"data":{"bars":[{"low":192.5,"high":196,"open":193,"vwap":194.8,"close":195.12,"volume":50000000,"timestamp":"2026-05-28T04:00:00.000Z","trade_count":450000}],"count":1,"adjusted":true},"as_of":"2026-05-29T20:00:00.000Z","source":"x402stock","ticker":"AAPL"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.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_u1PryzzuMq7Y-MUzqs-JS","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 aggregate bar data for a given ticker symbol over a specified time range and timespan, paid per-call in USDC via x402.","exampleAgentPrompt":"Pull me daily adjusted OHLCV bars for AAPL from January 1 2025 to June 1 2025, sorted ascending, with a limit of 5000 bars.","exampleUseCases":[{"title":"Backtest moving average strategy","prompt":"Grab me daily OHLCV bars for SPY over the last two years so I can backtest a 50-day and 200-day moving average crossover strategy."},{"title":"Intraday crypto candlestick analysis","prompt":"Pull hourly candlestick data for BTC-USD for the past 30 days — I want to look at volume and VWAP alongside price to find intraday patterns."},{"title":"Forex pair historical price range","prompt":"Fetch daily aggregate price bars for EUR/USD from January 1 2024 through December 31 2024, sorted ascending, so I can analyze how the pair moved across the full year."}],"resultDescription":"A JSON object containing the ticker symbol, an array of OHLCV bars (open, high, low, close, volume, VWAP, trade count, timestamp) for the requested period and timespan, total bar count, adjusted flag, data source, and as-of timestamp.","failureModes":["Invalid or unsupported ticker symbol returns an error or empty bars array","Date range outside available historical data returns empty results","Invalid timespan or multiplier value returns a validation error","Payment failure via x402/USDC results in 402 Payment Required response","Limit exceeds maximum (50000) returns a validation error","Future date range returns no data or error"],"whenToPreferThis":"Use this endpoint when you need structured, paginated OHLCV candlestick/bar data for a specific ticker across any supported asset class (US stocks, ETFs, crypto, forex) over a custom date range and timespan, especially when you want no-account pay-per-call access via USDC on Base rather than a subscription API key service.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-12T18:30:01.684Z","isFirstParty":false}