> For the complete documentation index, see [llms.txt](https://ocx.gitbook.io/ocx-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ocx.gitbook.io/ocx-doc/ocx/api/market-data.md).

# market data

Public, unauthenticated endpoints for orderbooks, markets, and OHLC candles.

## GET /perps/markets

List all tradable linear markets (spot, perps, futures).

**Auth**: none.

**Response**

```json
[
  {
    "marketId": "BTC-PERP",
    "base": "BTC",
    "quote": "USDC",
    "type": "perpetual",
    "tradingStatus": "active",
    "tickSize": "0.01",
    "stepSize": "0.0001",
    "minQuantity": "0.0001",
    "priceBandLow": "60000.00",
    "priceBandHigh": "80000.00",
    "takerFeeBps": "5",
    "makerFeeBps": "2",
    "fundingIntervalMs": 300000,
    "fundingMaxRateBps": "25"
  }
]
```

For futures: also includes `expiry`. For spot: `type: "spot"`.

## GET /perps/orderbook/:marketId

Full-depth orderbook snapshot.

**Auth**: none.

**Response**

```json
{
  "marketId": "BTC-PERP",
  "sequence": 123456,
  "bids": [["67450.00", "0.5"], ["67449.00", "1.2"]],
  "asks": [["67451.00", "0.3"], ["67452.00", "0.8"]],
  "timestamp": "2026-04-24T12:00:00Z"
}
```

Each level is `[price, size]` as strings. `sequence` is a monotonically increasing snapshot sequence — pair with the `/perps/book-stream` SSE endpoint to maintain a live book without gaps.

**Errors**

| Status | When               |
| ------ | ------------------ |
| 404    | Unknown `marketId` |

## GET /perps/market-stats

24-hour rolling statistics for all linear markets.

**Auth**: none.

**Response**

```json
[
  {
    "marketId": "BTC-PERP",
    "last": "67450.00",
    "high24h": "67900.00",
    "low24h": "66800.00",
    "volume24h": "1243.5",
    "openInterest": "845.2",
    "change24h": "0.012",
    "fundingRate": "0.00012",
    "nextFundingAt": "2026-04-24T12:05:00Z"
  }
]
```

## GET /perps/ohlc

Historical OHLC candles.

**Auth**: none.

**Query**

| Parameter    | Required | Description                                                     |
| ------------ | :------: | --------------------------------------------------------------- |
| `symbol`     |    yes   | e.g., `BTC-PERP`                                                |
| `resolution` |    no    | `1`, `5`, `15`, `30`, `60`, `240`, `D` (or `1D`). Default `15`. |
| `from`       |    no    | Start time (unix seconds)                                       |
| `to`         |    no    | End time (unix seconds)                                         |

Max span per request: 90 days.

**Response**

```json
[
  {
    "timestamp": 1714000000,
    "open": "67000",
    "high": "67500",
    "low": "66800",
    "close": "67250",
    "volume": "12.5"
  }
]
```

`timestamp` is unix **seconds** for the start of the candle.

## GET /markets/board

Full options board for an underlying.

**Auth**: none.

**Query**

| Parameter    | Required | Description     |
| ------------ | :------: | --------------- |
| `underlying` |    no    | `BTC` (default) |

**Response**

```json
{
  "underlying": "BTC",
  "spotPrice": "67543.21",
  "timestamp": "2026-04-24T12:00:00Z",
  "expiryForwards": {
    "2026-06-26": "68100.00",
    "2026-09-25": "69500.00"
  },
  "calls": [
    {
      "strikePrice": "60000",
      "expiry": "2026-06-26",
      "bid": "0.1220",
      "ask": "0.1270",
      "lastPrice": "0.1245",
      "openInterest": "34",
      "volume24h": "7.5"
    }
  ],
  "puts": [ /* same shape */ ]
}
```

Prices are quoted in **units of the underlying** (e.g., `"0.1245"` BTC for a BTC option), consistent with the Black-76 convention.

## GET /orderbook/:marketId

Options orderbook. Same shape as `GET /perps/orderbook/:marketId` with `marketId` in the option format (e.g., `BTC-2026-06-26-60000-C`).

## GET /catalog/instruments

All tradable instruments with metadata.

**Auth**: none.

**Response**

```json
[
  {
    "id": "BTC-PERP",
    "type": "perpetual",
    "underlying": "BTC",
    "quote": "USDC",
    "basePrice": "67450.00",
    "computedAt": 1714000000000
  }
]
```

## GET /catalog/instruments/:symbol

Single-instrument lookup. Same shape as the above array element, or `404` if not found.

## GET /catalog/products

Product groupings with fee schedules and margin group assignments.

**Auth**: none.

Response format follows the markets response with additional `marginGroup` and fee fields.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ocx.gitbook.io/ocx-doc/ocx/api/market-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
