Metadata-Version: 2.5
Name: copytop
Version: 0.1.0
Summary: Python client for copy.top (https://copy.top): what top fomo, pumpfun and Hyperliquid traders buy and sell. Read-only, no key needed.
Project-URL: Homepage, https://copy.top
Project-URL: Documentation, https://copy.top/agents
Project-URL: API, https://copy.top/v1/openapi.json
Project-URL: MCP server, https://copy.top/mcp
Project-URL: Developers, https://copy.top/developers
Author-email: "copy.top" <ana@copy.top>
Maintainer-email: "copy.top" <ana@copy.top>
License-Expression: MIT
License-File: LICENSE
Keywords: api client,copy trading,copy.top,copytop,crypto,fomo,hyperliquid,leaderboard,mcp,memecoins,pump.fun,pumpfun,smart money,solana,top traders,trading signals,whale tracker
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# copytop: Python client for copy.top

**[copy.top](https://copy.top)** tracks what top traders buy and sell on fomo, pumpfun and Hyperliquid, and lets people copy them. This package is the official Python client for the copy.top API: the trader leaderboard, a trader's profile, the coins top traders are buying now, money flow, live trades, alerts and Hyperliquid markets, in a few lines of Python.

- Read-only: nothing here places an order.
- No key needed. Pure Python, no dependency, Python 3.9 or later.
- Every call returns the JSON answer of [https://copy.top/v1](https://copy.top/v1/openapi.json) as a dict.

Site: [https://copy.top](https://copy.top) | Docs for developers and AI agents: [https://copy.top/agents](https://copy.top/agents) | OpenAPI: [https://copy.top/v1/openapi.json](https://copy.top/v1/openapi.json)

## Install

```
pip install copytop
```

## Examples

**1. Coins top traders are buying right now**

```python
from copytop import Client, coin_url

ct = Client()
for c in ct.hot_coins(window="1h", limit=5)["coins"]:
    print(c["symbol"], c["topTraders"], "top traders,", c["boughtUsd"], "usd bought", coin_url(c["chain"], c["token"]))
```

**2. The 7 day leaderboard of pumpfun traders, clean fair play only**

```python
for t in ct.traders(window="7d", platform="pumpfun", fair_play="clean", limit=10)["traders"]:
    print(t["handle"], t["pnl"], t["roi"], t["url"])
```

**3. Look up a trader or a coin by name, $ticker or address**

```python
found = ct.search("$BONK")
profile = ct.trader(found["traders"][0]["handle"])
print(profile["trader"]["pnl"], profile["open_positions"][:3])
```

**4. An alert bot in five lines** (several top traders on one coin, or a big trade)

```python
for event in ct.watch_alerts(kinds=["confluence", "big_trade"], min_top_traders=3, interval=60):
    print(event["kind"], event.get("symbol"), event["url"])
```

**5. Hyperliquid: top perps traders and markets**

```python
whales = ct.hl_traders(window="30d", sort="pnl", limit=5)["traders"]
stocks = ct.hl_markets(category="stocks", limit=10)["markets"]
btc = ct.hl_market("BTC")          # technicals, funding, open interest, what top traders hold
```

## Command line

The package installs a `copytop` command (also `python -m copytop`):

```
copytop hot --window 1h
copytop traders --window 7d --platform pumpfun --clean
copytop trader <handle>
copytop coin solana <address>
copytop alerts --watch --kinds confluence
copytop hl-markets --category stocks
```

Add `--json` to any command for raw JSON.

## Methods

| method | route | what it returns |
|---|---|---|
| `traders(window, sort, chain, platform, fair_play, limit)` | `GET /traders` | trader leaderboard (fomo and pumpfun), like [copy.top/traders](https://copy.top/traders) |
| `trader(handle)` | `GET /traders/{handle}` | one trader: pnl 30d, roi, win rate, fair play, positions, latest trades |
| `search(query)` | `GET /search` | traders and coins by name, @handle, $ticker or address |
| `hot_coins(window, max_mcap_usd, limit)` | `GET /coins/hot` | coins tracked traders are buying now |
| `hot_index(window, chain, limit)` | `GET /coins/index` | coins ranked 0 to 100 by attention |
| `money_flow(side, window, limit)` | `GET /coins/flow` | coins ranked by dollars bought or sold |
| `dex_paid(limit)` | `GET /coins/dex-paid` | coins whose team paid for a dexscreener profile in the last 24 h |
| `coin(chain, address)` | `GET /coins/{chain}/{address}` | one coin: price, market cap, which tracked traders hold or sold it |
| `trades(since, side, min_usd, limit)` | `GET /trades` | the live tape of buys and sells, with a cursor |
| `alerts(since, min_top_traders, min_trade_usd, max_mcap_usd, kinds, limit)` | `GET /alerts` | confluence, big trade and thesis events since a cursor |
| `watch_alerts(interval, **filters)` | `GET /alerts` in a loop | a generator of new events, cursor handled for you |
| `theses(sort, hours, limit)` | `GET /theses` | theses posted by tracked traders |
| `hl_traders(window, sort, limit)` | `GET /hyperliquid/traders` | Hyperliquid traders ranked by pnl or roi |
| `hl_trader(address)` | `GET /hyperliquid/traders/{address}` | one Hyperliquid trader: metrics, positions, fills |
| `hl_markets(category, limit)` | `GET /hyperliquid/markets` | live Hyperliquid markets (crypto, stocks, indices, fx) |
| `hl_market(coin)` | `GET /hyperliquid/markets/{coin}` | copy.top's read of one Hyperliquid market |
| `hl_calls(coin)` | `GET /hyperliquid/markets/{coin}/calls` | analyst calls on one Hyperliquid market and their track record |

Page links: `trader_url(handle)`, `coin_url(chain, address)`, `hl_trader_url(address)` and `hl_market_url(coin)` give the matching page on copy.top.

Chains: `solana`, `base`, `bnb`, `eth`, `robinhood`, `arc`. A handle starting with `pf_` is a pumpfun account; the others are fomo traders.

## Limits, API key and errors

The API is open without a key, at about 20 calls a minute per IP (about 6 a minute for search, trader and coin). A free key from [https://copy.top/account#api](https://copy.top/account#api) raises the limits:

```python
ct = Client(api_key="...")      # or set COPYTOP_API_KEY
```

Answers 429 and 5xx are retried with backoff (`max_retries=3`, honours `Retry-After`). Errors raise `copytop.CopyTopError`, with `NotFoundError` (404), `RateLimitError` (429) and `AuthError` (401) as subclasses.

## Also from copy.top

- MCP server for AI agents (Claude, ChatGPT, Cursor): `https://copy.top/mcp`, see [https://copy.top/agents](https://copy.top/agents)
- npm CLI: `npx copytop hot`
- Web app: [https://copy.top](https://copy.top)

## About

copy.top is independent and is not affiliated with fomo, pump.fun or Hyperliquid. Figures are data, not advice. Trading crypto is risky and past performance does not predict results.

Contact: ana@copy.top. License: MIT.
