{"id":25833027,"url":"https://github.com/niewiemczego/python-bingx","last_synced_at":"2025-02-28T22:39:42.456Z","repository":{"id":143193942,"uuid":"614497627","full_name":"niewiemczego/python-bingx","owner":"niewiemczego","description":"Unofficial Python3 API connector for BingX's HTTP and WebSockets APIs.","archived":false,"fork":false,"pushed_at":"2024-04-02T16:01:40.000Z","size":101,"stargazers_count":11,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T00:37:30.476Z","etag":null,"topics":["api","bingx","cryptocurrency","exchange","python","python3","websockets"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/python-bingx/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niewiemczego.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-15T17:50:47.000Z","updated_at":"2024-12-29T06:31:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"f292c224-1ed6-4abf-89f8-3ffda0ea6abd","html_url":"https://github.com/niewiemczego/python-bingx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niewiemczego%2Fpython-bingx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niewiemczego%2Fpython-bingx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niewiemczego%2Fpython-bingx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niewiemczego%2Fpython-bingx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niewiemczego","download_url":"https://codeload.github.com/niewiemczego/python-bingx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241261386,"owners_count":19936017,"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":["api","bingx","cryptocurrency","exchange","python","python3","websockets"],"created_at":"2025-02-28T22:39:41.759Z","updated_at":"2025-02-28T22:39:42.440Z","avatar_url":"https://github.com/niewiemczego.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python-BingX\n\nPython-bingx is a powerful and flexible Python package that allows you to easily interact with the BingX API. The package currently supports the Spot API, Standard API, Perpetual Swap API Reference V1, and Perpetual Swap API Reference V2. With python-bingx, you can retrieve real-time market data, manage your account, place trades, and more...\n\n# Installation\n\nTo install python-bingx, you can use pip:\n\n```python\npip install python-bingx\n```\n\n# Usage\n\nThere are multiple ways to use python-bingx, depending on your needs and preferences.\n\n### Using BingX\n\nThe most straightforward way to use python-bingx is by importing the `BingX` class and initializing it with your API key and secret key:\n\n```python\nfrom bingX import BingX\n\nbingx_client = BingX(api_key=\"api_key\", secret_key=\"secret_key\")\n```\n\nOnce you have initialized the client, you can call any of the available APIs, for example:\n\n```python\n# Call the Trade API of Perpetual V2\nbingx_client.perpetual_v2.trade.trade_order()\n```\n\n### Using PerpetualV2\n\nIf you prefer to work with a specific API or version, you can import the relevant class and initialize it with your API key and secret key:\n\n```python\nfrom bingX.perpetual.v2 import PerpetualV2\n\nbingx_client = PerpetualV2(api_key=\"api_key\", secret_key=\"secret_key\")\n```\n\nOnce you have initialized the client, you can call any of the available APIs, for example:\n\n```python\n# Call the Trade API of Perpetual V2\nbingx_client.trade.trade_order()\n```\n\n# Handling Responses\n\nPython-bingx uses requests library to communicate with the API and returns the response in JSON format. You can easily handle the response by accessing the relevant key(s) in the dictionary, for example:\n\n```python\n# Get the symbol and last price of BTC/USDT\nresponse = bingx_client.perpetual_v2.market.get_ticker(\"BTC-USDT\")\nsymbol = response[\"symbol\"]\nlast_price = response[\"lastPrice\"]\n```\n\n# Error Handling\n\nIn case of errors or exceptions, python-bingx will raise relevant exceptions with error message and error code. You can catch and handle the exceptions accordingly, for example:\n\n```python\nfrom bingX import ClientError, ServerError\n\ntry:\n    response = bingx_client.perpetual_v2.trade.create_order()\nexcept (ClientError, ServerError) as e:\n    error_code = e.error_code\n    error_message = e.error_message\n```\n\n# Contributing\n\nPython-bingx welcomes contributions from the community! If you'd like to contribute, please fork the repository, create a feature branch, make your changes, and submit a pull request. Before submitting, please ensure that your code follows the PEP 8 style guide and includes appropriate tests.\n\n# License\n\nPython-bingx is licensed under the MIT License. See the LICENSE file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniewiemczego%2Fpython-bingx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniewiemczego%2Fpython-bingx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniewiemczego%2Fpython-bingx/lists"}