Questions tagged [binance-api-client]
278 questions
1
vote
1 answer
How to create a futures limit order together with take profit and stop loss on binance?
I am trying to create a limit order together with take profit and stop loss on binance, but this does not always work. Occasionally this code does everything right, but most often I get the error "API Error(code=-2021): Order would immediately…

Gawain
- 21
- 1
- 6
1
vote
1 answer
Binance API {"code":-1022,"msg":"Signature for this request is not valid."}. Not sure what I am doing incorrectly
I'm not sure what is wrong with this code. I think I might be missing something somewhere but I can't figure it out. I keep getting the error. The keys are for the binance test net and so they aren't important.
const ts = Date.now()
var crypto =…

Adam
- 49
- 1
- 7
1
vote
1 answer
How do I get the minimum transaction amount with the binance api?
How do I get the minimum transaction amount with the binance api?
For example, the minimum purchase price for MANA / USDT and ATOM / USDT is '10 USDT'.
The same is true for BTC / USDT.
How do I get it from'from binance.client import Client'?
I also…

tunaex
- 11
- 1
- 3
1
vote
1 answer
Illegal characters found in parameter 'price' Python Binance
I'm not able to place the below order:
symbolTicker = 'SHIBUSDT'
orderPriceBuy = 0.00002650
orderPriceSell = 0.00002700
Code:
buyOrder = client.create_order(
symbol=symbolTicker,
side=SIDE_BUY,
…

Cassano
- 253
- 5
- 36
1
vote
1 answer
How to produce valid signature at Binance API using Vanilla Javascript: {"code":-2014,"msg":"API-key format invalid."}
I've spent several hours trying to get the correct response from the endpoint. For that purpose I need to send a signature string generated by a SHA-256 function, attached to the query string I send to the server.
I've tried different methods to get…

carloswm85
- 1,396
- 13
- 23
1
vote
2 answers
Place Binance Future Order using python-binance wrapper. Error: APIError(code=-1102): Mandatory parameter '5e-05' was not sent
I create future order with mandatory parameters
import datetime
from binance.client import Client
client = Client(API_KEY, API_SECRET)
timestamp = datetime.datetime.now().timestamp()
trade = client.futures_create_order(symbol='BTCUSDT',…

Kusal Thiwanka
- 151
- 1
- 4
1
vote
0 answers
How to set up a Binance WebSocket Connection with Vapor?
I tried setup Binance websocket like this, what do I miss?
app.get("hello") { req -> EventLoopFuture in
return WebSocket.connect(to: "wss://stream.binance.com:9443", headers: HTTPHeaders([("binance-api-key", "api-key"),…

János
- 32,867
- 38
- 193
- 353
1
vote
3 answers
"client.get_historical_klines" from Binance API doesn't return good value
Using the function below gives me this result:
[1637971200000, '53756.29000000', '53859.31000000', '53747.77000000', '53853.57000000', '16.49892000', 1637971259999, '887949.68081540', 639, '12.00163000', '645905.65329110',…

Viald
- 37
- 1
- 4
1
vote
1 answer
How to close binance future position for all open orders via api
I am unable to close the open positions like BINANCE future interface did. Can anyone guide me that I am right path. Currently I am try to close the positions using create orders api with below parameters. I have 2 sale orders in open positions and…

Scor Pio
- 49
- 2
- 13
1
vote
0 answers
SQL Server - Call Binance API with API Key Header
I want to get my Binance account info by calling API via SQL Server. But I can't figure it out how sent API key with suitable format. Is it possible? How should I sent API key with get request?
Error: {"code":-2014,"msg":"API-key format…

rkapukaya
- 77
- 1
- 8
1
vote
1 answer
Binance API: How to get an Order ID in binance using python
In order to cancel an order in binance I need an orderID.
How can I place an order and automatically receive an order ID back.
I am sending an order this way
def order_sell():
client.create_order(
symbol='XRPBNB',
…

Iwan
- 21
- 3
1
vote
2 answers
Get historical data from binance
I am trying to extract historical data between [curr_time - 2years, curr_time]. Time gap is 1 day. So, I expect about 700 items, but i received only 3 items.
How can I fix this problem?
My code
from binance.client import Client
# Binance test_key…

Alex
- 562
- 1
- 6
- 25
1
vote
0 answers
get_my_trades() always returns empty list
I am having trouble with getting my trade history via the Binance API.
I am using python binance and this is my script:
import config, time
from binance.client import Client
def getAllTickers(client):
# Get all available exchange tickers
…

Kubix
- 11
- 2
1
vote
1 answer
php websocket at BINANCE FUTURES does not work
I'm having trouble connecting to binance futures' websocket server in php.
In the example below in BINANCE SPOT it works:

Davi Cieluck
- 21
- 2
1
vote
1 answer
how to create order with USDT as quantity parameter?
I am trying to place a futures order through api.
Here is the code below:
bot.futures_create_order(symbol="FLMUSDT",side="BUY",type="MARKET",quantity=12)
This code is making order of buying 12 FLM quantity with usdt of 6$ as price of FLM is 0.5…

KrisH Jodu
- 104
- 9