> ## 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 | 6 streams | [cabalspy-js](https://github.com/CabalSpy/cabalspy-js) |
| Python | `pip install cabalspy` | Full v1, sync and async | 6 streams | [cabalspy-python](https://github.com/CabalSpy/cabalspy-python) |
| Rust | `cabalspy = "0.1"` | 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).

## Quick start

<CodeGroup>
  ```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,
  });
  ```

  ```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
  )
  ```

  ```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(())
  }
  ```
</CodeGroup>

## 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));

await rt.connect();
rt.subscribe({ stream: 'tx', blockchain: 'solana', type: 'kol', token: '*' });
```

## More ways to integrate

<CardGroup cols={2}>
  <Card title="MCP server" icon="robot" href="/mcp-server">
    KOL and Smart Money data inside Claude, Cursor and VS Code.
  </Card>

  <Card title="x402 for AI agents" icon="coins" href="/x402">
    Pay per request in USDC, no account or API key.
  </Card>
</CardGroup>


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