# Beggar Bot OKX Long/Short Ratio

> Beggar Bot OKX Long/Short Ratio is a paid API for AI agents from beggar-bot-demand.beggarbot.workers.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-11-23).

Fetches OKX long/short position ratio data for a specified cryptocurrency, period, and number of data points

## Facts

- Endpoint: GET https://beggar-bot-demand.beggarbot.workers.dev/v1/okxlongshort?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-23
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/beggar-bot-okx-long-short-ratio-a20c7d25
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CZs1lS28EVGeCX3C85uX-

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 beggar-bot-okx-long-short-ratio-a20c7d25
```

Example prompt: What's the OKX long/short ratio for BTC over the last 48 hourly periods? I want to see if the market is leaning more bullish or bearish.

## When to prefer this

Use this endpoint when you need OKX-sourced long/short ratio data for crypto market sentiment analysis. Prefer this over generic market data APIs when specifically needing derivatives positioning data from OKX with configurable time periods and historical depth, accessed via micropayment on Base mainnet.

## Known failure modes

- Invalid coin symbol returns error or empty data
- Unsupported period value (not 5m, 1H, or 1D) may return error
- Payment of $0.02 USDC via x402 on Base mainnet required; unpaid requests return 402
- Limit value out of range may default or error
- OKX data unavailable for low-liquidity coins

## How this service works

Paid: /v1/verify, /v1/risk, /v1/receipt cost $0.01 USDC per call on Base mainnet via x402 (payTo 0x719227f384b66BFEF00093D6d8d32fA9dC2B40e7); utilities analyze Base mainnet (USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) by default, network=base-sepolia optional; /v1/receipt/verify and discovery files are free. Operator: Beggar Bot.

## Output

Returns a JSON array of long/short ratio data points from OKX, each including timestamp, long ratio, short ratio, and overall long/short ratio for the specified cryptocurrency and time period.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "coin": {
       "type": "string",
       "description": "e.g. BTC"
      },
      "limit": {
       "type": "string",
       "description": "points (48)"
      },
      "period": {
       "type": "string",
       "description": "5m, 1H or 1D"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/beggar-bot-okx-long-short-ratio-a20c7d25/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from beggar-bot-demand.beggarbot.workers.dev](https://www.zero.xyz/host/beggar-bot-demand.beggarbot.workers.dev/llms.txt)
