> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cabalspy.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# SDKs

> Official CabalSpy SDKs for TypeScript, Python and Rust: typed access to KOL, Smart Money and Whale wallet data, leaderboards, signals and real-time streams.

CabalSpy publishes official, open-source SDKs for TypeScript, Python and Rust. They wrap the v1 REST API with typed responses and pagination helpers, and reject impossible chain and wallet-type combinations before a request is sent, so a mistake costs no credits.

| Language | Install | REST | WebSocket | Source |
| - | - | - | - | - |
| TypeScript / JavaScript | `npm install cabalspy` | Full v1 | 7 streams | [cabalspy-js](https://github.com/CabalSpy/cabalspy-js) |
| Python | `pip install cabalspy` | Full v1, sync and async | 7 streams | [cabalspy-python](https://github.com/CabalSpy/cabalspy-python) |
| Rust | `cabalspy = "0.3"` | Full v1 | Not wrapped yet | [cabalspy-rust](https://github.com/CabalSpy/cabalspy-rust) |

All SDKs read your key from the `CABALSPY_API_KEY` environment variable. Get a free key in the [API Dashboard](https://apidashboard.cabalspy.xyz/register).

## Try without a key

Since TypeScript and Python 0.3.0 and Rust 0.2.0, every SDK can run on the [public demo](https://docs.cabalspy.xyz/demo.md): 20 requests per IP per day, data delayed 15 minutes, at most 5 rows per list. Each SDK raises a dedicated error when the daily budget is used up (`DemoLimitError`, `Error::DemoLimit`) and does not retry it.

```ts TypeScript theme={null}
const client = CabalSpy.demo();
const board = await client.wallets.leaderboard({ blockchain: 'solana', type: 'kol', period: '7d' });
console.log(client.lastDemo?.remaining_today);
```

```python Python theme={null}
client = CabalSpy.demo()
board = client.wallets.leaderboard(blockchain="solana", type="kol", period="7d")
print(client.last_demo)
```

```rust Rust theme={null}
let client = CabalSpy::demo()?;
```

## Quick start

```ts TypeScript theme={null}
import { CabalSpy } from 'cabalspy';

const client = new CabalSpy({ apiKey: process.env.CABALSPY_API_KEY });

// Who is this wallet? Searches every chain and wallet type.
const wallet = await client.wallets.lookup('DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK');

// Leaderboard of the best KOL wallets on Solana over 7 days
const board = await client.wallets.leaderboard({
  blockchain: 'solana', type: 'kol', period: '7d', limit: 25,
});

// Live cluster signals: 5+ KOLs buying the same token within an hour
const signals = await client.signals.list({
  blockchain: 'solana', type: 'kol', mode: 'cluster', min_wallets: 5, hours: 1,
});

// Our curated calls and how they performed (0.4.0 or later)
const calls = await client.calls.list({ blockchain: 'solana', tier: ['good', 'moderate'] });
const stats = await client.calls.stats({ period: '30d' });
```

```python Python theme={null}
from cabalspy import CabalSpy

client = CabalSpy()  # reads CABALSPY_API_KEY

# Who is this wallet? Searches every chain and wallet type.
wallet = client.wallets.lookup("As7HjL7dzzvbRbaD3WCun47robib2kmAKRXMvjHkSMB5")
print(wallet["name"], wallet["type"])

# Best KOL wallets on Solana over 7 days
board = client.wallets.leaderboard(blockchain="solana", type="kol", period="7d", limit=25)

# Live cluster signals: 5+ KOLs buying the same token within an hour
signals = client.signals.list(
    blockchain="solana", type="kol", mode="cluster", min_wallets=5, hours=1
)

# Our curated calls and how they performed (0.4.0 or later)
calls = client.calls.list(blockchain="solana", tier=["good", "moderate"])
stats = client.calls.stats(period="30d")
```

```rust Rust theme={null}
use cabalspy::{CabalSpy, Chain, LeaderboardOpts, Period, WalletType};

#[tokio::main]
async fn main() -> Result<(), cabalspy::Error> {
    let client = CabalSpy::from_env()?;   // reads CABALSPY_API_KEY

    let board = client.wallets().leaderboard(Chain::Solana, LeaderboardOpts {
        wallet_type: Some(WalletType::Kol),
        period: Some(Period::D7),
        limit: Some(25),
        ..Default::default()
    }).await?;
    Ok(())
}
```

## Real-time streams

The TypeScript and Python SDKs carry every stream over one socket and re-send your subscriptions after a reconnect. The Python SDK needs the extra `pip install "cabalspy[realtime]"`.

```ts TypeScript theme={null}
const rt = client.realtime();

rt.on('position_update', (msg) => console.log('trade', msg.data));
rt.on('signal',          (msg) => console.log('signal', msg.data));
rt.on('call',            (msg) => console.log('call', msg.data.tier_label, msg.data.token.symbol));

await rt.connect();
rt.subscribe({ stream: 'tx', blockchain: 'solana', type: 'kol', token: '*' });
rt.subscribe({ stream: 'call', tiers: ['good'] }); // every chain
```

## More ways to integrate

> [card] [MCP server](https://docs.cabalspy.xyz/mcp-server.md)
>
> KOL and Smart Money data inside Claude, Cursor and VS Code.

> [card] [x402 for AI agents](https://docs.cabalspy.xyz/x402.md)
>
> Pay per request in USDC, no account or API key.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.