Binance is a cryptocurrency exchange website. This tag is for questions related to the Binance API and usage of Binance API wrappers. This tag is not specific to any programming language.
Questions tagged [binance]
1009 questions
11
votes
2 answers
Getting all filled orders from the Binance API
I am working on a trading bot and I wanted to train it by getting a list of my order history from Binance for a specific period of time. I looked at the API documentation here, but it seems that I am always required to provide a ticker symbol. While…

Rangel Milushev
- 111
- 1
- 4
10
votes
4 answers
Error in heroku [regex._regex_core.error: bad escape \d at position 7] when using python-binance
I tried to upload my python code (Binance trade-bot) on Heroku, but there is an error oссured. Could someone help me, please?
from binance.client import Client
from datetime import datetime
client = Client(api,key)
symbol = 'IOSTUSDT'
for i in…

An Ri
- 406
- 5
- 13
10
votes
1 answer
How to get pending transactions on BSC
I am trying to get pending transactions from the mempool on BSC using a websocket - the same way I was getting pending transactions on the Ethereum network:
web3Ws = new Web3(new…

Crypto Miner
- 125
- 1
- 2
- 5
10
votes
1 answer
How can I open multiple WebSocket streams
I am trying to stream data from the Binance WebSocket API, I have it working for one symbol at a time.
if ("WebSocket" in window) {
//open websocket
var symbols = getSymbol();
//console.log(symbols);
…

Rajbir
- 411
- 2
- 4
- 13
9
votes
2 answers
Binance API list all symbols with their names from a public endpoint
I've integrated the Binance API in my project to show a list of all supported symbols and their corresponding icon. However, I'm unable to fetch the symbols name/description.
For instance, I can fetch BTC-EUR, but I can't fetch 'Bitcoin' or similar…

TVA van Hesteren
- 1,031
- 3
- 20
- 47
9
votes
3 answers
How to create Binance test API key
I'm trying to build a Binance trading bot, I generated an API key and can use it with a real money, but I need to test the bot using their test -sandbox- account
I looked in the documentation and couldn't find out how to create a testing API…

MRashad
- 165
- 1
- 1
- 9
9
votes
2 answers
Binance - Get current price of selected coins through WebSockets
Binance offers Web Socket Streams with several functions such as Aggregate Streams, Trade Streams, Kline/Candlestick Streams, etc. that you can see here https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md
I'm looking…

Linesofcode
- 5,327
- 13
- 62
- 116
9
votes
1 answer
Close position Binance Futures with ccxt
I'm trying to close a position on Binance Futures using ccxt ccxt-1.39.93, Python 3.
# fetch position
position = binance.fetch_balance()['info']['positions']
pos = [p for p in position if p['symbol'] == "ETHUSDT"][0]
ticker =…

kollo
- 1,285
- 3
- 20
- 33
9
votes
11 answers
Why am I getting this error 'ModuleNotFoundError: No module named 'binance.client'; 'binance' is not a package' after binance installed?
I am using visual studio code to try and pull candles from binance but i keep getting the following error:
ModuleNotFoundError: No module named 'binance.client'; 'binance' is not a package
heres the line of code that is causing the error:
from…

mark32
- 103
- 1
- 1
- 8
9
votes
2 answers
How to place percentage orders with Binance API and Python-CCXT?
I'm playing with Binance API to make my trading bot with Python 3.6. and CCXT library (here you find the docs ).
One very useful thing they have in their site is the capability to place orders for a percentage of your current balance:
for example if…

kalikantus
- 123
- 1
- 1
- 6
9
votes
1 answer
What are the column header names in from historical klines websocket in binance?
I am retrieving historical data from binance using the 'get_historical_klines' (http://python-binance.readthedocs.io/en/latest/binance.html#binance.client.Client.get_historical_klines)
I am returned what the documentation is is OHLCV but that doesnt…

RustyShackleford
- 3,462
- 9
- 40
- 81
8
votes
1 answer
How to get the order book list with Binance API?
I would like to get the same information (opened orders) as displayed in order book on Binance site here:
I tried:
/api/v3/allOrders -- this apparently shows all MY orders
api/v3/openOrders -- this apparently shows opened MY…

Dims
- 47,675
- 117
- 331
- 600
8
votes
2 answers
Problems with event_loops in Python 3.10
I try to get data from the Binance Websocket. With python 3.9 as Interpreter it runs fine, but with 3.10 it gives me errors :(
Here is the code:
import asyncio
from binance import AsyncClient, BinanceSocketManager
async def main():
client =…

Max Power
- 91
- 1
- 5
7
votes
2 answers
How to connect to User Data Stream Binance?
I need to listen to User Data Stream, whenever there's an Order Event - order execution, cancelation, and so on - I'd like to be able to listen to those events and create notifications.
So I got my "listenKey" and I'm not sure if it was done the…

Cassano
- 253
- 5
- 36
7
votes
2 answers
How to get the price of a crypto at a given time in the past?
Is there any way I can use ccxt to extract the price of a crypto currency at a given time in the past?
Example: get price of BTC on binance at time 2018-01-24 11:20:01

Orl13
- 339
- 4
- 15