# Coinbase Exchange OHLCV Candles API

> Coinbase Exchange OHLCV Candles API is a paid API for AI agents from x402-gateway-production-1f21.up.railway.app, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-11).

Returns OHLCV (open, high, low, close, volume) candlestick data for a Coinbase Exchange crypto trading pair at configurable time granularities

## Facts

- Endpoint: POST https://x402-gateway-production-1f21.up.railway.app/crypto/candles?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/coinbase-exchange-ohlcv-candles-api-7713c349
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6f0e5fL6zVV3zByY4GHNC

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability coinbase-exchange-ohlcv-candles-api-7713c349 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "status": "ready"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/coinbase-exchange-ohlcv-candles-api-7713c349/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway-production-1f21.up.railway.app](https://www.zero.xyz/host/x402-gateway-production-1f21.up.railway.app/llms.txt)
