{"uid":"cap_6f0e5fL6zVV3zByY4GHNC","slug":"coinbase-exchange-ohlcv-candles-api-7713c349","name":"Coinbase Exchange OHLCV Candles API","description":"Get recent or bounded historical Coinbase Exchange OHLCV candles for a crypto pair. Returns timestamp, low, high, open, close and volume. Supports 1m, 5m, 15m, 1h, 6h and 1d bars with at most 300 candles.","url":"https://x402-gateway-production-1f21.up.railway.app/crypto/candles?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["product_id"],"properties":{"end":{"type":"integer","minimum":0,"description":"Optional Unix end timestamp in seconds."},"limit":{"type":"integer","maximum":300,"minimum":1,"description":"When start/end are omitted, target this many recent bars; default 100."},"start":{"type":"integer","minimum":0,"description":"Optional Unix start timestamp in seconds."},"product_id":{"type":"string","pattern":"^[A-Za-z0-9]{2,15}-[A-Za-z0-9]{2,15}$","description":"Coinbase Exchange product such as BTC-USD, ETH-USD, SOL-USD or ETH-USDC."},"granularity":{"enum":[60,300,900,3600,21600,86400],"type":"integer","description":"Candle width in seconds."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"status":"ready"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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_TZz8ckSKLKREJFNABYYD9","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns OHLCV (open, high, low, close, volume) candlestick data for a Coinbase Exchange crypto trading pair at configurable time granularities","exampleAgentPrompt":"Pull the last 100 one-hour candles for BTC-USD from Coinbase Exchange so I can see the open, high, low, close, and volume for each bar.","exampleUseCases":[{"title":"Crypto price chart for dashboard","prompt":"Fetch the last 50 daily candles for ETH-USD from Coinbase Exchange — I need the open, high, low, close, and volume for each day to render a price chart."},{"title":"Backtesting a trading strategy","prompt":"Get me 300 five-minute OHLCV bars for SOL-USD on Coinbase starting from Unix timestamp 1717200000 to 1717290000 so I can run a backtest."},{"title":"Detecting recent volatility spike","prompt":"Grab the last 60 one-minute candles for BTC-USD on Coinbase so I can check if there was a sudden price spike or volume surge in the past hour."}],"resultDescription":"An array of up to 300 OHLCV candle objects for the requested crypto pair, each containing timestamp (Unix seconds), low price, high price, open price, close price, and trading volume, ordered by time. Granularity options are 1m, 5m, 15m, 1h, 6h, and 1d.","failureModes":["Invalid product_id format (must match pattern like BTC-USD) returns validation error","Unsupported granularity value (not one of 60,300,900,3600,21600,86400) returns error","Start/end timestamps out of range or inverted returns empty or error response","Limit exceeds 300 candles returns validation error","Coinbase Exchange upstream unavailability causes 5xx error","Insufficient USDC balance for x402 payment causes payment failure"],"whenToPreferThis":"Choose this endpoint when you need structured OHLCV candlestick price history for Coinbase Exchange trading pairs specifically, including BTC-USD, ETH-USD, SOL-USD, or ETH-USDC. It is ideal for technical analysis, charting, backtesting trading strategies, or monitoring recent crypto price action. Prefer this over generic crypto price endpoints when you need aggregated bar data at specific granularities (1m through 1d) with high, low, open, close, and volume in a single call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T12:35:34.080Z","isFirstParty":false,"canonicalSlug":"coinbase-exchange-ohlcv-candles-api-7713c349"}