So I'm a newer beginning program in Python. I've been trying to piece together a program and I'm using the Python-Binance wrapper, but I can't figure out how to exactly enter in this parameter to get me return information in here.
I'm trying to get information for a coin pairing called ADAETH for an example. this is the line, but I can't figure the syntax for calling this. I feel like I'm missing something obvious here.
get_order_book(**params) Get the Order Book for the market
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#order-book
Parameters: •symbol (str) – required •limit (int) – Default 100; max 1000
Returns:
API response
"lastUpdateId": 1027024,
"bids": [
[
"4.00000000", # PRICE
"431.00000000", # QTY
[] # Can be ignored
]
],
"asks": [
[
"4.00000200",
"12.00000000",
[]
]
]
If you are new in python I'm sure you'll appreciate this advice: Install Anaconda it comes with and IDE called Spyder that is really useful. I'm not sure why you are using that Library, but i recommend using this one instead https://github.com/sammchardy/python-binance this one is the official. To install the binance library use this command in the conda promt
pip install python-binance
then you can use this code in a .py file (use spyder to create that)
from binance.client import Client
api_key =
api_secret =
client = Client(api_key, api_secret)
orders=client.get_order_book(symbol='ADAETH') #This will give you a dict with current orders (bids and ask) and a an integer that represent the last updated ID.
Source: https://python-binance.readthedocs.io/en/latest/index.html
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.