# Crypto Market Data – Historical Klines (Binance Candlesticks)

> Crypto Market Data – Historical Klines (Binance Candlesticks) 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-14).

Fetches historical OHLCV candlestick (kline) data for a given crypto trading pair from Binance over a specified time range and interval.

## Facts

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

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-historical-klines-binance-candlesticks-590a19b7 -d '<json body>'
```

Example prompt: Can you pull the 1-hour Binance candlesticks for BTCUSDT from January 1 2024 00:00 to January 2 2024 00:00 so I can see the open, high, low, close, and volume for each candle?

## When to prefer this

Choose this endpoint when you need structured historical OHLCV candlestick data from Binance for a specific trading pair and date range — especially for backtesting, charting, or quantitative analysis. It is ideal when you need trade volume and taker-side buy volumes in addition to price. Prefer over generic crypto price APIs when you need Binance-sourced data with fine-grained interval control from 1-minute to monthly candles.

## Known failure modes

- Invalid symbol (e.g. lowercase or non-existent pair) returns an error or empty klines array
- Malformed from_time or to_time (wrong format, not '%Y-%m-%d %H:%M') causes a parsing error
- Requesting a very large time range at a fine interval (e.g. 1m over months) may exceed Binance's data limits or return truncated results
- Symbol not listed on Binance returns empty or error response
- Network or upstream Binance API outage returns a 5xx error from the service

## 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, the interval used, and an array of kline objects each with open_time, close_time, open_price, high_price, low_price, close_price, volume, quote_asset_volume, amount_trades, taker_buy_base_volume, and taker_buy_quote_volume — covering the full requested time window at the specified granularity.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "symbol": {
   "type": "string",
   "pattern": "^[A-Z0-9]+$",
   "examples": [
    "BTCUSDT"
   ],
   "description": "Trading symbol, e.g. BTCUSDT."
  },
  "to_time": {
   "type": "string",
   "examples": [
    "2024-01-02 00:00"
   ],
   "description": "End of the time range, format: %Y-%m-%d %H:%M"
  },
  "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"
  },
  "from_time": {
   "type": "string",
   "examples": [
    "2024-01-01 00:00"
   ],
   "description": "Start of the time range, format: %Y-%m-%d %H:%M"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "klines": [
   {
    "volume": 125.5,
    "low_price": 41800,
    "open_time": "2024-01-01T00:00:00",
    "close_time": "2024-01-01T01:00:00",
    "high_price": 42500,
    "open_price": 42000,
    "close_price": 42200,
    "amount_trades": 1250,
    "quote_asset_volume": 5290000,
    "taker_buy_base_volume": 60.3,
    "taker_buy_quote_volume": 2541800
   }
  ],
  "symbol": "BTCUSDT",
  "interval": "1h"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/crypto-market-data-historical-klines-binance-candlesticks-590a19b7/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)
