ccxt-python
Qué hace
Esta skill es una guía para crear funciones de exchanges de criptomonedas en proyectos Python con la biblioteca CCXT. Es para desarrolladores, analistas y creadores de bots que trabajan en Python.
Cuándo usarla
- ✓Cuando escribes código Python para obtener precios o historiales de criptomonedas para analizarlos.
- ✓Cuando necesitas colocar órdenes desde un bot de trading en Python.
- ✓Cuando quieres actualizaciones en directo de tickers o libros de órdenes en Python.
Link de la skill
https://github.com/ccxt/ccxt/blob/master/.claude/skills/ccxt-python/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Escribe un script en Python que obtenga el precio actual de BTC/USDT en Binance y lo muestre.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La IA instala el paquete ccxt con pip, crea un objeto de exchange y usa llamadas síncronas o asíncronas según la tarea.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
CCXT for Python
A comprehensive guide to using CCXT in Python projects for cryptocurrency exchange integration.
Installation
REST API (Standard)
pip install ccxt
WebSocket API (Real-time, ccxt.pro)
pip install ccxt
Optional Performance Enhancements
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
import ccxt
exchange = ccxt.binance()
exchange.load_markets()
ticker = exchange.fetch_ticker('BTC/USDT')
print(ticker)
REST API - Asynchronous
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
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 | Price monitoring, arbitrage detection |
When to use REST:
- Placing orders
- Fetching account balance
- One-time data queries
- Order management (cancel, fetch orders)
When to use WebSocket:
- Real-time price monitoring
- Live orderbook updates
- Arbitrage detection
- Portfolio tracking with live updates
Creating Exchange Instance
REST API - Synchronous
import ccxt
# Public API (no authentication)
exchange = ccxt.binance({
'enableRateLimit': True # Recommended!
})
# Private API (with authentication)
exchange = ccxt.binance({
'apiKey': 'YOUR_API_KEY',
'secret': 'YOUR_SECRET',
'enableRateLimit': True
})
REST API - Asynchronous
import ccxt.async_support as ccxt
exchange = ccxt.binance({
'apiKey': 'YOUR_API_KEY',
'secret': 'YOUR_SECRET',
'enableRateLimit': True
})
# Always close when done
await exchange.close()
WebSocket API
import ccxt.pro as ccxtpro
# Public WebSocket
exchange = ccxtpro.binance()
# Private WebSocket (with authentication)
exchange = ccxtpro.binance({
'apiKey': 'YOUR_API_KEY',
'secret': 'YOUR_SECRET'
})
# Always close when done
await exchange.close()
Common REST Operations
Loading Markets
# Load all available trading pairs
exchange.load_markets()
# Access market information
btc_market = exchange.market('BTC/USDT')
print(btc_market['limits']['amount']['min']) # Minimum order amount
Fetching Ticker
# Single ticker
ticker = exchange.fetch_ticker('BTC/USDT')
print(ticker['last']) # Last price
print(ticker['bid']) # Best bid
print(ticker['ask']) # Best ask
print(ticker['volume']) # 24h volume
# Multiple tickers (if supported)
tickers = exchange.fetch_tickers(['BTC/USDT', 'ETH/USDT'])
Fetching Order Book
# Full orderbook
orderbook = exchange.fetch_order_book('BTC/USDT')
print(orderbook['bids'][0]) # [price, amount]
print(orderbook['asks'][0]) # [price, amount]
# Limited depth
orderbook = exchange.fetch_order_book('BTC/USDT', 5) # Top 5 levels
Creating Orders
Limit Order
# Buy limit order
order = exchange.create_limit_buy_order('BTC/USDT', 0.01, 50000)
print(order['id'])
# Sell limit order
order = exchange.create_limit_sell_order('BTC/USDT', 0.01, 60000)
# Generic limit order
order = exchange.create_order('BTC/USDT', 'limit', 'buy', 0.01, 50000)
Market Order
# Buy market order
order = exchange.create_market_
Preguntas frecuentes
¿Cómo se instala?
La skill dice que hay que ejecutar pip install ccxt, que incluye soporte para REST y WebSocket.
¿Hay complementos para mejorar la velocidad?
La skill enumera paquetes opcionales como orjson, para analizar JSON más rápido, y coincurve, para firmar más rápido.
¿Hay que cerrar las conexiones asíncronas?
Sí. La skill dice que hay que cerrar la conexión del exchange al usar la versión asíncrona.
Detalles
Descripción original del autor
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.
repo: ccxt/ccxt
Popularidad
- Estrellas en GitHub
- 45 mil
- Posición en el ranking
- #6385
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
binance-agentic-wallet
45 milPermite que tu agente gestione una billetera Web3 de Binance mediante la línea de comandos baw, incluidos el inicio de sesión, los saldos, las transferencias, los intercambios de tokens y las órdenes límite.
binance-sports-ai-analyzer
45 milAyuda a tu agente a consultar predicciones de partidos del Mundial, análisis con IA y perspectivas de noticias, y a recalcular las probabilidades de victoria cuando cambias las señales.
binance-tokenized-securities-info
45 milPermite que tu agente consulte las acciones estadounidenses tokenizadas de Ondo en Binance Web3, incluyendo listas de tokens, información de empresas, estado de negociación y precios en cadena.
binance
45 milPermite que tu agente use Binance Spot, USD-M Futures y Convert mediante la herramienta binance-cli. Requiere que primero configures la autenticación.
Skills parecidas
api-connector-builder
280 milHace que tu agente cree nuevas conexiones de API siguiendo el patrón existente. Úsalo para añadir una integración más sin inventar otra forma de hacer las cosas.
api-design
280 milAyuda a tu agente a diseñar APIs REST según las buenas prácticas. Es útil para definir cómo se comunican las APIs, cómo se muestran los errores y cómo organizar los datos.
backend-patterns
280 milAyuda a tu agente con patrones de arquitectura del lado del servidor y optimización de bases de datos. Es útil para crear o revisar código que se ejecuta en el servidor.