itsjafer / schwab-api

A python library for placing trades on Charles Schwab
MIT License
201 stars 64 forks source link

Locking My Account #45

Closed p-norris closed 2 months ago

p-norris commented 6 months ago

Hi,

Thank you for all your working making this api.

Starting yesterday, I'm getting locked out of my account when I run a script. I'm not sure if this has to do with the recent addition of dotenv, but when using the dotenv code, I could not log in at all, so I removed it. Without dotenv, I logged in a number of times and tested my script, but the last two attempts required a call to Schwab in order to get back into the account.

Do you know of this problem and have a solution?

Thank you,

Phil

4rumprom commented 6 months ago

I'm using dotenv for local troublshooting and I don't have any issues. I don't want to presume but my immediate guess is that the credentials are wrong and Schwab locks the account after too many failed attempts. I recommend you print the credentials before passing them to api.login() and make sure they are correct.

p-norris commented 6 months ago

The error message says that api is expecting a str and getting an object. I tried getting around that a couple of times, but when I removed the os.getenv, it worked fine. Until the next day, and the day after that after getting unblocked.

Getting blocked may be my issue, I was getting a quote in a while loop every second. Is there a limit on requesting info?

From: 4rumprom @.> Sent: Thursday, February 22, 2024 12:37 PM To: itsjafer/schwab-api @.> Cc: p-norris @.>; Author @.> Subject: Re: [itsjafer/schwab-api] Locking My Account (Issue #45)

I'm using dotenv for local troublshooting and I don't have any issues. I don't want to presume but my immediate guess is that the credentials are wrong and Schwab locks the account after too many failed attempts. I recommend you print the credentials before passing them to api.login() and make sure they are correct.

- Reply to this email directly, view it on GitHubhttps://github.com/itsjafer/schwab-api/issues/45#issuecomment-1959939182, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BBGMSEPUAF3CBTLRAX6NUIDYU563HAVCNFSM6AAAAABDOJNLLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZHEZTSMJYGI. You are receiving this because you authored the thread.Message ID: @.**@.>>

4rumprom commented 6 months ago

It's possible that getting quotes too frequently will get your account blocked. Just as a guideline, https://polygon.io/ allows 5 calls per minute on their free account. When you call Schwab to unlock, maybe they can tell you more as to why it was locked.

However, that doesn't fully explain why an object is passed when a string is expected. Do you have the exact error message?

On Thu, Feb 22, 2024 at 5:07 PM p-norris @.***> wrote:

The error message says that api is expecting a str and getting an object. I tried getting around that a couple of times, but when I removed the os.getenv, it worked fine. Until the next day, and the day after that after getting unblocked.

Getting blocked may be my issue, I was getting a quote in a while loop every second. Is there a limit on requesting info?

From: 4rumprom @.> Sent: Thursday, February 22, 2024 12:37 PM To: itsjafer/schwab-api @.> Cc: p-norris @.>; Author @.> Subject: Re: [itsjafer/schwab-api] Locking My Account (Issue #45)

I'm using dotenv for local troublshooting and I don't have any issues. I don't want to presume but my immediate guess is that the credentials are wrong and Schwab locks the account after too many failed attempts. I recommend you print the credentials before passing them to api.login() and make sure they are correct.

- Reply to this email directly, view it on GitHub< https://github.com/itsjafer/schwab-api/issues/45#issuecomment-1959939182>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/BBGMSEPUAF3CBTLRAX6NUIDYU563HAVCNFSM6AAAAABDOJNLLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZHEZTSMJYGI

. You are receiving this because you authored the thread.Message ID: @.**@.>>

— Reply to this email directly, view it on GitHub https://github.com/itsjafer/schwab-api/issues/45#issuecomment-1960396576, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUBF3VHXHBBY2CUY57NBCOTYU66Q3AVCNFSM6AAAAABDOJNLLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQGM4TMNJXGY . You are receiving this because you commented.Message ID: @.***>