You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# %%fromschwab_apiimportSchwabimportpprint# Initialize our schwab instanceapi=Schwab()
# %%# Login using playwrightprint("Logging into Schwab")
logged_in=api.login(
username=getenv_or_input("SCHWAB_USERNAME"),
password=getenv_or_input("SCHWAB_PASSWORD", input=getpass),
totp_secret=getenv_or_input("SCHWAB_TOTP_SECRET", input=getpass),
lazy=True,
# Get this by generating TOTP at https://itsjafer.com/#/schwab
)
awaitapi._async_login()
# %%# Get information about a few tickersquotes=api.quote_v2(["PFE", "AAPL"])
pprint.pprint(quotes)
# %%# Get information about all accounts holdingsprint("Getting account holdings information")
account_info=api.get_account_info()
pprint.pprint(account_info)
print("The following account numbers were found: "+str(account_info.keys()))
# %%transactions= {account_id: api.get_transaction_history_v2(account_id) foraccount_idinaccount_info.keys()}
# %%pprint.pprint(transactions)
With code
I get the response
The text was updated successfully, but these errors were encountered: