CCXT cryptocurrency exchange library for Python developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in Python. Use when working with crypto exchanges in Python projects, trading bots, data analysis, or portfolio management. Supports both sync and async (asyncio) usage.
View on GitHubFebruary 5, 2026
Select agents to install to:
npx add-skill https://github.com/ccxt/ccxt/blob/0c7a01553eb8e9150ee5ac39bd64b3e9f0713955/.claude/skills/ccxt-python/SKILL.md -a claude-code --skill ccxt-pythonInstallation paths:
.claude/skills/ccxt-python/# CCXT for Python
A comprehensive guide to using CCXT in Python projects for cryptocurrency exchange integration.
## Installation
### REST API (Standard)
```bash
pip install ccxt
```
### WebSocket API (Real-time, ccxt.pro)
```bash
pip install ccxt
```
### Optional Performance Enhancements
```bash
pip install orjson # Faster JSON parsing
pip install coincurve # Faster ECDSA signing (45ms → 0.05ms)
```
Both REST and WebSocket APIs are included in the same package.
## Quick Start
### REST API - Synchronous
```python
import ccxt
exchange = ccxt.binance()
exchange.load_markets()
ticker = exchange.fetch_ticker('BTC/USDT')
print(ticker)
```
### REST API - Asynchronous
```python
import asyncio
import ccxt.async_support as ccxt
async def main():
exchange = ccxt.binance()
await exchange.load_markets()
ticker = await exchange.fetch_ticker('BTC/USDT')
print(ticker)
await exchange.close() # Important!
asyncio.run(main())
```
### WebSocket API - Real-time Updates
```python
import asyncio
import ccxt.pro as ccxtpro
async def main():
exchange = ccxtpro.binance()
while True:
ticker = await exchange.watch_ticker('BTC/USDT')
print(ticker) # Live updates!
await exchange.close()
asyncio.run(main())
```
## REST vs WebSocket
| Import | For REST | For WebSocket |
|--------|----------|---------------|
| **Sync** | `import ccxt` | (WebSocket requires async) |
| **Async** | `import ccxt.async_support as ccxt` | `import ccxt.pro as ccxtpro` |
| Feature | REST API | WebSocket API |
|---------|----------|---------------|
| **Use for** | One-time queries, placing orders | Real-time monitoring, live price feeds |
| **Method prefix** | `fetch_*` (fetch_ticker, fetch_order_book) | `watch_*` (watch_ticker, watch_order_book) |
| **Speed** | Slower (HTTP request/response) | Faster (persistent connection) |
| **Rate limits** | Strict (1-2 req/sec) | More lenient (continuous stream) |
| **Best for** | Trading, account management |