
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
py-bingx
Advanced tools
Updated 1st Oct 2023
.. image:: https://img.shields.io/pypi/v/py-bingx.svg :target: https://pypi.python.org/pypi/py-bingx
.. image:: https://img.shields.io/pypi/l/py-bingx.svg :target: https://pypi.python.org/pypi/py-bingx
py-bingx is an unofficial Python wrapper for the BingX Perpetual Swap API <https://bingx-api.github.io/docs/swap/introduce.html>_.
I am not affiliated with BingX.
Register an account on BingX <https://bingx.com/en-us/register>_.
Create an API <https://bingx.com/en-us/account/api>_
and make sure you copy you Secret Key before leaving the page.
.. code:: bash
pip install py-bingx
.. code:: python
from bingx.api import BingxAPI
...
API_KEY = '<api_public_key>'
SECRET_KEY = '<api_secret_key>'
# It is faster and more efficient to use local timestamps. If you are getting an error try using "server" timestamp.
bingx = BingxAPI(API_KEY, SECRET_KEY, timestamp="local")
order_data = bingx.open_market_order('FLOKI-USDT', 'LONG', 121220, tp="0.00001800", sl="0.00001700")
py-bingx was written with the goal of being user-friendly. Feel free to ask your questions and state any bugs/issues with the code.
You can find the list of py-bingx functions below:
get_all_contracts() - Gets a list of all contracts/trading pairs available on Bingxget_latest_price(pair) - Gets the latest price for a trading pairget_market_depth(pair, limit) - Gets the order book depth data for a trading pairget_latest_trade(pair) - Gets recent trades for a trading pairget_latest_funding(pair) - Gets latest funding rate for a trading pairget_index_price(pair) - Gets index price for a trading pairget_market_price(pair) - Gets market price for a trading pairget_funding_history(pair) - Gets historical funding rate data for a trading pairget_kline_data(pair, interval, start_time, end_time, limit) - Gets candlestick/kline data for a trading pairget_open_positions(pair) - Gets open interest data for a trading pairget_tiker(pair) - Gets ticker data including 24hr prices and volumesget_current_optimal_price(pair) - Gets best bid and offer prices for a trading pairget_perpetual_balance() - Get user account balance infoget_my_perpetual_swap_positions(pair) - Get user open positions for a trading pairget_fee_rate() - Get fee rate for tradingopen_market_order() - Opens a market order to buy/sell a trading pairclose_market_order() - Closes an open market orderplace_trigger_market_order() - Places a stop-trigger market orderopen_limit_order() - Opens a limit order for a trading pairclose_limit_order() - Closes an open limit orderplace_trigger_limit_order() - Places a stop-trigger limit orderplace_trailing_stop_order() - Places a trailing stop orderplace_test_order() - Places a test order that does not executeclose_all_positions() - Closes all open positions for usercancel_order() - Cancels a pending ordercancel_all_orders_of_symbol() - Cancels all pending orders for a trading paircancel_batch_orders() - Cancels multiple pending ordersFAQs
BingX REST API Python implementation
We found that py-bingx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.