import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import JsonView from '/src/components/JsonView';

# Trading API Application
The Trading API is a direct trading interface designated for natural persons. Based on the user's operational identity, the application process is divided into two distinct modes:

**Retail Individual Mode**

Applicable to direct account holders. Should you require the use of Trading API to trade accounts registered under your own name, please initiate the application independently.

**Institutional Trader Mode**

Applicable to institutional traders. Should you require the use of Trading API to operate authorized institutional proprietary accounts, please contact the institutional administrator (Admin) to complete the authorization application.


## Retail Individual Mode Application Process

<Tabs groupId="environment">
  <TabItem value="Prod" label="Prod" default>

1. Open the [Webull official website](https://www.webull.com/) and click [Log in] in the upper right corner. If you don't have a Webull account yet, click [Sign up] to register first.
![image](https://u1sweb.webullfinance.com/gtms/us/c247de3dcacf434482b00e5cbeb6ed4a.png)
2. After logging in, click your avatar in the upper right corner, then click [Developer Console].
![image](https://u1sweb.webullfinance.com/gtms/us/9ff10cea28114b5da3a567dda5385ed4.png)
3. In the left menu, click [Access Credentials] -> [API Keys], then click [Apply for API Service].
![image](https://u1sweb.webullfinance.com/gtms/us/8a3d1bd72dfc45d8ac33b2e250e3f1bf.png)

:::caution

You must have an opened Webull brokerage account before applying. After the application is submitted, Webull will review it. The review is expected to take `1 to 2` business days at the earliest.

:::

### Obtain API Key {#api-key-application}
1. After the API application is approved, click [Register an API Application] on the [API Keys] page.
![image](https://u1sweb.webullfinance.com/gtms/us/9efd8cc077b74300ac9f2342d94f2241.png)
2. Fill in the registration form and click [Submit]:
   - **Application Name**: a name to identify this application.
   - **API Permissions**: `Market Data` and `Trading`.
   - **Add More Address Segments** (optional): add more IP address segments allowed to call the API.
   - **Enable 2FA Verification**: enabled by default.
![image](https://u1sweb.webullfinance.com/gtms/us/f78d40b8595b4e29945501ac7178024e.png)
3. After the registration is complete, click [Generate Key] in the [Operate] column.
![image](https://u1sweb.webullfinance.com/gtms/us/62acd93ab9ad49b4b39b3c724a4214e2.png)
4. The `App Key` and `App Secret` are displayed in a pop-up window. Copy and store them securely.

:::caution

The `App Key` and `App Secret` can only be generated and viewed once. Make sure you record them before closing the window.

:::

![image](https://u1sweb.webullfinance.com/gtms/us/747ba153eeac455cac9238c88313b5c2.png)
5. After the key is generated, the [Key Status] changes to `Generated`. You can click [Reset Key] to reset the keys. Upon reset, the new key takes effect immediately and the old key is invalidated immediately.
![image](https://u1sweb.webullfinance.com/gtms/us/2f6e7c8918094467a36adc01aff945df.png)

:::tip

To access live market quotes via API, a Non-Display Market Data subscription is required. You can manage the IP whitelist for SDK integrations in the [OpenAPI Whitelisted IPs] section on the same page.

:::

  </TabItem>

  <TabItem value="Sandbox" label="Sandbox">

1. Log in to the [Webull official website](https://www.webull.com/) and open [Developer Console] from your avatar menu in the upper right corner. These steps are the same as steps 1 and 2 on the Prod tab.
2. In the upper left corner of the Developer Console, click [paperTrade] to switch environments.
![image](https://u1sweb.webullfinance.com/gtms/us/4c0d2d9984424aaeacc7a3555d4134ae.png)
3. In the confirmation dialog, click [Confirm Switch]. In the paperTrade environment:
   - All trades are simulated, and no real orders will be placed.
   - Market data may be delayed or synthetic.
   - Account balances and positions are independent from your live account.
![image](https://u1sweb.webullfinance.com/gtms/us/4aaacfbe023849ce8a7bfd48ea0dbf35.png)
4. In the left menu, click [API Keys], then click [Apply for OpenAPI for PaperTrade]. The page shows a `PaperTrade` label and a banner reminding you that operations in this environment do not affect your real trading account.
![image](https://u1sweb.webullfinance.com/gtms/us/af10d3e4d79941c2afda01ea0430ef1d.png)

:::caution

The PaperTrade (sandbox) Trading API application is approved automatically and typically completes within a few minutes.

:::

### Obtain API Key (Sandbox Environment)
1. After the application is approved, click [Register an API Application].
![image](https://u1sweb.webullfinance.com/gtms/us/bae66ca6093540329ae631c336cd2644.png)
2. Fill in the [Application Name], keep the [API Permissions] (`Market Data` and `Trading`), and click [Submit]. The sandbox form does not include 2FA verification.
![image](https://u1sweb.webullfinance.com/gtms/us/3fdc44b6151d4952b19084fe285f172a.png)
3. After the registration is complete, click [Generate Key] in the [Operate] column.
![image](https://u1sweb.webullfinance.com/gtms/us/7fa5364734c9405ab0cf37f301cdab9d.png)
4. The `App Key` and `App Secret` are displayed in a pop-up window. They can only be generated and viewed once, so copy and store them securely.
![image](https://u1sweb.webullfinance.com/gtms/us/4add41ed986140a1bbd7db5da0a01cff.png)
5. You can click [Reset Key] to reset the keys. Upon reset, the new key takes effect immediately and the old key is invalidated immediately.
![image](https://u1sweb.webullfinance.com/gtms/us/b2f88ef1c49b4963a1e02849d37e648f.png)

### Reset Sandbox Account Funds
1. In the paperTrade environment of the Developer Console, click your avatar in the upper right corner, then click [My Account].
![image](https://uat-static.webullbroker.com/gtms/us/08b8939b2ee946a793e10a489cdf600b.png)
2. The [My Account] `PaperTrade` page lists all your sandbox accounts, such as `Individual Cash`, `Individual Margin`, and `Events`. Click [Reset] on any account card to reset the sandbox account funds.
![image](https://uat-static.webullbroker.com/gtms/us/211a429e00f5470598074bd93a7b0c06.png)

:::caution

- Clicking [Reset] on any account resets **all** sandbox accounts at the same time, not only the selected one.
- After the reset, every sandbox account is assigned a **new Account ID**. Update any Account IDs saved in your code or configuration before calling the API again.

:::

  </TabItem>
</Tabs>

## Institutional Trader Mode Application Process
:::tip Note

For administrators, you need to complete the Open API Services application, then grant Open API Access to users within your organization, allowing them to create their own app keys and app secret (AK/SK) and  manage accounts through API.

For non-administrator users, you must first contact an administrator to enable Open API Access, then go to the official website's Developer Tools Center to [create an API Keys application](#api-key-application) and, following the page instructions, create your personal Open API Keys application in the Developer Center.

:::

### Apply for OpenAPI



<Tabs groupId="environment">
  <TabItem value="Prod" label="Prod" default>

1. Open the [Webull Portal Prod](https://portal.webull.com/center/). Log in using your Webull registered account. (If you do not have a Webull account yet, please click the Register button to sign up first.)
![image](https://u1sweb.webullfinance.com/gtms/us/ccd9565ad10d474193b334a4ed6bc652.png)
2. Make sure your account is opened, click [Open API] -> [Open API Application] to apply for the API.
![image](https://u1sweb.webullfinance.com/gtms/us/f06232d8c3e04598bbf482f16bcbd6be.png)

:::caution Note

   After submitting your API application, it will be reviewed by Webull operations staff. The review is expected to take 1 to 2 business days at the fastest.

:::
   Once your application is approved, an email will be sent to the email address you provided during account registration. You can also view the status under [Open API] -> [Open API Application] in the [Webull Portal](https://portal.webull.com/center/), as shown below:
![image](https://u1sweb.webullfinance.com/gtms/us/25e3fc474e0746118c44e1a678eeddf4.png)

  </TabItem>

  <TabItem value="Sandbox" label="Sandbox">

1. Open the [Webull Portal Sandbox](https://passport.webull.com/auth/simple/login/inst?source=seo-direct-home&hl=en&redirect_uri=https%3A%2F%2Fportal.sandbox.webull.com%2Fcenter). Log in using your Webull registered account. (If you do not have a Webull account yet, please click the Register button to sign up first.)
![image](https://u1sweb.webullfinance.com/gtms/us/ccd9565ad10d474193b334a4ed6bc652.png)

:::tip Note

   Select the institution's licensing status — recommend "Yes" for this option.
   For sandbox account opening, follow the above recommendation; for production, fill in per actual circumstances.

   Choosing "Yes" reduces sandbox account opening data entry and speeds up the process. Sandbox data does not sync to production — the two environments are fully isolated.

:::

2. Make sure your account is opened, click [Open API] -> [Open API Application] to apply for the API.
![image](https://u1sweb.webullfinance.com/gtms/us/f06232d8c3e04598bbf482f16bcbd6be.png)
:::caution Note

   After submitting your API application, it will be reviewed by Webull operations staff. The review is expected to take 1 to 2 business days at the fastest.
:::

   Once your application is approved, an email will be sent to the email address you provided during account registration. You can also view the status under [Open API] -> [Open API Application] in the [Webull Portal Sandbox](https://passport.webull.com/auth/simple/login/inst?source=seo-direct-home&hl=en&redirect_uri=https%3A%2F%2Fportal.sandbox.webull.com%2Fen%2Fcenter), as shown below:
![image](https://u1sweb.webullfinance.com/gtms/us/25e3fc474e0746118c44e1a678eeddf4.png)


  </TabItem>
</Tabs>

### Authorize Traders for Open API Access

1. The admin can go to [User Management] to grant Open API Access to users in your organization. Once authorized, users can generate their own API keys and perform operations with them.
![image](https://u1sweb.webullfinance.com/gtms/us/bc8ba32f8b094d8f8bce4dd5396c48e1.png)
![image](https://u1sweb.webullfinance.com/gtms/us/4704ab7008ad4019af75c34e8a7bc7e7.png)

:::caution note

Authorize with caution—authorized users can access all accounts in the portal via their keys. Support for aligning key permissions with user permissions is coming soon.

:::

### Obtain API Key
As an Authorized Open API Trader, below is an example after key generation, which includes your Permissions, and the IP whitelist you have set.
1. After you receive an invitation from the institution administrator, you can start registering your application under [Open API] -> [My OpenAPI Access].
![image](https://u1sweb.webullfinance.com/gtms/us/64b02db50792474fbd83f32830396ffc.png)
   If you do not have OpenAPI access rights, the [My OpenAPI Access] page will display as follows:
![image](https://u1sweb.webullfinance.com/gtms/us/370254735b554d8c9db69cdcb7cbca24.png)

:::tip note

   You can contact the institution administrator to grant access rights to OpenAPI.

:::
2. click the [API Keys Management], go to [API Keys Management] in the Developer Tools Center, then reference
the [Obtain API Key Application](#api-key-application) to manage your API key.