# Crypto Market Data – Recent Historical Klines

> Crypto Market Data – Recent Historical Klines is a paid API for AI agents from crypto-market-data.up.railway.app, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Fetches the most recent N historical candlestick (OHLCV) data points for a given crypto trading pair from Binance at a specified interval.

## Facts

- Endpoint: POST https://crypto-market-data.up.railway.app/historical-klines/recent
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/crypto-market-data-recent-historical-klines-23260467
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XenWJ6FYn76V_yZOWXBO_

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 crypto-market-data-recent-historical-klines-23260467 -d '<json body>'
```

Example prompt: Pull the last 200 hourly candlesticks for BTCUSDT from the Binance market data agent so I can analyze recent price action.

## When to prefer this

Choose this endpoint when you need recent historical OHLCV candlestick data from Binance for a specific trading pair and time interval, especially for technical analysis, backtesting, or charting. It is ideal for fetching a rolling window of recent candles rather than arbitrary date-range queries. Prefer it over generic market data APIs when Binance-sourced data is required.

## Known failure modes

- Invalid or unsupported trading symbol returns an error or empty klines array
- Requesting more than 1000 klines triggers a validation error
- Invalid interval value not in the allowed enum causes a 400-style error
- Binance upstream unavailability may cause timeouts or partial data
- Requesting n=0 or negative values fails due to exclusiveMinimum constraint

## How this service works

A crypto market data agent that exposes live symbols, market metadata, and historical Binance candlesticks.

## Output

Returns a JSON object containing the requested symbol and interval, along with an array of kline objects each including open/close/high/low prices, volume, quote asset volume, taker buy base and quote volumes, number of trades, and open/close timestamps.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "n": {
   "type": "integer",
   "default": 100,
   "maximum": 1000,
   "description": "Number of most recent klines to fetch (max 1000).",
   "exclusiveMinimum": 0
  },
  "symbol": {
   "type": "string",
   "pattern": "^[A-Z0-9]+$",
   "examples": [
    "BTCUSDT"
   ],
   "description": "Trading symbol, e.g. BTCUSDT."
  },
  "interval": {
   "enum": [
    "1m",
    "3m",
    "5m",
    "15m",
    "30m",
    "1h",
    "2h",
    "4h",
    "6h",
    "8h",
    "12h",
    "1d",
    "3d",
    "1w",
    "1M"
   ],
   "type": "string",
   "title": "KlineInterval",
   "default": "1h",
   "description": "Candlestick interval."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "klines": [
   {
    "volume": 45.5,
    "low_price": 2240,
    "open_time": "2024-01-15T10:00:00",
    "close_time": "2024-01-15T10:15:00",
    "high_price": 2265,
    "open_price": 2250,
    "close_price": 2260,
    "amount_trades": 420,
    "quote_asset_volume": 102847.5,
    "taker_buy_base_volume": 22.1,
    "taker_buy_quote_volume": 50002
   }
  ],
  "symbol": "ETHUSDT",
  "interval": "15m"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/crypto-market-data-recent-historical-klines-23260467/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from crypto-market-data.up.railway.app](https://www.zero.xyz/host/crypto-market-data.up.railway.app/llms.txt)
