# OKX Long/Short Ratio API

> OKX Long/Short Ratio API is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.006/call, status unknown (last checked 2026-09-15).

Returns live and historical long/short account ratio for any crypto asset from OKX, indicating trader positioning and crowding bias.

## Facts

- Endpoint: GET https://api.x402node.dev/market/long-short-ratio
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/okx-long-short-ratio-api-3669c2fa
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zKHGa1gA2i2H_YceY31mZ

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-long-short-ratio-api-3669c2fa
```

Example prompt: What's the current long/short ratio for BTC on OKX right now, and is the trade starting to look crowded in one direction?

## When to prefer this

Use this endpoint when you need real-time trader sentiment and positioning data for a specific crypto asset — particularly to detect crowded trades or contrarian signals. Prefer this over general news sentiment tools when you specifically need quantitative long/short positioning from perpetual futures markets on OKX.

## Known failure modes

- Unknown or unsupported crypto symbol returns an error or empty data
- OKX API downtime causes failure to fetch live data
- Rate limiting if called too frequently
- Invalid symbol format results in a bad request error

## How this service works

Live long/short account ratio for any crypto from OKX with history and crowding bias - real-time sentiment positioning data not in any LLM training set. long short ratio, long short, trader positioning, crowded trade, sentiment ratio Accepts payment on Base or Solana — either network works.

## Output

Returns the current ratio of long vs short accounts for the specified crypto symbol, including the raw ratio value, percentage of longs and shorts, historical data points, and a crowding bias signal indicating whether the market is heavily skewed to one side.

## 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": {
      "coin": {
       "type": "string",
       "description": "Coin (optional)"
      },
      "period": {
       "type": "string",
       "description": "5m,15m,30m,1H,2H,4H,1D (default)"
      },
      "symbol": {
       "type": "string",
       "description": "Crypto symbol, e.g. BTC (default)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/okx-long-short-ratio-api-3669c2fa/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)
