메뉴 건너뛰기

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.
번호 제목 글쓴이 날짜 조회 수
32686 Fantastic Online Gambling Agent Positions 6234 VanitaC274689178027 2022.01.26 0
32685 Fantastic Online Gambling Agency 1688 Jaunita3944592476 2022.01.26 0
32684 Kiat Menang Judi Slot Online Buat Pemula AlfredHung6542318235 2022.01.26 4
32683 Top 100 Boating Prevent Keep You Safe Regarding The Water - All At Sea MargheritaBaltes8 2022.01.26 1
32682 Kurt Cobain's Jag-Stang Guitar Is Being Released To Commemorate The 25th Anniversary Of Nirvana's "Nevermind." LettieWaterworth2830 2022.01.26 0
32681 Fetisov - On The Appointment Of Zhamnov To The National Team: "I Don’t Know What Kind Of Troubles Are Happening" Ewan5912308862123 2022.01.26 0
32680 Great Online Slot Casino 9489 TobiasHair37745 2022.01.26 0
32679 Excellent Slot Game Secret 8847 BerniceTrudeau76403 2022.01.26 0
32678 Slot Agent 9625 DanieleA4336915 2022.01.26 0
32677 The 11 Best Binary Options Brokers And Trading Platforms 2022 DVNFawn7935090674 2022.01.26 2
32676 Melabuhkan Mesin Balasan - Dalam Dalam Otak Slot Kasino NumbersStrahan1 2022.01.26 1
32675 Quality Slots Online 1487 MichaleLowes157 2022.01.26 0
32674 Learn Slot Fact 6461 RomaFountain5034427 2022.01.26 0
32673 Daftar 10 Situs Judi Slot Online Terpercaya 2021 Gampang Menang MOJOBET89 daftar-slot-online 2022.01.26 7
32672 Online Slot Bet 8674 Beryl984746579958 2022.01.26 0
32671 Avtomobilist Signed A One-year Contract With Stanislav Gareev DamienV7332550528459 2022.01.26 0
32670 Slot Game Reference 1958 ClaudioHerrmann2760 2022.01.26 0
32669 Cara Membuat Pupuk Bokashi JudiDanforth484960 2022.01.26 3
32668 Slot Agent 7136 RalfD556098737935938 2022.01.26 0
32667 Slot Useful Information 6596 AdelaO616068834 2022.01.26 0
위로