{"uid":"cap_EJkUkGdw_ifrZ0b03TJOx","slug":"x402-crypto-market-data-historical-klines-2e243ade","name":"x402 Crypto Market Data – Historical Klines","description":"On-demand crypto market data. Discover available trading pairs for free, then retrieve live prices, market metadata, and historical candlesticks when you need them.","url":"https://x402-crypto-market-data.up.railway.app/historical-klines?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"symbol":{"type":"string","pattern":"^[A-Z0-9]+$","examples":["BTCUSDT"],"description":"Trading symbol, e.g. BTCUSDT."},"to_time":{"type":"string","examples":["2024-01-02 00:00"],"description":"End of the time range, format: %Y-%m-%d %H:%M"},"interval":{"enum":["1m","3m","5m","15m","30m","1h","2h","4h","6h","8h","12h","1d","3d","1w","1M"],"type":"string","title":"KlineInterval","default":"1h","description":"Candlestick interval"},"from_time":{"type":"string","examples":["2024-01-01 00:00"],"description":"Start of the time range, format: %Y-%m-%d %H:%M"}}},"responseSchema":{"type":"json","example":{"klines":[{"volume":125.5,"low_price":41800,"open_time":"2024-01-01T00:00:00","close_time":"2024-01-01T01:00:00","high_price":42500,"open_price":42000,"close_price":42200,"amount_trades":1250,"quote_asset_volume":5290000,"taker_buy_base_volume":60.3,"taker_buy_quote_volume":2541800},{"volume":118.2,"low_price":42100,"open_time":"2024-01-01T01:00:00","close_time":"2024-01-01T02:00:00","high_price":42800,"open_price":42200,"close_price":42600,"amount_trades":1180,"quote_asset_volume":5037600,"taker_buy_base_volume":58.1,"taker_buy_quote_volume":2479000}],"symbol":"BTCUSDT","interval":"1h"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_8xyamOAva0wfJWoNvNNvM","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns historical OHLCV candlestick data for a given crypto trading pair over a specified time range and interval","exampleAgentPrompt":"Can you pull the hourly candlestick data for BTCUSDT from January 1, 2024 00:00 to January 2, 2024 00:00? I want to see the open, high, low, close, and volume for each candle.","exampleUseCases":[{"title":"Backtesting a trading strategy","prompt":"Fetch the 1-hour OHLCV candles for ETHUSDT from March 1, 2024 00:00 to March 31, 2024 00:00 — I need the full historical klines to backtest a moving average crossover strategy."},{"title":"Crypto price volatility analysis","prompt":"Get me the 15-minute candlestick data for SOLUSDT between January 15, 2024 00:00 and January 16, 2024 00:00 so I can analyze intraday price volatility."},{"title":"Daily chart review for reporting","prompt":"Pull the daily klines for BTCUSDT from the start of 2024 through June 30, 2024 00:00 — I'm building a price performance report and need the open, high, low, close, and volume for each day."}],"resultDescription":"Returns a JSON object containing the requested symbol, interval, and an array of candlestick objects each with open_time, close_time, open_price, high_price, low_price, close_price, volume, quote_asset_volume, amount_trades, taker_buy_base_volume, and taker_buy_quote_volume fields.","failureModes":["Invalid or unsupported trading symbol returns an error — use the free discovery endpoint first to validate pairs","Malformed date/time format (not %Y-%m-%d %H:%M) causes a parse error","Time range with no available data returns empty klines array","Very large time ranges with short intervals may return partial results or be rejected","Payment failure via x402 protocol results in 402 response and no data returned"],"whenToPreferThis":"Choose this endpoint when you need structured OHLCV candlestick history for a specific crypto trading pair over a defined time window. It is ideal for quantitative analysis, backtesting, charting, and reporting use cases where precise historical price data at a chosen interval (from 1-minute to monthly) is required. Prefer this over live price endpoints when the query is retrospective rather than real-time.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T06:42:08.206Z","isFirstParty":false,"canonicalSlug":"x402-crypto-market-data-historical-klines-2e243ade"}