skillfed

pybit

Python3 Bybit HTTP/WebSocket API Connector

pybit v5.17.0 310.6K downloads/30d#7,744 on PyPI666
Permissive license MIT License Active released

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 pybit

uv

uv add pybit

poetry

poetry add pybit

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Topic :: Software Development :: Libraries :: Python Modules

Tags

bybit api connector pythoncryptocurrency exchange api clientbybit trading api wrapperwebsocket trading clientbybit http api pythoncrypto trading automationbybit order management
trading-apicryptocurrencywebsocket

More Python Modules packages