pybit
Python3 Bybit HTTP/WebSocket API Connector
What it is and what it does
pybit is the official lightweight Python connector for Bybit's HTTP and WebSocket APIs, designed to give traders and developers direct access to Bybit's market data, trading, account management, and P2P endpoints. It wraps Bybit's HTTP and WebSocket interfaces using requests and websocket-client, avoiding the overhead of auto-generated connectors. The module is actively maintained by Bybit employees and supports both testnet and mainnet environments, with a unified session object that handles both HTTP requests and WebSocket subscriptions.
You use it by instantiating an HTTP session with your API credentials, then calling methods like get_orderbook(), place_batch_order(), or get_account_information() to retrieve data or submit orders. It supports multiple trading categories (linear perpetuals, inverse perpetuals, spot, options) and P2P operations, with examples provided for common workflows like bulk order placement and market data retrieval.
Use it for:
- Automate order placement and management across Bybit's perpetual, spot, and options markets.
- Stream real-time market data and order updates via WebSocket for algorithmic trading strategies.
- Build a trading bot that monitors the orderbook and executes conditional trades programmatically.
- Retrieve account balances, positions, and trade history for portfolio tracking and reconciliation.
- Execute bulk operations, such as placing multiple options orders in a single batch request.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pybit is the official Python connector for Bybit's HTTP and WebSocket APIs, enabling traders and developers to interact with Bybit's trading, account, and P2P endpoints.
Yes. pybit is the official Bybit API connector, actively maintained, with low install friction and permissive licensing. It has no known vulnerabilities, supports current Python versions (3.10+), and is designed specifically for traders and developers integrating with Bybit. Install it if you need to programmatically trade or monitor accounts on Bybit.
Install
pybit on PyPI
pip
pip install pybituv
uv add pybitpoetry
poetry add pybitInstalling pybit
Before you install
Low friction: pure-Python wheel with three common runtime dependencies (requests, websocket-client, pycryptodome). Actively maintained with a release within the last month; last commit on 2026-07-30 and 666 repository stars indicate ongoing development.
License in practice
MIT License (permissive) — you can use, modify, and distribute pybit freely in commercial and private projects with minimal restrictions.
Quickstart
pip install pybit
from pybit.unified_trading import HTTP
session = HTTP(testnet=False, api_key="...", api_secret="...")
orderbook = session.get_orderbook(category="linear", symbol="BTCUSDT")
Requires Python 3.10 or higher; Bybit API credentials (api_key and api_secret) needed for authenticated requests.
Verify before relying
- Whether all Bybit API endpoints are currently supported or if there are known gaps in coverage.
- Performance characteristics under high-frequency or bulk-order scenarios beyond the USDC Options example.
- WebSocket reconnection and error-handling behavior during network interruptions.
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — requests, websocket-client, pycryptodome |
| Maintenance | actively maintained — 31 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 310,602/month — #7,744 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pybit-5.17.0-py2.py3-none-any.whl
Keywords: bybit, api, connector
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
binance-connectorConnects Python applications to Binance's…
permissive · top 15,000 on PyPI
python-binanceUnofficial Python wrapper for the Binance…
permissive · top 15,000 on PyPI
coinbase-advanced-pyOfficial Python SDK for the Coinbase Advanced…
permissive · top 15,000 on PyPI
py-clob-clientPython client library for trading on…
permissive · top 15,000 on PyPI
python-kraken-sdkProvides REST and WebSocket clients for trading…
permissive · top 15,000 on PyPI
ccxtCCXT is a unified API library for connecting to…
permissive · top 5,000 on PyPI
alpaca-pyAlpaca-py is the official Python SDK for…
permissive · top 5,000 on PyPI
python-okxUnofficial Python wrapper for the OKX exchange…
permissive · top 15,000 on PyPI
kiteconnectOfficial Python client for the Kite Connect…
permissive · top 15,000 on PyPI
fyers-apiv3Official Python client library for the Fyers…
permissive · top 15,000 on PyPI