{"uid":"cap_QiMKszXKPkWAwa_lmswaF","slug":"x402stock-on-chain-perps-candlestick-data-0bd0d4ca","name":"x402stock On-Chain Perps Candlestick Data","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/perps/candles/%7Bcoin%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":["interval","lookback"],"properties":{"end":{"type":"integer","maximum":9007199254740991,"exclusiveMinimum":0},"start":{"type":"integer","maximum":9007199254740991,"exclusiveMinimum":0},"interval":{"enum":["1m","3m","5m","15m","30m","1h","2h","4h","8h","12h","1d","3d","1w","1M"],"type":"string","default":"1h"},"lookback":{"type":"integer","default":200,"maximum":5000,"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":["source","as_of","venue","coin","interval","count","candles"],"properties":{"coin":{"type":"string"},"as_of":{"type":"string"},"count":{"type":"number"},"venue":{"type":"string"},"source":{"type":"string","const":"x402stock"},"candles":{"type":"array","items":{"type":"object","required":["start","end","open","high","low","close","volume","trades"],"properties":{"end":{"anyOf":[{"type":"string"},{"type":"null"}]},"low":{"anyOf":[{"type":"number"},{"type":"null"}]},"high":{"anyOf":[{"type":"number"},{"type":"null"}]},"open":{"anyOf":[{"type":"number"},{"type":"null"}]},"close":{"anyOf":[{"type":"number"},{"type":"null"}]},"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"trades":{"anyOf":[{"type":"number"},{"type":"null"}]},"volume":{"anyOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},"interval":{"type":"string"}},"additionalProperties":false}}}}},"responseSchema":{"type":"json","example":{"coin":"BTC","as_of":"2026-06-04T00:00:00.000Z","count":1,"venue":"hyperliquid","source":"x402stock","candles":[{"end":"2026-06-01T00:59:59.999Z","low":71218,"high":71589,"open":71413,"close":71411,"start":"2026-06-01T00:00:00.000Z","trades":17583,"volume":3376.8}],"interval":"1h"}},"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_hhEk7N2TCJ2x1XqdYEZt7","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 OHLCV candlestick data for a specified cryptocurrency perpetuals contract traded on Hyperliquid, with configurable interval and lookback period.","exampleAgentPrompt":"Pull the last 200 one-hour candles for BTC perpetuals from x402stock — I want open, high, low, close, and volume so I can analyze recent price action.","exampleUseCases":[{"title":"Backtest ETH perp trading signals","prompt":"Fetch the last 500 daily candles for ETH perpetuals on Hyperliquid — I need open, high, low, close, and volume so I can backtest a momentum strategy I'm building."},{"title":"Monitor SOL perp intraday price action","prompt":"Pull the last 100 fifteen-minute candles for SOL perpetuals from Hyperliquid so I can check how price has been moving today and spot any breakout patterns."},{"title":"Compare BTC perp volatility across timeframes","prompt":"Get me 200 one-hour candles and 200 four-hour candles for BTC perpetuals on Hyperliquid — I want to compare volatility and trading volume across both timeframes."}],"resultDescription":"A JSON object containing the coin symbol, venue (Hyperliquid), interval, timestamp of the response, count of candles, and an array of OHLCV candle objects each with start time, end time, open, high, low, close, volume, and trade count fields.","failureModes":["Invalid coin symbol returns error or empty candles array","Lookback exceeds maximum of 5000 resulting in validation error","Invalid interval value not in allowed enum returns 400-level error","Start/end timestamps out of range or inverted may return empty results","Payment failure via x402 protocol returns 402 Payment Required","Network timeout on Hyperliquid data source returns 503 or error"],"whenToPreferThis":"Use this endpoint when you need on-chain perpetuals OHLCV candlestick data specifically from Hyperliquid, without needing API keys or subscriptions — ideal for AI agents doing technical analysis, backtesting signals, or monitoring crypto perp price action on a pay-per-call basis.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:50:09.752Z","isFirstParty":false}