Skip to content

surister/huobi_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HUOBIPY

website website
This packages intents to be an idiomatic PythonApi wrapper for Huobi

Stars Badge

Contents:

Tutorial:

Project Info:

Current Services

  • REST API ❌
  • WEBSOCKET API ❌

REST API Endpoints

  • Reference Data ✔️

  • Market Data ✔️

  • Account ❌

  • Wallet ❌

  • Sub-User Management ❌

  • Trading ❌

  • Conditional Orders ❌

  • Margin Loan ❌

  • Stable Coin Exchange ✔️

WEBSOCKET API Endpoints

  • Market Data ❌
  • Account Data ❌
  • Orders ❌

How To Install

Examples

Prerequisites

  • You need a Secret Key and Access Key to the API provided by Huobi. Please do not publish your own keys and remember that once the key is created, the secret key will not be able to be consulted in the future, so save it.
  • If you are going to play with the sub users endpoints, check that you have, at least, one created. Click here to create one
  • To get started, you must have a HuobiClient instance with your Secret key and Access Key.
from huobi.rest.client import HuobiClient

client = HuobiClient(access_key= 'Your_Access_Key', secret_key='Your_Secret_Key')

Example 1 (Get Last Day Summary of Bitcoin in USDT)

req = client.get_last_day_market_summary(currency='btcusdt')
# Output
{"ch":"market.btcusdt.detail","status":"ok","ts":1642083312575,"tick":{"id":293383444638,"low":43320.23,"high":44355.58,"open":43754.74,"close":43997.15,"vol":2.6205615363949648E8,"amount":5988.949391700904,"version":293383444638,"count":523165}}

Example 2 (Get your own UserID)

req = client.get_uid()
# Output
{"code":200,"data":'Here will appear your UID',"ok":true}

Example 3 (Get most recent trade from Ethereum to USDT)

req = client.get_most_recent_trades(currency='ethusdt', size=1)
# Output
{"ch":"market.ethusdt.trade.detail","status":"ok","ts":1642083884643,"data":[{"id":144000086587,"ts":1642083884611,"data":[{"id":144000086587454187344074844,"ts":1642083884611,"trade-id":102351374009,"amount":0.0711,"price":3385.64,"direction":"buy"}]}]}

Getters In-Depth

Reference Data Getters:

Post In-Depth

Planned Features

  • Currency Enum
  • Candles Graphic Draw

Changelog

2022-01-07 - 2022-01-09

  • Add basic project structure
  • Add working API authentication
  • Add endpoint/request scheme
  • Add all market endpoints
  • Add some account & user endpoints
  • Add flake8 testing

2022-1-10 - 2022-01-17

  • Add reference data endpoints
  • Add wallet endpoints (GETS)
  • Add conditional orders endpoint (GETS)
  • Add trading endpoints (GETS)

About

Python 3 SDK/Wrapper for Huobi Crypto Exchange Api https://www.huobi.com/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages