python-okx
Python SDK for OKX
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires OKX API credentials (API key, secret, passphrase) obtained from your OKX account; Python >=3.7
- Low install friction with a pure-Python wheel distribution.
- Active maintenance status with a recent release (38 days ago).
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2026-07-07 (38 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 115,564 downloads/mo, #12,243 on PyPI
Alternatives
Verify before relying
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"
)- 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
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 on this page. Verify before relying on it.
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
python-okx on PyPI
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.
Requires OKX API credentials (API key, secret, passphrase) obtained from your OKX account; Python >=3.7
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"
)
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 | permissive license permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packageshttpxrequestswebsocketscertifiloguru |
| Maintenance | Actively maintained 38 days since the last release |
| First released | |
| Downloads | 115,564 / month, #12,243 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: python_okx-0.4.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “okx exchange api wrapper”
- python-okxUnofficial Python wrapper for the OKX exchange v5 API, providing REST…
- aioopenexchangeratesAsync client library for fetching currency exchange rates from the…
- krakenexProvides a minimal Python interface to the Kraken.com cryptocurrency…
Give your agent the search over MCP, or paste the wish link into any chat.
More Internet packages
Botocore provides low-level, data-driven access to Amazon Web Services APIs, serving as the foundation for the AWS CLI and boto3 libraries.
Install it if you need programmatic access to AWS services.
Provides an async client for AWS services using botocore and aiohttp, allowing you to call AWS APIs asynchronously within asyncio-based applications.
Install it if you need to call AWS services from async Python code; it is the standard way to do so.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides a platform-independent file locking mechanism to coordinate access to files across processes and threads.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides common Protocol Buffer message definitions used across Google Cloud APIs, enabling Python clients to interact with Google services.
See also python-binance · python-kraken-sdk · binance-connector · ccxt · hyperliquid-python-sdk · coinbase-advanced-py · pybit · tradingview-ta · tardis-client · kiteconnect