Q: Why am I seeing this error?
The reason is client sending parameters that’s not required/permitted. e.g.
curl -H "Context-Type: application/json" "https://api.binance.com/api/v3/klines?symbol=BTCUSDT&interval=1m&limit=1"
// returns klines, works fine
[[1597020180000,"11757.48000000","11758.44000000","11754.99000000","11755.00000000","8.40647100",1597020239999,"98825.70142739",109,"3.97979200","46785.59154178","0"]]
However let’s pass a parameter not required.
curl -H "Context-Type: application/json" "https://api.binance.com/api/v3/klines?symbol=BTCUSDT&interval=1m&limit=1&foo=bar"
// returns
{"code":-1104,"msg":"Not all sent parameters were read; read '3' parameter(s) but was sent '4'."}
If the client send request via library with legitimate parameters, but still see this error, please debug the request, there maybe something that’s not as you expected in the payload.
what do you mean by this pls ? I am using Binance Python API testNet, and trying to send an OCO order,
try:
quantity=10
coinSymbol=‘ETHUSDT’
profitLimit = 3000.0
stopPrice = 1800.0
print('Do an OCO order here')
oco_order = client.order_oco_sell(symbol=coinSymbol, quantity=quantity, price=profitLimit,
stopPrice=stopPrice, stopLimitPrice=stopPrice,
stoplimitTimeInForce=stoplimitTimeInForce)
except Exception as e:
print('An exception occrred in placeOCO_order: '.format(e))
print(e)
and I am always getting the : APIError(code=-1104): Not all sent parameters were read; read ‘8’ parameter(s) but was sent ‘9’.
pls help
thanks
@peterwwq
Try to discover the final format of your request, i.e, print the parameters in the request and compare them with what’s expected according to https://binance-docs.github.io/apidocs/spot/en/#new-oco-trade.