Skip to content
Jason E Rush edited this page Nov 17, 2023 · 10 revisions

Webull

Provides Python API functionality for interacting with Webull (https://www.webull.com/). You are free to use this project, but the code is not extensively checked and Webull may update their APIs or endpoints at any time.

Are these APIs official? How stable are they? How do you find them?

The APIs used by this project are not officially supported by Webull.

The APIs used by this project are not publicly documented, guaranteed to be backward-compatible, or guaranteed to be available for any amount of time. In other words, Webull may (and do) occasionally make changes on their server that will break the functionality of the code in this project. I use most of the endpoints supported by this project myself, so if major changes do come through I will make sure they work adequately.

The APIs used by this project were found by exploring addresses used by the Webull web application. You can explore by yourself for APIs that aren't available in this project yet. The simplest way to look for them is to open the "Inspector" or "Developer Tools" in your browser (Google Chrome, Microsoft Edge, etc) and search for the POST and GET requests in the "Network" tab that output the information you're looking for. Some information may be processed by JavaScript on client side (in your browser), so it is not always easy to find what you want.

How can I support the project?

For Those Who Have The Skills 👨‍🎓

Developer Contributions

For Those Who Truly Like The Project ☕️

How can I support the project?

Usage

How to use this package.

How to login and get account details (for more info see MFA & Security)

webull = webull()
webull.get_mfa('[email protected]')
webull.get_security('[email protected]')
webull.login('[email protected]', 'pa$$w0rd' , 'AnythingYouWant', 'mfa code', 'Security Question ID', 'Security Question Answer')
webull.get_account_id()
webull.get_trade_token('123456')
print(webull.get_account())

How to order stock

webull = webull()
webull.get_mfa('[email protected]')
webull.get_security('[email protected]')
webull.login('[email protected]', 'pa$$w0rd' , 'AnythingYouWant', 'mfa code', 'Security Question ID', 'Security Question Answer')
webull.get_account_id()
webull.get_trade_token('123456')
webull.place_order('NDAQ', 90.0, 2) //stock_ticker_symbol, price, quantity

How to check standing orders

webull = webull()
webull.get_mfa('[email protected]')
webull.get_security('[email protected]')
webull.login('[email protected]', 'pa$$w0rd' , 'AnythingYouWant', 'mfa code', 'Security Question ID', 'Security Question Answer')
webull.get_account_id()
webull.get_trade_token('123456')
orders = webull.get_current_orders()
for order in orders :
  print(order)

How to cancel standing orders

webull = webull()
webull.get_mfa('[email protected]')
webull.get_security('[email protected]')
webull.login('[email protected]', 'pa$$w0rd' , 'AnythingYouWant', 'mfa code', 'Security Question ID', 'Security Question Answer')
webull.get_account_id()
webull.get_trade_token('123456')
orders = webull.get_current_orders()
for order in orders :
  if order['statusCode'] == 'Working' :
    webull.cancel_order(order['orderId'])