메뉴 건너뛰기

XEDITION

Board

Binance python.
Binance Public API Connector Python.
This is a lightweight library that works as a connector to Binance public API.
Supported APIs: /api/* /sapi/* Spot Websocket Market Stream Spot User Data Stream.
Please find examples folder to check for more endpoints.
Spot Testnet is available, it can be used to test /api/* endpoints.
/sapi/* endpoints are not available. No UI. Steps to setup testnet API key. https://dev.binance.vision/t/99.
If base_url is not provided, it defaults to api.binance.com . It's recommended to pass in the base_url parameter, even in production as Binance provides alternative URLs in case of performance issues:
https://api1.binance.com https://api2.binance.com https://api3.binance.com.
PEP8 suggests lowercase with words separated by underscores , but for this connector, the methods' optional parameters should follow their exact naming as in the API documentation.
Additional parameter recvWindow is available for endpoints requiring signature. It defaults to 5000 (milliseconds) and can be any value lower than 60000 (milliseconds). Anything beyond the limit will result in an error response from Binance server.
timeout is available to be assigned with the number of seconds you find most appropriate to wait for a server response. Please remember the value as it won't be shown in error message no bytes have been received on the underlying socket for timeout seconds . By default, timeout is None. Hence, requests do not time out.
Proxy is supported.
The Binance API server provides weight usages in the headers of each response. You can display them by initializing the client with show_limit_usage=True :
You can also display full response metadata to help in debugging:
If ClientError is received, it'll display full response meta information.
Setting the log level to DEBUG will log the request URL, payload and response text.
There are 2 types of error returned from the library:
binance.error.ClientError This is thrown when server returns 4XX , it's an issue from client side. It has 4 properties: status_code - HTTP status code error_code - Server's error code, e.g. -1102 error_message - Server's error message, e.g. Unknown order sent. header - Full response header. This is thrown when server returns 5XX , it's an issue from server side.
More websocket examples are available in the examples folder.
Once connected, the websocket server sends a ping frame every 3 minutes and requires a response pong frame back within a 10 minutes period. This package handles the pong responses automatically.
Futures and Vanilla Options APIs are not supported:
/fapi/* /dapi/* /vapi/* Associated Websocket Market and User Data Streams.
Contributions are welcome. If you've found a bug within this project, please open an issue to discuss what you would like to change. If it's an issue with the API, please open a topic at Binance Developer Community.
번호 제목 글쓴이 날짜 조회 수
30670 Trading Binary Options With Price Action And Trendlines - Binary Options Signals Reviews IsobelBeckman5808800 2022.01.20 1
30669 Renee Bargh And Laura May Gibbs Grab Brunch In Byron Bay ReedDadswell599048 2022.01.20 2
30668 Tipe Permainan Slot Online Paling Ringan Menang Di Situs Agen SBOBET VelvaBolick0063 2022.01.20 1
30667 Israel Expects $220 Million In Non-defense Trade With Bahrain In 2021 IAWRuby0425815744574 2022.01.20 1
30666 Don’t Waste Time! 5 Facts Until You Reach Your No SofiaBrewis96258380 2022.01.20 3
30665 Что Такое PBN Сеть? MikelGregory6273 2022.01.20 1
30664 Perfect MLB Jersey MozelleNaumann94 2022.01.20 2
30663 Main Mesin Taruhan Slot Online Deposit Pulsa KennyO218580729260 2022.01.20 1
30662 Bermain Mesin Taruhan Slot Online Deposit Pulsa JeffreyCoppola66807 2022.01.20 1
30661 เว็บตรงไม่ผ่านเอเย่นต์ OKWIN7 RobbieLowes22718569 2022.01.20 3
30660 SUPERSLOT WALLET สล็อต ฝาก-ถอน TRUEMONEY DanaUpchurch086456 2022.01.20 4
30659 Currency Binary Option AlfredVestal997 2022.01.20 1
30658 Langkah Main Joker123 Android Mobile Phone DarrylMorisset17392 2022.01.20 1
30657 Vip Non-public Switch ManieEwing7915117159 2022.01.20 4
30656 Daftar Permainan Judi Slot Paling Baik Habanero JudsonBernays0153976 2022.01.20 1
30655 Bombilla Led E14 LutherPatten1807068 2022.01.20 1
30654 Sugar Scrub Skin Benefits, Quality Matters SusiePoupinel34381 2022.01.20 1
30653 บาคาร่าC4 DavidaDuhig1520 2022.01.20 3
30652 Teknik Serta Cara Main Judi Slot Online HildegardGardener96 2022.01.20 1
30651 Fitzpwhenrick to begi... Carma91U811959657201 2022.01.20 3
위로