Step-by-step guide to using the Binance API for Python beginners (REST & WebSockets)

preview_player
Показать описание
In this video, we're going to show you how to use the Binance API with Python. We'll be using the REST and WebSockets APIs, so that you can easily access Binance's trading features from your own Python applications.

If you're new to the Binance API, or if you want to learn more about how to use the Binance API with Python, then this video is for you. We'll be walking you through each step of the process, so that you can start trading on Binance right away!

⏱️ Video Chapters
0:00 Introduction
0:22 What We're Covering
1:02 Binance REST API vs. WebSockets
2:14 Getting Started with the Binance API
2:38 Installing Python-Binance
3:26 Importing Libraries & API Keys
4:10 Binance REST API Tutorial
4:33 Example Using the Python-Binance Library
7:12 Example Using Requests Library to Binance API
10:19 Binance REST API Endpoints Overview
10:40 Binance General API Endpoint
10:49 Get Binance Server Status
11:17 Get Binance Server Time
13:04 Get All Binance Ticker Prices
14:08 Get Binance Exchange & Symbol Info
16:18 Market Data API Endpoint
16:28 Get Binance Order Book
18:31- Get Recent Binance Trades
19:16 Get Historical Binance Trades
21:16 Get Binance Average Symbol Price
22:00 Get All Tickers
22:38 Binance Account API Endpoint
22:48 Get Binance Account Info
23:03 Get Binance Asset Details
23:37 Get Binance Trades
24:06 Get All Binance Orders
24:40 Place a Binance Order
24:48 Creating Binance Test Orders
29:32 Create Binance Orders
30:28 Check Binance Order Status
31:23 Cancel Binance Order
32:37 Binance WebSockets Tutorial
32:50 Install Binance WebSocket Libraries
33:08 Import Libraries
33:28 Create Binance Trade Socket URL
34:23 Create Websocket Functions for Trade Stream
38:28 Create Websocket Functions for Kline Candlesticks
43:27 Outro

#binance
#crypto
#python
#websockets

---
---
Рекомендации по теме
Комментарии
Автор

Let me know what you think. Trying to get back in the swing of things. All feedback is appreciated!

AnalyzingAlpha
Автор

awesome dude thank you! i been using AI etc to learn all this, but seeing someone do it on video and share their experience is super helpful too

MeerkatMatt
Автор

It took me one day, but worth it!!
Super content!! Thanks!!

X_x_kingfisher_x_X
Автор

Amazing content, much better than the docs. It's actually the step you need in order to be able to navigate the docs... if you start reading the documentation only from scratch, you may go crazy on the way.

testchannel
Автор

Great video and it's covering all important aspects

mrayoubamrani
Автор

Thank you, the tutorial is very informative

oldmemorieshub
Автор

Thanks for the clear explanations!
One question only - how to find the source of this tutorial?

serhiua
Автор

Thankyou very much, this helped alot...

junaidnazir
Автор

The websocket stream will be shut down by the server after a while. When the server send a Ping, the client should send a Pong to keep the stream alive. But how can we do it with websockets?

splendorwhite
Автор

Hi, thank you so much. It's really helpful. But I was stuck in checking the account balance. When I type client.get_account(), it said Invalid API-key, IP, or permissions for action. I'm sure the ip is on the whitelist. Is there any advice on what happened.

DominicJI
Автор

Hi, important question, I'm stuck at the begginig after installing all necessary pips I get a 'False' feedback from the:

import pandas as pd
from dotenv import load_dotenv
load_dotenv()

What can I do to make it give 'True', before it gave me the traceback error that the module/s were missing but now they are all properly identified and I get False. i dont know what to do please help!

Thanks!

proudutlud
Автор

This is for spot market? What server could use to futures?

viniciostristao
Автор

Thx for the video did you know if binance have a rest api for square. Also what i searching is a binance api to claim codes. any ideas i would really appreciate

tekkitechnik-software-it-g
Автор

Is it possible to constantly receive account status via websocket? Or just the crypto price?

ventor
Автор

and whats about getting data from yourself trading bot data? some usefull api to read grid exchange and profit daily data?

FilippoDePadova
Автор

need help with binance Option chain for BTCUSD - in dataframe python

RammohanReddy-fpre
Автор

hi ! and thank you very much for this tutorial, could explain how you can get resistance and support since the API dont supply the 'full order book' but 'only' 5000 orders. ? THanks =)

Yassou
Автор

A lot of API calls are requiring the timestamp.
How do you provide the timestamp and where ?

mkaz
Автор

Nice tutorial and website. Can you please share how to properly handle the websocket stream going "dead" after some time (10 minutes to 2 hours - it just stops streaming). I would assume we need to respond to the Ping, - and I get the ping in the program, but what is the correct structure/call to respond with a "Pong"?

johngnip
Автор

info = client.get_account()
print(info)
gives me the following error:
inanceAPIException: APIError(code=-2015): Invalid API-key, IP, or permissions for action.

mo.downhill