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
exchangeInfo = client.get_exchange_info()
# Extract the tickers general info
exchangeSymbols = []
for i in exchangeInfo['symbols']:
exchangeSymbols.append(i)
return exchangeSymbols
def getMyTrades(client, strSymbol):
return client.get_my_trades(symbol=strSymbol, fromId=0)
def getMyTradedTickers(client):
tickers = getAllTickers(client)
# Extract every ticker where trade happened
traded = []
for i in tickers:
tickerTransactions = getMyTrades(client, i["symbol"])
if tickerTransactions :
traded.append(tickerTransactions)
print(i["symbol"], " transactions available")
else :
print(i["symbol"], " has no transactions")
time.sleep(0.5)
return traded
client = Client(config.API_KEY, config.API_SECRET)
trades = getMyTradedTickers(client)
print(trades)
This returns "has no transactions" for every symbol and and empty list ("[]") at the end.
I know that the client itself and the authentication with the API keys works fine, because I can e.g. get my account balance without any issues.
Is there anything I'm overlooking or that I don't know about?