Questions tagged [binance-api-client]
278 questions
3
votes
0 answers
Is sideEffectType=“AUTO_REPAY” compulsory for closing a Binance margin order?
I Have a simple Binance Margin_Buy market order in the following form:
order_result = client.create_margin_order(
symbol=TRADE_SYMBOL,
side=SIDE_BUY,
type=ORDER_TYPE_MARKET,
timeInForce=TIME_IN_FORCE_GTC,
…

Vicbg
- 31
- 2
3
votes
2 answers
Binance python api query for global account balance
Hello i am using Binance api with python and all i can have is my SPOT account balance.
I am using this:
client.get_account()
Unfortunately staking assets (Earn balance) is not included so i can't have the whole situation rendered.
Is there any way…

komarek
- 371
- 3
- 4
- 10
3
votes
3 answers
How can i adjust the leverage with Bianance API
I want to create a python script which trades on binance futures and i was wondering how i can set a leverage for a order. I search on google but didnt found anything abt it.
client.futures_create_order(symbol='VETUSDT', side='BUY', type='MARKET', …

uLaYOTHR
- 51
- 1
- 7
2
votes
0 answers
Binance API. How to switch between spot and futures for multiplex socket using python-binance
I want to use multiplex socket for Binance future klines using python-binance.
import asyncio
from binance import AsyncClient, BinanceSocketManager
api_key_real = '____________your api key________'
secret_key_real = '____________your secret…

PiDesign Interior
- 33
- 3
2
votes
0 answers
How do i fix this: Invalid JSON error message from Binance
I have been running a python script on an Amazon EC2 instance. It runs fine for a while and then I get this error:
Invalid JSON error message from Binance:

Brian Daniel
- 31
- 3
2
votes
1 answer
Binance API. Duplicate values for parameter 'symbols'
Can't get prices for multiple symbols, gives error {'code': -1101, 'msg': "Duplicate values for parameter 'symbols'."}. I do as indicated in the documentation GitHub
This is a my code
import requests
symbols = ["KEYUSDT","BNBUSDT","ADAUSDT"]
url =…

hexelot
- 31
- 5
2
votes
3 answers
Precision is over the maximum defined for this asset. Binance?
My code
if side == "LONG" and client.futures_get_open_orders(symbol=symbol) == []:
print(data)
pos = "BUY"
q = tbal / price
q = round(q, 1)
print(tbal)
print(q)
client.futures_change_leverage(symbol=symbol,…

Andrey Kanava
- 47
- 1
- 8
2
votes
1 answer
ModuleNotFoundError: No module named 'binance'
I ran pip install python-binance.
from binance.client import Client
and get the error
ModuleNotFoundError: No module named 'binance
I have renamed the binance.py file because some people have said that solved it for them but still getting the…

Callum
- 67
- 7
2
votes
1 answer
Getting multiple cryptos' ohlc values in ccxt or binance python api?
I'm trying to create an automated bot according to my strategy but I'm struggling with a few things:
1- In ccxt, I can get OHLC data of a specified symbol. But I couldn't find any data on both documentation and google etc, about getting multiple…

yktrcn
- 29
- 1
- 6
2
votes
0 answers
binance-api - how to get close price and trade volume for last minute?
I went through several binance APIs and all examples I saw seem pretty complex to what I need. I would like to get each minute close price and trade volume for last minute. I there an example that I could use please? By strean or HTTP GET? Thank you…

Jan
- 115
- 5
2
votes
1 answer
BinanceAPIException: APIError(code=-2015): Invalid API-key, IP, or permissions for action
I have a similar issue to this stack overflow question
I tried Artur's solution but it did not work.
Also, I tried matagus solution when I created API, the Enable Future grey out and can not modify.
Using Google Colab- Non-US (Canada)- Windows…

Amir Ghazi
- 21
- 3
2
votes
1 answer
Token conversion with Binance API
Im looking for the Binance UI token conversion (https://www.binance.com/en/convert) equivalent API endpoint, but can't really find it in the docs. Thanks!

inspiral
- 611
- 1
- 7
- 15
2
votes
0 answers
Binance SpotWebsocketClient not sending responses for a subscribed symbol
I am running the following code on a Jupyter Notebook with testing purposes:
import json
import datetime
from binance.websocket.spot.websocket_client import SpotWebsocketClient
def safe_json_load(message):
try:
return…

Luiscri
- 913
- 1
- 13
- 40
2
votes
1 answer
How to restart binance threaded websocket after losing internet connection
Is there a way to automatically restart binance ThreadedWebsocketManager when the internet connection was lost?

samuelhertrich
- 87
- 11
2
votes
3 answers
How to set Stop-Limit (STOP_LOSS_LIMIT and/or TAKE_PROFIT_LIMIT) orders in Binance API on spot trading?
I am using the python-binance API wrapper.
After successfully sending a 'normal' MARKET order, I want to send in a STOP_LOSS_LIMIT order. If I'm not mistaken this is a subtype of Stop-Limit orders. This is what they are called in the Binance UI on…

CryPtoSmartGuy420
- 71
- 2
- 7