# 2s.io CEX OHLCV Candlesticks

> 2s.io CEX OHLCV Candlesticks is a paid API for AI agents from 2s.io, paid per call via x402, $0.0036/call, status unknown (last checked 2026-09-14).

Returns OHLCV candlestick bars for a centralized-exchange spot trading pair (e.g. BTC-USD) at a given interval and limit.

## Facts

- Endpoint: GET https://2s.io/api/crypto/cex-klines
- Price: $0.0036/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-io-cex-ohlcv-candlesticks-b54e36a0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AnfQ0BlZU_35eMeRqrP34

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 2s-io-cex-ohlcv-candlesticks-b54e36a0
```

Example prompt: Can you pull the last 100 one-hour OHLCV candles for BTC-USD from a centralized exchange spot market?

## When to prefer this

Use this endpoint when you need OHLCV candlestick data from centralized exchange (CEX) spot markets. Prefer this over on-chain DEX OHLCV endpoints (e.g. crypto.dex-ohlcv) when you need traditional exchange price data rather than DeFi liquidity pool pricing. Ideal for charting, technical analysis, backtesting, or any workflow requiring structured time-series price bars for major crypto pairs like BTC-USD, ETH-USD, or SOL-USD without needing an API key.

## Known failure modes

- Invalid or unsupported trading pair returns an error or empty result
- Unsupported interval value (not one of 1m/5m/15m/1h/6h/1d) causes a validation error
- Limit out of range (less than 1 or greater than 300) causes a validation error
- Payment failure or insufficient USDC balance prevents access
- Network or upstream exchange data unavailability causes a timeout or 5xx error

## How this service works

Centralized-exchange OHLCV candlesticks for a spot trading pair (e.g. BTC-USD, ETH-USD, SOL-USD), free/keyless. Pass interval (1m/5m/15m/1h/6h/1d) and limit. Each bar: time, open, high, low, close, volume. Net-new vs crypto.dex-ohlcv (on-chain DEX) — this is CEX spot.

## Output

An array of candlestick bars, each containing: timestamp, open, high, low, close, and volume for the requested trading pair at the specified interval.

## 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",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "pair"
     ],
     "properties": {
      "pair": {
       "type": "string",
       "description": "Trading pair, e.g. BTC-USD."
      },
      "limit": {
       "type": "integer",
       "maximum": 300,
       "minimum": 1
      },
      "interval": {
       "enum": [
        "1m",
        "5m",
        "15m",
        "1h",
        "6h",
        "1d"
       ],
       "type": "string"
      }
     },
     "additionalProperties": false
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-io-cex-ohlcv-candlesticks-b54e36a0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
