Search code examples
python-3.xbinance-api-client

Binance API in python APIError(code=-1121): Invalid symbol


I am trying to code a binance Buy function. However the code

from binance.enums import *
order = client.create_order(symbol='DOGEUSDT', side = 'BUY',  type = 'MARKET', quantity = 475, timeInForce='GTC')

this code outputs > APIError(code=-1121): Invalid symbol.

Also, for the same symbol,

print(client.get_symbol_info(symbol="DOGEUSDT"))

ouptuts > None

The symbol DOGEUSDT exists is the orderbook. https://api.binance.com/api/v3/ticker/bookTicker I dont know why the same symbol I get from binance is invalid.


Solution

  • Are you using the testnet? I had the same error, however when I removed testnet=True from the client initialization the error was resolved.