# Crypto Long/Short Ratio: Trader Positioning by Exchange (`scrapemint/crypto-long-short-ratio`) Actor

Crypto long/short ratio for BTC, ETH, SOL and any coin on OKX, Bitget and Gate: all accounts vs top traders, taker buy/sell, open interest and liquidations. Snapshot or history. No API key.

- **URL**: https://apify.com/scrapemint/crypto-long-short-ratio.md
- **Developed by:** [Ken M](https://apify.com/scrapemint) (community)
- **Categories:** Automation, Other
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Crypto Long/Short Ratio: Trader Positioning by Exchange

See how traders are positioned on **BTC, ETH, SOL and any coin** with a USDT perpetual on **OKX, Bitget and Gate**. Every row gives the **long/short ratio of all accounts**, the **top traders' account and position ratios**, the **long %** for each, and where the exchange publishes them, **taker buy/sell volume, open interest and long/short liquidations**. A `crowdVsTopTraders` flag marks when retail is crowded on one side while top traders lean the other way. No account, no API key.

### Why traders watch it

When most accounts are long but the biggest traders hold more short positions, the crowd is often the side that gets squeezed. Comparing the two across three exchanges at once is the quickest read on positioning before a move.

### What you get (one row per coin, exchange and time)

| Field | Meaning |
| --- | --- |
| `allAccountsRatio`, `allAccountsLongPct` | long accounts / short accounts, and % of accounts long |
| `topTraderAccountRatio`, `topTraderAccountLongPct` | the same for the exchange's top traders |
| `topTraderPositionRatio`, `topTraderPositionLongPct` | top traders' long vs short **position size** |
| `crowdVsTopTraders` | `crowd long, top traders short`, `crowd short, top traders long`, or `aligned` |
| `takerBuySellRatio`, `takerBuyVolume`, `takerSellVolume` | aggressive buying vs selling (OKX volumes, Gate ratio) |
| `openInterestUsd`, `longLiquidationsUsd`, `shortLiquidationsUsd`, `markPrice` | Gate |
| `exchange`, `symbol`, `market`, `period`, `time` | where and when |

### Example output

```json
{
  "exchange": "okx",
  "symbol": "BTC",
  "period": "1h",
  "time": "2026-11-27T21:00:00.000Z",
  "allAccountsRatio": 2.8382,
  "allAccountsLongPct": 73.95,
  "topTraderAccountRatio": 2.0914,
  "topTraderPositionRatio": 0.9014,
  "topTraderPositionLongPct": 47.41,
  "crowdVsTopTraders": "crowd long, top traders short",
  "takerBuySellRatio": 0.8695
}
```

### Input

| Field | Default | Notes |
| --- | --- | --- |
| `symbols` | BTC, ETH, SOL | any ticker with a USDT perpetual |
| `exchanges` | okx, bitget, gate | pick any |
| `period` | 1h | 5m, 15m, 1h, 4h, 1d |
| `mode` | snapshot | `snapshot` = latest completed period; `history` = past readings |
| `historyPoints` | 24 | up to 100 (Bitget returns about 30) |

Run snapshot mode on a schedule (every hour) to build your own positioning history, or use history mode for a one-off backfill.

### Pricing

- **$0.002 per snapshot row** (one coin on one exchange).
- **$0.0005 per history point.**
- The first row of every run is free. Coins an exchange does not list return a free note.

Ten coins on three exchanges every hour costs about 6 cents a run.

### FAQ

**Why not Binance or Bybit?** Both refuse requests from cloud servers (HTTP 451 and 403), so a scraper on Apify cannot read them reliably. OKX, Bitget and Gate answer every time.

**Do the exchanges define "top traders" the same way?** No. Each uses its own cutoff (largest accounts by margin or position size). Compare the direction and the change over time rather than the exact level across exchanges.

**Do I need an API key or proxy?** No.

### Related actors

- [Crypto Funding Rates & Open Interest Tracker](https://apify.com/scrapemint/crypto-funding-rates-tracker): what longs pay shorts on each exchange
- [Crypto Liquidations Tracker: Forced Long & Short Closeouts](https://apify.com/scrapemint/crypto-liquidations-tracker): who just got liquidated
- [Crypto Liquidation Map: Real Liquidation Levels (Hyperliquid)](https://apify.com/scrapemint/crypto-liquidation-map): where the next liquidations sit
- [Hyperliquid Data: Futures Prices, Funding Rates and Positions](https://apify.com/scrapemint/hyperliquid-data)

# Actor input Schema

## `symbols` (type: `array`):

Coin tickers such as BTC, ETH, SOL, XRP, DOGE. USDT perpetual futures are read on each exchange.

## `exchanges` (type: `array`):

Which exchanges to read. Binance and Bybit block cloud servers, so they are not offered.

## `period` (type: `string`):

Time bucket for each reading.

## `mode` (type: `string`):

Snapshot is one row per coin per exchange. History returns up to 100 past readings each.

## `historyPoints` (type: `integer`):

History mode only. Bitget returns about 30 points at most.

## `maxRows` (type: `integer`):

Stop after this many rows.

## Actor input object example

```json
{
  "symbols": [
    "BTC",
    "ETH",
    "SOL"
  ],
  "exchanges": [
    "okx",
    "bitget",
    "gate"
  ],
  "period": "1h",
  "mode": "snapshot",
  "historyPoints": 24,
  "maxRows": 2000
}
```

# Actor output Schema

## `results` (type: `string`):

Long/short ratios, top-trader positioning, taker volume, open interest and liquidations.

## `summary` (type: `string`):

Coins, exchanges, period and rows.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "symbols": [
        "BTC",
        "ETH",
        "SOL"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapemint/crypto-long-short-ratio").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "symbols": [
        "BTC",
        "ETH",
        "SOL",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("scrapemint/crypto-long-short-ratio").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "symbols": [
    "BTC",
    "ETH",
    "SOL"
  ]
}' |
apify call scrapemint/crypto-long-short-ratio --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapemint/crypto-long-short-ratio"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/oF9Fsh9PMs0hzUQWP/builds/LfCeDmtFdoBhV9Qbx/openapi.json
