Skip to main content

Welcome to Bhex-Python

An official Python implementation of the lastest Open API for Bhex.

Install

pip install bhex

Usage

REST API

Init bhex client:

b = BhexClient(api_key='', secret='')

Request with proxies:

proxies = {
  "http": "http://ip:port",
  "https": "http://ip:port",
}

b = BhexClient(api_key='', secret='', proxies=proxies)

Web Socket

Init

Init bhex websocket client:

client = BhexWss(api_key='', secret='')
Subscribe

Subscribe trades:

client.subscribe_to_trades(symbol='BTCUSDT', callback=handler)

Subscribe Kline/Candlestick:

client.subscribe_to_kline(symbol='BTCUSDT', interval='5m', callback=handler)

Subscribe market tickers:

client.subscribe_to_realtimes(symbol='BTCUSDT,ETHUSDT', callback=handler)

Subscribe book depth tickers:

client.subscribe_to_depth(symbol='BTCUSDT', callback=handler)

Subscribe user data:

client.user_data_stream(callback=handler)
Start

Start websocket thread

client.start()

API List

Public API

ping

b.ping()

time

b.time()

broker info

b.broker_info()

depth

b.depth('BTCUSDT')

trades

b.trades('BTCUSDT')

klines

b.klines('BTCUSDT')

ticker 24hr

b.ticker_24hr('BTCUSDT')

Private API

new order

 b.order_new(symbol='BTCUSDT', side='BUY', type='LIMIT', quantity='0.01', price='1000', timeInForce='GTC')

get order

b.order_get(order_id='')

cancel order

b.order_cancel(order_id='')

open orders

b.open_orders()

history orders

b.history_orders()

account

b.account()

my trades

b.my_trades()

deposit orders

b.deposit_orders()

Metadata

Release files for bhex 1.0.7

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

Source distribution (sdist)

Source distribution for bhex 1.0.7
File Size Uploaded Provenance Actions
bhex-1.0.7.tar.gz 5.5 kB Without provenance Details for bhex-1.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bhex 1.0.7
File Interpreter ABI Platform Actions
bhex-1.0.7-py3-none-any.whl Python 3 none any Details for bhex-1.0.7-py3-none-any.whl

Total release size: 11.9 kB

Release files / bhex-1.0.7.tar.gz

Download URL bhex-1.0.7.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
59bec5e02db176ed814d3b1755ae8f2d3c0891162e765e59972e013b40a7b76e
BLAKE2b-256 checksum
How to use checksums
0191981660b122c5a3ff22c7e56c2e3df10d9599736376e1ae3b9e75fd4f6f25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

Release files / bhex-1.0.7-py3-none-any.whl

Download URL bhex-1.0.7-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5619a0f1cdcd15bd96c509488ec44d01b214c258db376891a9f4fd61d0316d2b
BLAKE2b-256 checksum
How to use checksums
e33da3dcc864b79632812ee45a1ece2805202ed8c60ebb8dc81138b9a8f22c53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

Security for bhex 1.0.7

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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