{"uid":"cap_ad5V4C_SCaTPGHR2XSGlD","slug":"tradesonar-dydx-candlesticks-api-9be2a8d9","name":"TradeSonar dYdX Candlesticks API","description":"TradeSonar: dYdX on-chain smart-money, funding and crowding signals. Every response is stamped with data_as_of freshness (block height + replica lag).","url":"https://api.tradesonar.io/v1/markets/%7Bticker%7D/candles?utm_source=zero.xyz","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":{"type":"object","required":["ticker"],"properties":{"ticker":{"type":"string","description":"Market ticker, e.g. ETH-USD (NOT ETH-USDT). See /v1/markets for valid tickers."}}},"queryParams":{"type":"object","properties":{"to":{"type":"string","description":"End time, ISO8601 (optional)"},"from":{"type":"string","description":"Start time, ISO8601 e.g. 2026-10-01T00:00:00Z (optional)"},"limit":{"type":"integer","default":200,"maximum":1000,"minimum":1,"description":"Max candles to return, 1-1000"},"resolution":{"type":"string","default":"1MIN","description":"Candle size: 1MIN/5MINS/15MINS/30MINS/1HOUR/4HOURS/1DAY (no sub-minute)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"data":{"candles":[{"low":"...","high":"...","open":"...","close":"...","trades":0,"startedAt":"...","usdVolume":"...","baseTokenVolume":"..."}]}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_QxOBjHs1eGkrskxh8tycY","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","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 dYdX perpetual market at configurable resolutions from 1-minute to 1-day","exampleAgentPrompt":"Pull the last 100 hourly candles for ETH-USD on dYdX — I need the open, high, low, close, and volume for each so I can run a momentum backtest.","exampleUseCases":[{"title":"Backtesting a momentum strategy","prompt":"Get me 500 daily candles for BTC-USD from dYdX starting October 1st 2025 — I want the full OHLCV so I can backtest a moving-average crossover strategy."},{"title":"Intraday price chart for trading dashboard","prompt":"Fetch the last 200 five-minute candles for SOL-USD on dYdX so I can plot an intraday price chart for my trading dashboard right now."},{"title":"Volatility analysis over past week","prompt":"Pull 4-hour candles for ETH-USD on dYdX for the past 7 days — I want to calculate realized volatility and see how wide the high-low ranges have been each session."}],"resultDescription":"Returns a JSON object with an array of candles, each containing open, high, low, close prices as strings, USD volume, base token volume, trade count, and a startedAt ISO8601 timestamp. Data freshness is indicated by a data_as_of field with block height and replica lag.","failureModes":["Invalid ticker symbol (not found in /v1/markets) returns an error — ticker must be in ETH-USD format, not ETH-USDT","Resolution value outside allowed enum (e.g. sub-minute) returns a validation error","from/to timestamps in wrong format (non-ISO8601) cause a parse error","limit exceeding 1000 or below 1 returns a validation error","Payment not provided or insufficient USDC (x402 protocol) returns 402 Payment Required","Time range too large for the requested resolution may return partial data or timeout"],"whenToPreferThis":"Use this endpoint when you need historical OHLCV candlestick data specifically from dYdX perpetuals, especially when you want to combine price history with TradeSonar's companion signals (funding, crowding, smart-money) for the same market. Prefer this over generic crypto OHLCV APIs when dYdX-specific on-chain provenance and freshness stamping (block height + replica lag) matter, such as for systematic strategies or signal validation on dYdX.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T12:36:05.896Z","isFirstParty":false,"canonicalSlug":"tradesonar-dydx-candlesticks-api-9be2a8d9"}