--- id: python-okx version: "0.4.3" license: unclear license_treatment: permissive maintenance: active --- # python-okx — Python SDK for OKX License: permissive · Maintenance: active · Downloads: 115.6K/mo ## What it is and what it does python-okx is an unofficial Python client library for trading on the OKX cryptocurrency exchange. It wraps OKX's v5 REST API and WebSocket endpoints, allowing you to execute spot and derivatives trades, query account balances, retrieve market data, and manage orders programmatically. The library handles both public (market data) and private (authenticated trading) operations, with support for live trading and testnet/demo environments. The package provides a straightforward object-oriented interface—you instantiate API classes like Account or Trade with your credentials, then call methods to interact with the exchange. It includes WebSocket support with automatic reconnection and connection multiplexing for real-time data streams. Dependencies are lightweight and standard (httpx, requests, websockets, certifi, loguru), making it straightforward to integrate into trading bots, portfolio dashboards, or research scripts. Use it for: - Build automated spot trading bots that execute buy/sell orders based on market conditions or signals - Retrieve real-time market data and order book snapshots via WebSocket for technical analysis - Manage derivatives positions (futures, perpetuals) programmatically with leverage and risk controls - Monitor account balances, positions, and trading history for portfolio tracking dashboards - Test trading strategies on OKX testnet before deploying to live trading with flag parameter ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Unofficial Python wrapper for the OKX exchange v5 API, providing REST and WebSocket access to spot and derivatives trading, account management, and market data. Yes, if you trade on OKX and need programmatic access. The package is actively maintained, has low install friction, carries no known security vulnerabilities, and is licensed permissively. Verify that its API endpoint coverage matches your trading needs and that WebSocket reconnection behavior suits your use case before deploying to production. ## Install pip install python-okx uv add python-okx poetry add python-okx ## Installing python-okx Before you install: Low install friction with a pure-Python wheel distribution. Active maintenance status with a recent release (38 days ago). Depends on common libraries: httpx, requests, websockets, certifi, and loguru. License in practice: MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install python-okx from okx import Account account = Account.AccountAPI( api_key="your-api-key", api_secret_key="your-api-secret", passphrase="your-passphrase", flag="1" ) Requires OKX API credentials (API key, secret, passphrase) obtained from your OKX account; Python >=3.7 Verify before relying: - Whether WebSocket reconnection and multiplexing are production-ready or still experimental - Performance characteristics under high-frequency trading or large order volumes - Completeness of API endpoint coverage relative to the latest OKX v5 API specification ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 115.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags okx exchange api wrapper, cryptocurrency trading sdk, okx rest websocket client, spot and derivatives trading, okx market data api, trading-api, cryptocurrency, websocket [View on SkillFed](https://skillfed.io/packages/python-okx) · [View on PyPI](https://pypi.org/project/python-okx/)