Skip to main content

pybit

All Contributors

Build Status Build Status contributions welcome

Official Python3 API connector for Bybit's HTTP and WebSockets APIs.

Table of Contents

About

Put simply, pybit (Python + Bybit) is the official lightweight one-stop-shop module for the Bybit HTTP and WebSocket APIs. Originally created by Verata Veritatis, it's now maintained by Bybit employees – however, you're still welcome to contribute!

It was designed with the following vision in mind:

I was personally never a fan of auto-generated connectors that used a mosh-pit of various modules you didn't want (sorry, bravado) and wanted to build my own Python3-dedicated connector with very little external resources. The goal of the connector is to provide traders and developers with an easy-to-use high-performing module that has an active issue and discussion board leading to consistent improvements.

Development

pybit is being actively developed, and new Bybit API changes should arrive on pybit very quickly. pybit uses requests and websocket-client for its methods, alongside other built-in modules. Anyone is welcome to branch/fork the repository and add their own upgrades. If you think you've made substantial improvements to the module, submit a pull request and we'll gladly take a look.

Installation

pybit requires Python 3.10 or higher. The module can be installed manually or via PyPI with pip:

pip install pybit

Usage

You can retrieve a specific market like so:

from pybit.unified_trading import HTTP

Create an HTTP session and connect via WebSocket for Inverse on mainnet:

session = HTTP(
    testnet=False,
    api_key="...",
    api_secret="...",
)

Information can be sent to, or retrieved from, the Bybit APIs:

# Get the orderbook of the USDT Perpetual, BTCUSDT
session.get_orderbook(category="linear", symbol="BTCUSDT")

# Create five long USDC Options orders.
# (Currently, only USDC Options support sending orders in bulk.)
payload = {"category": "option"}
orders = [{
  "symbol": "BTC-30JUN23-20000-C",
  "side": "Buy",
  "orderType": "Limit",
  "qty": "0.1",
  "price": i,
} for i in [15000, 15500, 16000, 16500, 16600]]

payload["request"] = orders
# Submit the orders in bulk.
session.place_batch_order(payload)

P2P HTTP methods are available from the same unified trading session:

session.get_account_information()
session.get_ads_list()

Check out the example python files or the list of endpoints below for more information on available endpoints and methods. Usage examples on the HTTP methods can be found in the examples folder.

Contact

Reach out for support on your chosen platform:

Contributors

Thanks goes to these wonderful people (emoji key):


dextertd

💻 📖

ervuks

💻 📖

verata-veritatis

💻 📖

APF20

💻

Cameron Harder-Hutton

💻

Tom Rumpf

💻

OnJohn

💻

Todd Conley

🤔

Kolya

💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Release files for pybit 5.17.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybit 5.17.0
File Size Uploaded
pybit-5.17.0.tar.gz 71.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pybit 5.17.0
File Interpreter ABI Platform
pybit-5.17.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 135.1 kB

Release files / pybit-5.17.0.tar.gz

Download URL pybit-5.17.0.tar.gz
Size 71.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6ac46f4567c37c25bd7bd079b060535c9f1e02cd7a909dc72615ec63462d2c20
BLAKE2b-256 checksum
How to use checksums
037d56cdcab656ee8579a261c956679eb5049a0a7635d106aa2aaf1338419d93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release files / pybit-5.17.0-py2.py3-none-any.whl

Download URL pybit-5.17.0-py2.py3-none-any.whl
Size 63.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
bb5aba81f74dc3ebe9b3dd803183a8749eec28f0eb1195cbf5846cda983a1a7d
BLAKE2b-256 checksum
How to use checksums
23db2a671fa36488cda2c00d53f6f9938ef268bfa013a501cde277999a6ba47f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

5.17.0 This release

2 release files

5.16.0

2 release files

5.15.0

2 release files

5.14.0

1 release file

5.13.0

1 release file

5.12.0

1 release file

5.11.0

1 release file

5.10.1

1 release file

5.10.0

1 release file

5.9.0

1 release file

5.8.0

1 release file

5.7.0

1 release file

5.6.2

1 release file

5.6.1

1 release file

5.6.0

1 release file

5.5.0

1 release file

5.4.0

1 release file

5.3.0

1 release file

5.2.0

1 release file

5.1.1

1 release file

5.1.0

1 release file

5.0.0

1 release file

2.4.1

1 release file

2.4.0

1 release file

2.3.1

1 release file

2.3.0

1 release file

2.2.3

1 release file

2.2.2

1 release file

2.2.1

1 release file

2.2.0

1 release file

2.1.2

1 release file

2.1.1

1 release file

2.1.0

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.3.6

1 release file

1.3.5

1 release file

1.3.4

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.20

1 release file

1.1.18

1 release file

1.1.17

1 release file

1.1.16

1 release file

1.1.15

1 release file

1.1.14

1 release file

1.1.13

1 release file

1.1.12

1 release file

1.1.11

1 release file

1.1.10

1 release file

1.1.9

1 release file

1.1.8

1 release file

1.1.7

1 release file

1.1.6

1 release file

1.1.5

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page