{"uid":"cap_FxZVV8htCim3vXQcLx7gW","slug":"x402stock-spot-candles-api-ff053fb6","name":"x402stock Spot Candles API","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/spot/candles/%7Btoken%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","market","pair","id","interval","count","candles"],"properties":{"id":{"type":"string"},"pair":{"type":"string"},"as_of":{"type":"string"},"count":{"type":"number"},"venue":{"type":"string"},"market":{"type":"string","const":"spot"},"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":{"id":"@107","pair":"HYPE/USDC","as_of":"2026-06-04T00:00:00.000Z","count":1,"venue":"hyperliquid","market":"spot","source":"x402stock","candles":[{"end":"2026-05-28T23:59:59.999Z","low":60.341,"high":67.49,"open":61.519,"close":64.436,"start":"2026-05-28T00:00:00.000Z","trades":169320,"volume":3446893.64}],"interval":"1d"}},"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_b97rVABjTMdA0dqDgK9j5","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 spot trading pair (crypto, forex, or other) over a specified interval and lookback window","exampleAgentPrompt":"Can you pull the last 200 daily candles for HYPE/USDC on the spot market so I can see recent price action?","exampleUseCases":[{"title":"Hourly Bitcoin price history","prompt":"Can you fetch the last 100 hourly candles for BTC/USDC so I can analyze how Bitcoin has been trading over the past few days?"},{"title":"Forex pair candlestick lookup","prompt":"I need the daily OHLCV data for EUR/USD over the past 30 days — can you pull that so I can spot any recent trends in the exchange rate?"},{"title":"Crypto volatility range analysis","prompt":"Can you grab the last 50 four-hour candles for ETH/USDC on the spot market? I want to see the high-low ranges to get a sense of recent volatility."}],"resultDescription":"Returns a JSON object containing metadata (source, venue, market type, pair, interval, count, as_of timestamp) plus an array of candle objects each with start/end timestamps, open, high, low, close prices, volume, and trade count for the requested token and interval.","failureModes":["Invalid or unknown token symbol returns an error or empty candles array","Interval value not in allowed enum causes a 400 validation error","Lookback exceeding 5000 returns a validation error","Start/end timestamps in wrong format or out of range cause errors","Payment failure via x402/USDC results in 402 Payment Required response","Network or upstream venue outage returns 5xx error"],"whenToPreferThis":"Use this endpoint when you need historical OHLCV candlestick data for spot crypto or forex pairs, especially when no API key or account is available and pay-per-call USDC micropayment via x402 on Base is acceptable. Prefer this over alternatives when querying assets traded on venues like Hyperliquid or when you need flexible interval granularity from 1-minute to monthly candles.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:52:25.221Z","isFirstParty":false}