# OKX OHLCV Candlestick Data API

> OKX OHLCV Candlestick Data API is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.006/call, status unknown (last checked 2026-09-13, last successful call 2026-07-02).

Returns live OHLCV (open, high, low, close, volume) candlestick data for any crypto symbol from OKX across timeframes from 1 minute to 1 week, including high/low/change summary statistics.

## Facts

- Endpoint: GET https://api.x402node.dev/market/ohlcv
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Last successful call: 2026-07-02
- Success rate: 100% of calls made through Zero
- Rating: 5.0 / 5 from 1 review
- Activations on Zero: 1
- Tags: x402
- Canonical page: https://www.zero.xyz/c/okx-ohlcv-candlestick-data-api-5e9a7599
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QXzDfF5bi2CxYY0lnZoCt

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 okx-ohlcv-candlestick-data-api-5e9a7599
```

Example prompt: Can you pull the last 50 one-hour OHLCV candles for BTC-USDT from OKX so I can see recent price action and the high/low/change summary?

## When to prefer this

Use this endpoint when you need real-time or recent OHLCV candlestick data sourced specifically from OKX, especially for crypto symbols traded on OKX perpetuals or spot markets, and when you need flexible timeframes from 1-minute to 1-week with a built-in high/low/change summary. Prefer this over general market data APIs when OKX price feeds are specifically required or when LLM training data is insufficient for current price history.

## Known failure modes

- Unknown or unsupported symbol returns an error or empty dataset
- Invalid timeframe parameter (outside 1m–1w range) returns a 400 error
- OKX data source temporarily unavailable causes a 502 or timeout
- Payment of 0.006 USDC not completed results in 402 Payment Required
- Rate limiting if too many requests are made in quick succession

## How this service works

Live OHLCV candlestick data for any crypto symbol from OKX across timeframes (1m to 1w), with high/low/change summary - real-time price history absent from LLM training data. ohlcv, candlestick, candles, price history, kline, crypto chart data Accepts payment on Base or Solana — either network works.

## Output

An array of OHLCV candlestick bars for the requested crypto symbol and timeframe, each containing open, high, low, close, and volume values, plus an overall summary of the period's high, low, and price change percentage.

## Example request

```json
{
 "limit": 50,
 "symbol": "BTC-USDT",
 "timeframe": "1h"
}
```

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "coin": {
       "type": "string",
       "description": "Coin (optional)"
      },
      "limit": {
       "type": "string",
       "description": "Number of candles, default 24, max 300"
      },
      "symbol": {
       "type": "string",
       "description": "Crypto symbol, e.g. BTC (default), ETH, SOL"
      },
      "interval": {
       "type": "string",
       "description": "Timeframe: 1m,5m,15m,1h (default),4h,1d,1w"
      },
      "timeframe": {
       "type": "string",
       "description": "Timeframe (optional)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/okx-ohlcv-candlestick-data-api-5e9a7599/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402node.dev](https://www.zero.xyz/host/api.x402node.dev/llms.txt)
