schwab-api icon indicating copy to clipboard operation
schwab-api copied to clipboard

Open Orders Support

Open kimardenmiller opened this issue 3 years ago • 3 comments

Great project! Example code works great. Have you looked into how to implement retrieving account open orders?

kimardenmiller avatar Jan 26 '22 00:01 kimardenmiller

I might be willing to do a PR to add open orders if you can just point me to the Schwab spec for API URLs, e.g. such that got you to https://client.schwab.com/api/PositionV2/PositionsDataV2.

Thanks!

kimardenmiller avatar Jan 26 '22 19:01 kimardenmiller

Hi @kimardenmiller , I haven't personally looked into retrieving open account orders but I'd love to review and merge a PR for it.

Schwab doesn't have a spec for their API URLs. After logging in, I just looked at the network requests being made by the website and did some trial and error to identify the API that was generating the response I was looking for!

itsjafer avatar Jan 26 '22 19:01 itsjafer

Thanks @itsjafer. Looks as if we can return return data from the open orders page at https://client.schwab.com/Trade/OrderStatus/ViewOrderStatus.aspx?ViewTypeFilter=Open.

But rather than the very nice XHR data on positions, all I'm seeing back with open orders data is the html document.

Any thoughts before I look into parsing that html, which might mean creating new, additional dependencies to parse efficiently.

kimardenmiller avatar Jan 26 '22 20:01 kimardenmiller

Hi @kimardenmiller, I've updated this package to use the latest API that Schwab is using on their UI. I've added an orders_v2() function that should help you get the information you're looking for!

itsjafer avatar Dec 13 '23 21:12 itsjafer

Thanks for that update, Jafer. I’ll have a look in a bit. :-)

On Dec 13, 2023, at 3:01 PM, Jafer Haider @.***> wrote:

Hi @kimardenmiller https://github.com/kimardenmiller, I've updated this package to use the latest API that Schwab is using on their UI. I've added an orders_v2() function that should help you get the information you're looking for!

— Reply to this email directly, view it on GitHub https://github.com/itsjafer/schwab-api/issues/7#issuecomment-1854693800, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQQUWAL6ILKW4PH5FPY7DTYJIJRJAVCNFSM5MZWVQ42U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBVGQ3DSMZYGAYA. You are receiving this because you were mentioned.

kimardenmiller avatar Dec 15 '23 17:12 kimardenmiller