{"id":17377214,"url":"https://github.com/bybit-exchange/pybit","last_synced_at":"2025-02-27T06:30:32.618Z","repository":{"id":37809828,"uuid":"458126795","full_name":"bybit-exchange/pybit","owner":"bybit-exchange","description":"Official Python3 API connector for Bybit's HTTP and WebSockets APIs.","archived":false,"fork":true,"pushed_at":"2024-08-20T17:50:57.000Z","size":494,"stargazers_count":378,"open_issues_count":26,"forks_count":128,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-09-19T20:10:40.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"verata-veritatis/pybit","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bybit-exchange.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-02-11T09:44:18.000Z","updated_at":"2024-09-16T04:38:55.000Z","dependencies_parsed_at":"2023-02-15T10:40:50.937Z","dependency_job_id":"d5aec6cb-1413-423a-8f6a-2875b33e71a5","html_url":"https://github.com/bybit-exchange/pybit","commit_stats":{"total_commits":279,"total_committers":20,"mean_commits":13.95,"dds":0.4551971326164874,"last_synced_commit":"df32cc4326051d7ed0200f34959c283532cfb06c"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bybit-exchange%2Fpybit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bybit-exchange%2Fpybit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bybit-exchange%2Fpybit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bybit-exchange%2Fpybit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bybit-exchange","download_url":"https://codeload.github.com/bybit-exchange/pybit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219842822,"owners_count":16556560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-16T05:01:03.974Z","updated_at":"2024-10-16T05:02:44.899Z","avatar_url":"https://github.com/bybit-exchange.png","language":"Python","readme":"# pybit\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n[![Build Status](https://img.shields.io/pypi/pyversions/pybit)](https://www.python.org/downloads/)\n[![Build Status](https://img.shields.io/pypi/v/pybit)](https://pypi.org/project/pybit/)\n![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)\n\nOfficial Python3 API connector for Bybit's HTTP and WebSockets APIs.\n\n## Table of Contents\n\n- [About](#about)\n- [Development](#development)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Contact](#contact)\n- [Contributors](#contributors)\n- [Donations](#donations)\n\n## About\nPut simply, `pybit` (Python + Bybit) is the official lightweight one-stop-shop module for the Bybit HTTP and WebSocket APIs. Originally created by [Verata Veritatis](https://github.com/verata-veritatis), it's now maintained by Bybit employees – however, you're still welcome to contribute!\n\nIt was designed with the following vision in mind:\n\n\u003e 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.\n\n## Development\n`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.\n\n## Installation\n`pybit` requires Python 3.9.1 or higher. The module can be installed manually or via [PyPI](https://pypi.org/project/pybit/) with `pip`:\n```\npip install pybit\n```\n\n## Usage\nYou can retrieve a specific market like so:\n```python\nfrom pybit.unified_trading import HTTP\n```\nCreate an HTTP session and connect via WebSocket for Inverse on mainnet:\n```python\nsession = HTTP(\n    testnet=False,\n    api_key=\"...\",\n    api_secret=\"...\",\n)\n```\nInformation can be sent to, or retrieved from, the Bybit APIs:\n\n```python\n# Get the orderbook of the USDT Perpetual, BTCUSDT\nsession.get_orderbook(category=\"linear\", symbol=\"BTCUSDT\")\n\n# Create five long USDC Options orders.\n# (Currently, only USDC Options support sending orders in bulk.)\npayload = {\"category\": \"option\"}\norders = [{\n  \"symbol\": \"BTC-30JUN23-20000-C\",\n  \"side\": \"Buy\",\n  \"orderType\": \"Limit\",\n  \"qty\": \"0.1\",\n  \"price\": i,\n} for i in [15000, 15500, 16000, 16500, 16600]]\n\npayload[\"request\"] = orders\n# Submit the orders in bulk.\nsession.place_batch_order(payload)\n```\nCheck out the example python files or the list of endpoints below for more information on available\nendpoints and methods. Usage examples on the `HTTP` methods can\nbe found in the [examples folder](https://github.com/bybit-exchange/pybit/tree/master/examples).\n\n\n## Contact\nYou can reach out for support on the [BybitAPI Telegram](https://t.me/BybitAPI) group chat.\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/dextertd\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/54495183?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003edextertd\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/bybit-exchange/pybit/commits?author=dextertd\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/bybit-exchange/pybit/commits?author=dextertd\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/ervuks\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/17198438?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eervuks\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/bybit-exchange/pybit/commits?author=ervuks\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/bybit-exchange/pybit/commits?author=ervuks\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/verata-veritatis\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/9677388?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003everata-veritatis\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/bybit-exchange/pybit/commits?author=verata-veritatis\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/bybit-exchange/pybit/commits?author=verata-veritatis\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/APF20\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/74583612?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAPF20\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/bybit-exchange/pybit/commits?author=APF20\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/cameronhh\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/30434979?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eCameron Harder-Hutton\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/bybit-exchange/pybit/commits?author=cameronhh\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/tomcru\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/35841182?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTom Rumpf\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/bybit-exchange/pybit/commits?author=tomcru\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/sheungon\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/13306724?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eOnJohn\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/bybit-exchange/pybit/commits?author=sheungon\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/tconley\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/1893207?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTodd Conley\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/tconley/pybit/commits?author=tconley\" title=\"Ideas\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","funding_links":[],"categories":["Curated List"],"sub_categories":["API Integrations/Connectors"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbybit-exchange%2Fpybit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbybit-exchange%2Fpybit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbybit-exchange%2Fpybit/lists"}