# Binance



Binance's public market data — one pair's rolling 24-hour ticker, its OHLCV candles at any interval, and the live order book.



## Binance Ticker

One pair's rolling 24-hour statistics — last price, change, high, low, volume, and the best bid and ask.

- Method: `GET`
- Path: `/v1/market/binance/ticker`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `symbol` | string | required | A trading pair. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/market/binance/ticker \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "symbol": "BTCUSDT",
    "last_price": 69334.79,
    "price_change": 4049.87,
    "price_change_percent": 5.901,
    "weighted_avg_price": 67502.1,
    "prev_close_price": 65284.92,
    "last_qty": 0.001,
    "bid_price": 69334.98,
    "bid_qty": 4.03,
    "ask_price": 69335.0,
    "ask_qty": 1.2,
    "open_price": 65284.92,
    "high_price": 70000.0,
    "low_price": 64166.0,
    "volume": 29054.5,
    "quote_volume": 1959312345.6,
    "open_time": 1787097600000,
    "close_time": 1787184000000,
    "trades": 1234567
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T16:30:00.000Z",
    "age_seconds": 30,
    "next_update_at": "2026-08-20T16:35:00.000Z"
  }
}
```

## Binance Klines

One pair's OHLCV candles, at any interval and depth up to a thousand candles.

- Method: `GET`
- Path: `/v1/market/binance/klines`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `symbol` | string | required | A trading pair. |
| `interval` | string | optional | Candle size. |
| `limit` | integer | optional | How many candles. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/market/binance/klines \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "symbol": "BTCUSDT",
    "interval": "1d",
    "candles": [
      {
        "open_time": 1787097600000,
        "open": 64725.42,
        "high": 70000.0,
        "low": 64166.0,
        "close": 69334.79,
        "volume": 29054.5,
        "close_time": 1787183999999,
        "trades": 987654
      }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T16:30:00.000Z",
    "age_seconds": 30,
    "next_update_at": "2026-08-20T16:35:00.000Z"
  }
}
```

## Binance Order Book

One pair's order book — the top fifty bids and asks, price against quantity.

- Method: `GET`
- Path: `/v1/market/binance/order-book`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `symbol` | string | required | A trading pair. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/market/binance/order-book \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "symbol": "BTCUSDT",
    "last_update_id": 98768296692,
    "bids": [
      { "price": 72685.99, "quantity": 4.03965 }
    ],
    "asks": [
      { "price": 72686.0, "quantity": 1.2 }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T16:30:00.000Z",
    "age_seconds": 30,
    "next_update_at": "2026-08-20T16:35:00.000Z"
  }
}
```

## Binance Trades

One pair's most recent trades — price, quantity, direction, and time.

- Method: `GET`
- Path: `/v1/market/binance/trades`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `symbol` | string | required | A trading pair. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/market/binance/trades \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "symbol": "BTCUSDT",
    "trades": [
      {
        "id": 6591432776,
        "price": 75527.59,
        "quantity": 0.00007,
        "quote_quantity": 5.2869,
        "time": 1787276891203,
        "buyer_is_maker": true
      }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T16:30:00.000Z",
    "age_seconds": 30,
    "next_update_at": "2026-08-20T16:35:00.000Z"
  }
}
```

## Binance Aggregate Trades

One pair's recent trades, aggregated — one line per price level crossed.

- Method: `GET`
- Path: `/v1/market/binance/agg-trades`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `symbol` | string | required | A trading pair. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/market/binance/agg-trades \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "symbol": "BTCUSDT",
    "trades": [
      {
        "aggregate_id": 4037946304,
        "price": 75532.53,
        "quantity": 0.00027,
        "first_trade_id": 6591432820,
        "last_trade_id": 6591432820,
        "time": 1787276891539,
        "buyer_is_maker": false
      }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T16:30:00.000Z",
    "age_seconds": 30,
    "next_update_at": "2026-08-20T16:35:00.000Z"
  }
}
```

## Binance Average Price

One pair's five-minute moving average price.

- Method: `GET`
- Path: `/v1/market/binance/avg-price`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `symbol` | string | required | A trading pair. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/market/binance/avg-price \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "symbol": "BTCUSDT",
    "minutes": 5,
    "price": 75262.07,
    "close_time": 1787276891826
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T16:30:00.000Z",
    "age_seconds": 30,
    "next_update_at": "2026-08-20T16:35:00.000Z"
  }
}
```

## Binance Book Ticker

One pair's best bid and ask, price against quantity — the tightest quote on the book.

- Method: `GET`
- Path: `/v1/market/binance/book-ticker`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `symbol` | string | required | A trading pair. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/market/binance/book-ticker \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "symbol": "BTCUSDT",
    "bid_price": 75540.31,
    "bid_quantity": 0.00002,
    "ask_price": 75540.32,
    "ask_quantity": 0.00001
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T16:30:00.000Z",
    "age_seconds": 30,
    "next_update_at": "2026-08-20T16:35:00.000Z"
  }
}
```

## Binance Prices

Every pair's last price, in one document.

- Method: `GET`
- Path: `/v1/market/binance/prices`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/market/binance/prices \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "count": 2473,
    "prices": [
      { "symbol": "ETHBTC", "price": 0.03146 },
      { "symbol": "BTCUSDT", "price": 75527.59 }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T16:30:00.000Z",
    "age_seconds": 30,
    "next_update_at": "2026-08-20T16:35:00.000Z"
  }
}
```

## Binance Windowed Ticker

One pair's rolling statistics over a one-day window — last price, change, range, and volumes.

- Method: `GET`
- Path: `/v1/market/binance/ticker-windowed`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `symbol` | string | required | A trading pair. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/market/binance/ticker-windowed \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "symbol": "BTCUSDT",
    "last_price": 75262.07,
    "price_change": 5930.39,
    "price_change_percent": 8.501,
    "weighted_avg_price": 71788.59,
    "open_price": 69331.68,
    "high_price": 75540.31,
    "low_price": 69300.0,
    "volume": 29054.5,
    "quote_volume": 1959312345.6,
    "open_time": 1787190400000,
    "close_time": 1787276800000
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T16:30:00.000Z",
    "age_seconds": 30,
    "next_update_at": "2026-08-20T16:35:00.000Z"
  }
}
```

## Binance Exchange Info

Every listed pair with its status and its base and quote assets — the exchange's own directory.

- Method: `GET`
- Path: `/v1/market/binance/exchange-info`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `symbol` | string | optional | One pair, e.g. `BTCUSDT`. Omit for the whole spot directory. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/market/binance/exchange-info \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "count": 2473,
    "symbols": [
      { "symbol": "BTCUSDT", "status": "TRADING", "base_asset": "BTC", "quote_asset": "USDT" }
    ]
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T16:30:00.000Z",
    "age_seconds": 30,
    "next_update_at": "2026-08-20T16:35:00.000Z"
  }
}
```