{"uid":"cap_v2uYqYNGwrIBhzeofamYP","slug":"agents-x402stock-xyz-x402stock-crypto-spot-ohlcv-historical-bars-57f7ac23","name":"x402stock Crypto Spot OHLCV Historical Bars","description":"Historical OHLCV bars for a major-coin crypto spot pair at the requested multiplier and timespan (minute, hour, day, week, month) between `from` and `to`. Pass the pair in the path as BASE-QUOTE, e.g. BTC-USD or ETH-USD. Aggregated centralized-market spot — for Hyperliquid-listed token spot use /api/v1/spot, for perps use /api/v1/perps. From x402stock, a market & economic data API (x402, USDC).","url":"https://agents.x402stock.xyz/api/v1/crypto/{pair}/aggregates","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":{"pair":{"type":"string"},"type":"object"},"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":{"type":"object","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},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","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.02/call","primary":{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.02","per":"call","confidence":"exact"},{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_joSYJ2AxTyEMUeWL5B6W8","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":null,"planRef":null},{"uid":"pm__lb6VNdZ0fosV16QGp2eI","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"agents.x402stock.xyz","brandSlug":"agents-x402stock-xyz-mpp","brandBaseUrl":"https://agents.x402stock.xyz","brandDocsUrl":null,"whatItDoes":"Returns historical OHLCV candlestick bars for major crypto spot pairs (e.g. BTC-USD, ETH-USD) at a configurable timespan and multiplier between two dates.","exampleAgentPrompt":"Pull me daily BTC-USD OHLCV bars from January 1 2024 to June 30 2024, sorted ascending, so I can chart Bitcoin's price trend over the first half of last year.","exampleUseCases":[{"title":"Backtesting a crypto trading strategy","prompt":"Get me hourly ETH-USD candlestick bars for all of 2023 — open, high, low, close, and volume — sorted oldest to newest, so I can run a moving average crossover backtest."},{"title":"Monitoring Bitcoin weekly price trends","prompt":"Pull weekly BTC-USD OHLCV bars from the start of 2024 through today so I can see how Bitcoin has trended week by week this year."},{"title":"Charting altcoin monthly performance","prompt":"Fetch monthly SOL-USD price bars from January 2022 through December 2023, including volume and VWAP, so I can chart Solana's long-term price history."}],"resultDescription":"Returns an array of OHLCV bars each containing open, high, low, close, volume, VWAP, trade count, and timestamp, along with a total bar count, adjusted flag, source identifier, and as-of timestamp. Data represents aggregated centralized-market spot prices for the requested pair and time window.","failureModes":["Unsupported or misspelled pair (e.g. not a major coin) returns an error or empty data","Date range too large or limit exceeded may truncate results or return an error","Invalid timespan or multiplier value returns a validation error","Future date ranges return empty or partial data","Pair formatted incorrectly (not BASE-QUOTE) returns a bad request error","Payment failure (insufficient USDC balance) blocks the request"],"whenToPreferThis":"Use this endpoint when you need multi-period historical OHLCV candlestick data for major centralized-market crypto spot pairs like BTC-USD or ETH-USD. Choose this over /api/v1/spot (which is for Hyperliquid-listed tokens) or /api/v1/perps (for perpetual futures). Best for backtesting, charting, trend analysis, and any workflow requiring time-series price data with volume and VWAP across configurable timespans.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:36:40.753Z","isFirstParty":false}