# OKX Perpetual Order Book Snapshot

> OKX Perpetual Order Book Snapshot is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.012/call, status unknown (last checked 2026-09-14).

Returns a live order-book snapshot for a perpetual futures contract, including best bid/ask, spread, top-of-book depth, and bid/ask imbalance derived from OKX market depth data.

## Facts

- Endpoint: GET https://api.x402node.dev/market/orderbook
- Price: $0.012/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/okx-perpetual-order-book-snapshot-069d77f4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_V7gjGsg2DbdzTvFkVPf2b

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-perpetual-order-book-snapshot-069d77f4
```

Example prompt: Pull the live order book snapshot for BTC-USDT-SWAP right now — I want to see the best bid and ask, the spread, how deep the top of the book is, and whether the imbalance is signaling buying or selling pressure.

## When to prefer this

Use this endpoint when you need real-time order book microstructure data — specifically spread, depth, and imbalance — for perpetual futures on OKX, particularly to inform momentum or execution timing decisions that require live market context an LLM cannot independently compute.

## Known failure modes

- Unknown or invalid symbol returns an error — ensure the symbol matches OKX perpetual format (e.g. BTC-USDT-SWAP)
- OKX API unavailability may cause timeouts or stale data
- Rate limiting at the provider level could return an error if called too frequently
- Missing required symbol parameter returns a 400-level error

## How this service works

Live order-book snapshot for a perpetual: best bid and ask, spread, top-of-book depth and the bid/ask imbalance that signals near-term pressure. Built from OKX market depth for momentum and execution decisions an LLM cannot compute. order book depth, bid ask spread, book imbalance, liquidity Accepts payment on Base or Solana — either network works.

## Output

A structured snapshot containing the best bid price, best ask price, bid-ask spread, top-of-book bid and ask depth quantities, and a bid/ask imbalance ratio indicating near-term directional pressure for the requested perpetual contract.

## 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": {
      "symbol": {
       "type": "string",
       "description": "coin symbol e.g. BTC (default BTC)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/okx-perpetual-order-book-snapshot-069d77f4/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)
