简体   繁体   中英

Can you get any data from the Binance API without authentification?

I am using the Binance Futures API. I am using wrapper library python-binance.

I understand you won't be able to get personal data without authentication, but is there any data available publicly?

Where is this specified?

Yes there is. You can initialize Client() without any api key or secret ( documentation ):

import binance

client = binance.Client()
r = client.get_historical_klines('ETHBTC', client.KLINE_INTERVAL_1DAY, '1-Dec-2017', '1-Dec-2017')
print(r)

Output:

[[1512086400000, '0.04368400', '0.04432900', '0.04227500', '0.04239700', '83006.12100000', 1512172799999, '3596.96984104', 76803, '40633.85900000', '1761.03625471', '269562.18933427']]

If you don't want to use the python-binance wrapper, you can call the Binance API directly.

Check out the Binance API documentation . You can check the different security types and its authentication requirements here .

For example, you can retreive kline/candlestick data without authentication:

import requests

url = "https://api.binance.com/api/v3/klines?symbol=BTCUSDT&interval=15m"

payload={}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

The limits for the Binance API are tracked per IP address, and in every endpoint documentation, there is a weight attached to that call.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM