Search code examples
pythoncryptocurrencybinance

Why isn't python binance recognizing symbols with GBP?


I'm using the pything-binance API and trying to trade ethereum-gbp, for which I think ETHGBP is the symbol.

I have some code that's connecting to the live candle stream using the symbol and working as expected, however when I try to use it with the python-binance api to get historic data, I get an exception that it's an invalid symbol:

symbol = "ETHGBP"
klines = client.get_historical_klines(symbol, Client.KLINE_INTERVAL_1MINUTE, "14 minutes ago UTC")

I've tried with ETHUSD which works as expected. What am I missing here?


Solution

  • When you create the client are you specifying the correct tld parameter for the exchange you use?

    If you want to interact with the main exchange, then no tld parameter is required and it defaults to com