{"uid":"cap__6M6YbgmYNQGZW0tqk0PS","slug":"x402-crypto-market-data-historical-klines-recent-65e27e3e","name":"x402 Crypto Market Data – Historical Klines (Recent)","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/recent","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"n":{"type":"integer","default":100,"maximum":1000,"description":"Number of most recent klines to fetch (max 1000).","exclusiveMinimum":0},"symbol":{"type":"string","pattern":"^[A-Z0-9]+$","examples":["BTCUSDT"],"description":"Trading symbol, e.g. BTCUSDT."},"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."}}},"responseSchema":{"type":"json","example":{"klines":[{"volume":45.5,"low_price":2240,"open_time":"2024-01-15T10:00:00","close_time":"2024-01-15T10:15:00","high_price":2265,"open_price":2250,"close_price":2260,"amount_trades":420,"quote_asset_volume":102847.5,"taker_buy_base_volume":22.1,"taker_buy_quote_volume":50002},{"volume":52.3,"low_price":2255,"open_time":"2024-01-15T10:15:00","close_time":"2024-01-15T10:30:00","high_price":2275,"open_price":2260,"close_price":2270,"amount_trades":485,"quote_asset_volume":118481,"taker_buy_base_volume":25.8,"taker_buy_quote_volume":58506}],"symbol":"ETHUSDT","interval":"15m"}},"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_Uns6nU_mC95oVvbbrNMv_","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 the most recent N candlestick (OHLCV) bars for a given trading pair and interval, paid via x402 micropayment.","exampleAgentPrompt":"Can you pull the last 200 hourly candlesticks for BTCUSDT so I can check recent price action?","exampleUseCases":[{"title":"Crypto trading signal analysis","prompt":"Grab the last 500 15-minute candles for ETHUSDT — I want to run a moving average crossover on recent price action."},{"title":"Portfolio volatility check","prompt":"Pull the 100 most recent daily candles for SOLUSDT and BNBUSDT so I can compare their recent volatility."},{"title":"Intraday momentum scan","prompt":"Fetch the last 50 1-minute klines for BTCUSDT — I want to see if there's been a sharp move in the past hour."}],"resultDescription":"A JSON object containing the requested symbol and interval, plus an array of kline objects each with open/high/low/close prices, volume, quote asset volume, taker buy base and quote volumes, trade count, and open/close timestamps — covering the N most recent completed bars.","failureModes":["Invalid symbol (not matching ^[A-Z0-9]+$) returns a 4xx error","n exceeding 1000 is rejected by schema validation","Unrecognized interval enum value returns a validation error","Payment failure or insufficient USDC balance returns a 402 Payment Required","Service unavailability on Railway deployment returns 5xx"],"whenToPreferThis":"Use this endpoint when you need recent historical candlestick (OHLCV) data for a crypto trading pair and want a pay-per-call model via x402 micropayments without a subscription key. It is ideal for agents doing technical analysis, backtesting on recent data, or monitoring recent price action. Prefer alternatives if you need very deep historical data (>1000 bars) or real-time streaming rather than batch snapshots.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-16T00:41:39.099Z","isFirstParty":false}