मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)45k · #6385

ccxt-python

यह क्या करती है

यह स्किल CCXT लाइब्रेरी से Python प्रोजेक्ट में क्रिप्टो एक्सचेंज फ़ीचर बनाने की गाइड है। यह उन डेवलपर्स, विश्लेषकों और बॉट बनाने वालों के लिए है जो Python में काम करते हैं।

कब इस्तेमाल करें

  • ✓जब आप विश्लेषण के लिए क्रिप्टो कीमतें या इतिहास लाने वाला Python कोड लिख रहे हों।
  • ✓जब आपको Python ट्रेडिंग बॉट से ऑर्डर देने हों।
  • ✓जब आप Python में लाइव टिकर या ऑर्डर बुक अपडेट चाहें।

Skill का लिंक

https://github.com/ccxt/ccxt/blob/master/.claude/skills/ccxt-python/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/ccxt/ccxt/blob/master/.claude/skills/ccxt-python/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“एक Python स्क्रिप्ट लिखिए जो Binance से BTC/USDT की मौजूदा कीमत लाए और प्रिंट करे।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

AI pip से ccxt पैकेज इंस्टॉल करता है, एक एक्सचेंज ऑब्जेक्ट बनाता है, और काम के लिए sync या async कॉल इस्तेमाल करता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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_
अक्सर पूछे जाने वाले सवाल

यह कैसे इंस्टॉल होता है?

स्किल pip install ccxt चलाने को कहती है, जिसमें REST और WebSocket दोनों का सपोर्ट शामिल है।

क्या स्पीड बढ़ाने वाले ऐड-ऑन हैं?

हाँ। स्किल तेज़ JSON पार्सिंग के लिए orjson और तेज़ साइनिंग के लिए coincurve जैसे वैकल्पिक पैकेज सूचीबद्ध करती है।

क्या async कनेक्शन बंद करने होते हैं?

हाँ। async वर्ज़न इस्तेमाल करते समय स्किल एक्सचेंज कनेक्शन बंद करने को कहती है।

जानकारी

लेखक का मूल विवरण

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

लोकप्रियता

GitHub स्टार
45k
रैंकिंग में स्थान
#6385
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

binance-agentic-wallet

45k

आपके एजेंट को baw कमांड लाइन से Binance Web3 वॉलेट मैनेज करने देती है, जिसमें साइन-इन, बैलेंस, ट्रांसफ़र, टोकन स्वैप और लिमिट ऑर्डर शामिल हैं।

अन्यविविध

binance-sports-ai-analyzer

45k

आपके एजेंट को World Cup मैच की AI भविष्यवाणी, विश्लेषण और समाचार की जानकारी देखने में मदद करती है, और संकेत बदलने पर जीत की संभावना दोबारा गिनती है।

अन्यविविध

binance-tokenized-securities-info

45k

आपके एजेंट को Binance Web3 पर Ondo टोकनाइज़्ड अमेरिकी स्टॉक की जानकारी देखने देती है, जिसमें टोकन सूची, कंपनी की जानकारी, ट्रेडिंग स्थिति और ऑन-चेन कीमतें शामिल हैं।

डेटाएनालिसिस और स्प्रेडशीट

binance

45k

आपके एजेंट को binance-cli टूल के ज़रिए Binance Spot, USD-M Futures और Convert इस्तेमाल करने देती है। पहले ऑथेंटिकेशन सेट करना ज़रूरी है।

कोडिंगAPI और सर्वर (backend)

मिलती-जुलती skills