<p>I had some trouble finding it there but then I found it in "reference"
<a href="https://github.com/huobiapi/API_Docs_en/wiki/REST_Reference" rel="nofollow noreferrer">https://github.com/huobiapi/API_Docs_en/wiki/REST_Reference</a></p>

<p>You can use normal http queries like on other exchanges so to get an orderbook you use this for example: <a href="https://api.huobi.pro/market/depth?symbol=ethbtc&amp;type=step1" rel="nofollow noreferrer">https://api.huobi.pro/market/depth?symbol=ethbtc&amp;type=step1</a></p>

CC BY-SA 3.0
2018-03-20T16:45:27.857Z
2018-03-20T16:45:27.857Z
Vitas
<p>To get the latest prices, you can use:</p>
<pre><code>https://api.huobi.pro/market/trade?symbol=btcusdt
</code></pre>
<blockquote>
<p>{&quot;ch&quot;:&quot;market.btcusdt.trade.detail&quot;,&quot;status&quot;:&quot;ok&quot;,&quot;ts&quot;:1636430996365,&quot;tick&quot;:{&quot;id&quot;:141243356294,&quot;ts&quot;:1636430996153,&quot;data&quot;:[{&quot;id&quot;:141243356294406904906517411,&quot;ts&quot;:1636430996153,&quot;trade-id&quot;:102555243865,&quot;amount&quot;:0.005594,&quot;price&quot;:68284.01,&quot;direction&quot;:&quot;buy&quot;}]}}</p>
</blockquote>
<p>To get the depth, you can use:</p>
<pre><code>https://api.huobi.pro/market/depth?symbol=btcusdt&amp;type=step1
</code></pre>
<blockquote>
<p>{&quot;ch&quot;:&quot;market.btcusdt.depth.step1&quot;,&quot;status&quot;:&quot;ok&quot;,&quot;ts&quot;:1636431051579,&quot;tick&quot;:{&quot;bids&quot;:[[68295.9,0.120818],[68293.2,0.2],[68290.5,0.04992],[68289.7,0.2],[68288.2,0.259111],[68288.1,0.1],[68287.5,0.01],[68287.2,0.120919],[68286.8,0.001464],[68285.0,0.2],[68283.8,0.002419],[68283.7,0.004837],[68281.4,0.2],[68280.2,0.00732],[68280.0,0.008036],[68278.4,0.015],[68277.0,0.004876],[68275.9,0.018194],[68275.8,0.073161],[68274.2,1.500967]],&quot;asks&quot;:[[68296.0,0.385628],[68296.1,0.014631],[68297.7,0.100889],[68298.0,0.005074],[68300.0,0.005185],[68300.2,0.4],[68301.5,0.073157],[68302.8,0.19],[68303.6,0.487816],[68305.5,0.1],[68307.7,0.4],[68307.9,1.11],[68308.4,0.0187],[68308.7,0.015],[68309.2,0.194342],[68310.3,1.121419],[68314.5,1.526117],[68315.8,0.11],[68317.8,0.146459],[68318.1,0.5]],&quot;version&quot;:141243384400,&quot;ts&quot;:1636431051004}}</p>
</blockquote>
<p>These APIs don't require API keys, but it has 10 calls / second limit.</p>

CC BY-SA 4.0
2021-11-09T04:13:20.423Z
2021-11-09T04:13:20.423Z
Dark.Passenger
<p>Huobi API documentation is <a href="https://huobiapi.github.io/docs/spot/v1/en/#introduction" rel="nofollow noreferrer">https://huobiapi.github.io/docs/spot/v1/en/#introduction</a></p>
<pre><code>import requests
import json

#Get Latest Aggregated Ticker, 
#retrieves the latest ticker with some important 24h aggregated market data
url = 'https://api.huobi.pro/market/detail/merged?symbol=ethusdt'
response = requests.request('GET', url)
r = json.loads(response.text)
r
</code></pre>
<p>To get all accounts, use endpoint GET /v1/account/accounts</p>
<pre><code>from datetime import datetime
import requests
import json
import hmac
import hashlib
import base64
from urllib.parse import urlencode

#Get all Accounts of the Current User
AccessKeyId = 'xxxxx-xxxxx-xxxxx-xxxxx'
SecretKey = 'xxxxx-xxxxx-xxxxx-xxxxx'
timestamp = str(datetime.utcnow().isoformat())[0:19]
params = urlencode({'AccessKeyId': AccessKeyId,
                    'SignatureMethod': 'HmacSHA256',
                    'SignatureVersion': '2',
                    'Timestamp': timestamp
                   })
method = 'GET'
endpoint = '/v1/account/accounts'
base_uri = 'api.huobi.pro'
pre_signed_text = method + '\n' + base_uri + '\n' + endpoint + '\n' + params
hash_code = hmac.new(SecretKey.encode(), pre_signed_text.encode(), hashlib.sha256).digest()
signature = urlencode({'Signature': base64.b64encode(hash_code).decode()})
url = 'https://' + base_uri + endpoint + '?' + params + '&amp;' + signature
response = requests.request(method, url)
accts = json.loads(response.text)
print(accts)
</code></pre>

CC BY-SA 4.0
2021-04-28T22:15:26.843Z
2021-04-28T22:15:26.843Z
blackraven
<p>I think this is the newest api on github</p>

<p><a href="https://github.com/huobiapi" rel="nofollow noreferrer">https://github.com/huobiapi</a></p>

CC BY-SA 3.0
2018-02-02T02:29:17.270Z
That doesn't appear to answer the question.
Mine
CC BY-SA 3.0
2018-02-05T04:29:38.700Z
@Mine this is the exact file that you can use to get data through websocket, it's on huobi's github https://github.com/huobiapi/WebSocket-API-demos/blob/master/Websocket-Python3-demo/huobi.py
Mingrui Jiang
CC BY-SA 3.0
2018-02-06T16:05:08.447Z
@Mingrui_Jiang technically he wasn't asking if there was a new one.  He was asking how to use it.
Mine
CC BY-SA 3.0
2018-02-08T08:18:50.750Z
Yes the API demos on within shows you exactly how to use it
Mingrui Jiang
CC BY-SA 3.0
2018-01-28T17:04:14.557Z
2018-01-28T17:04:14.557Z
Mingrui Jiang
<p>I'm looking for a simple API description to get some basic stats from the huobi.com exchange. Mainly the last trading price, and current orderbook (bids &amp; asks). </p>

<p>They seem to have an API: <a href="http://www.huobi.com/help/index.php?a=api_help" rel="noreferrer">http://www.huobi.com/help/index.php?a=api_help</a> but this page doesn't help me much (even after translating it with Google, as I can't read Chinese).</p>

<p>Does anyone know how to use this API?</p>

CC BY-SA 3.0
2016-06-12T01:20:52.693Z
Were you able to find any such API ?
Mandeep Singh
<api>
huobi.com API to get latest trade price, bids and asks?
Sheldon Pinkman
# huobi.com API to get latest trade price, bids and asks?

(Asked by: username_0 on 2014-02-15)

I'm looking for a simple API description to get some basic stats from the huobi.com exchange. Mainly the last trading price, and current orderbook (bids & asks).

They seem to have an API: <http://www.huobi.com/help/index.php?a=api_help> but this page doesn't help me much (even after translating it with Google, as I can't read Chinese).

Does anyone know how to use this API?

**Tags:** api

> **Comments:**
> **username_1**: Were you able to find any such API ?  

---

## 4 answers

### Answer by username_2 on 2018-03-20. Score: 4

I had some trouble finding it there but then I found it in "reference"
<https://github.com/huobiapi/API_Docs_en/wiki/REST_Reference>

You can use normal http queries like on other exchanges so to get an orderbook you use this for example: <https://api.huobi.pro/market/depth?symbol=ethbtc&type=step1>


---

### Answer by username_3 on 2021-11-09. Score: 0

To get the latest prices, you can use:
https://api.huobi.pro/market/trade?symbol=btcusdt


{"ch":"market.btcusdt.trade.detail","status":"ok","ts":1636430996365,"tick":{"id":141243356294,"ts":1636430996153,"data":[{"id":141243356294406904906517411,"ts":1636430996153,"trade-id":102555243865,"amount":0.005594,"price":68284.01,"direction":"buy"}]}}

To get the depth, you can use:
https://api.huobi.pro/market/depth?symbol=btcusdt&type=step1


{"ch":"market.btcusdt.depth.step1","status":"ok","ts":1636431051579,"tick":{"bids":[[68295.9,0.120818],[68293.2,0.2],[68290.5,0.04992],[68289.7,0.2],[68288.2,0.259111],[68288.1,0.1],[68287.5,0.01],[68287.2,0.120919],[68286.8,0.001464],[68285.0,0.2],[68283.8,0.002419],[68283.7,0.004837],[68281.4,0.2],[68280.2,0.00732],[68280.0,0.008036],[68278.4,0.015],[68277.0,0.004876],[68275.9,0.018194],[68275.8,0.073161],[68274.2,1.500967]],"asks":[[68296.0,0.385628],[68296.1,0.014631],[68297.7,0.100889],[68298.0,0.005074],[68300.0,0.005185],[68300.2,0.4],[68301.5,0.073157],[68302.8,0.19],[68303.6,0.487816],[68305.5,0.1],[68307.7,0.4],[68307.9,1.11],[68308.4,0.0187],[68308.7,0.015],[68309.2,0.194342],[68310.3,1.121419],[68314.5,1.526117],[68315.8,0.11],[68317.8,0.146459],[68318.1,0.5]],"version":141243384400,"ts":1636431051004}}

These APIs don't require API keys, but it has 10 calls / second limit.


---

### Answer by username_4 on 2021-04-28. Score: 0

Huobi API documentation is https://huobiapi.github.io/docs/spot/v1/en/#introduction
import requests
import json

#Get Latest Aggregated Ticker, 
#retrieves the latest ticker with some important 24h aggregated market data
url = 'https://api.huobi.pro/market/detail/merged?symbol=ethusdt'
response = requests.request('GET', url)
r = json.loads(response.text)
r

To get all accounts, use endpoint GET /v1/account/accounts
from datetime import datetime
import requests
import json
import hmac
import hashlib
import base64
from urllib.parse import urlencode

#Get all Accounts of the Current User
AccessKeyId = 'xxxxx-xxxxx-xxxxx-xxxxx'
SecretKey = 'xxxxx-xxxxx-xxxxx-xxxxx'
timestamp = str(datetime.utcnow().isoformat())[0:19]
params = urlencode({'AccessKeyId': AccessKeyId,
                    'SignatureMethod': 'HmacSHA256',
                    'SignatureVersion': '2',
                    'Timestamp': timestamp
                   })
method = 'GET'
endpoint = '/v1/account/accounts'
base_uri = 'api.huobi.pro'
pre_signed_text = method + '\n' + base_uri + '\n' + endpoint + '\n' + params
hash_code = hmac.new(SecretKey.encode(), pre_signed_text.encode(), hashlib.sha256).digest()
signature = urlencode({'Signature': base64.b64encode(hash_code).decode()})
url = 'https://' + base_uri + endpoint + '?' + params + '&' + signature
response = requests.request(method, url)
accts = json.loads(response.text)
print(accts)


---

### Answer by username_5 on 2018-01-28. Score: -2

I think this is the newest api on github

<https://github.com/huobiapi>

> **Comments:**
> **username_6**: That doesn't appear to answer the question.  
> **username_5**: @username_6 this is the exact file that you can use to get data through websocket, it's on huobi's github https://github.com/huobiapi/WebSocket-API-demos/blob/master/Websocket-Python3-demo/huobi.py  
> **username_6**: @Mingrui_Jiang technically he wasn't asking if there was a new one.  He was asking how to use it.  
> **username_5**: Yes the API demos on within shows you exactly how to use it  

---

