### Explanation of the Key Elements
#### Endpoint:
- **URL**:
https://api.webull.com/api/trade/v2/option/positions?secAccountId={ACCOUNT_ID}
Replace
{ACCOUNT_ID}
with your Webull account ID.
#### Headers:
- **Authorization**:
Include your
Bearer
token in the header for authenticated requests.
#### Response Fields:
The response typically includes details about your positions, such as:
- **symbol**: The ticker symbol (e.g., "AAPL").
- **quantity**: Number of shares held.
- **averagePrice**: Average purchase price.
- **currentPrice**: Current market price.
- **marketValue**: Total value of the position.
---
### Steps to Retrieve Required Data
1. **Login to Obtain Access Token**:
Use Webull's login API to authenticate and get the
access_token
.
python
POST https://api.webull.com/api/passport/login
2. **Fetch Account Details**:
Use the account details endpoint to retrieve your account ID:
python
GET https://api.webull.com/api/trade/accounts
3. **Get Positions**:
Send a GET request to the positions endpoint with your account ID and token.
---
### Notes
1. **Unofficial API**:
- Webull's API is not officially documented or supported for third-party use. API behavior may change without notice.
2. **Rate Limits**:
- Webull may enforce rate limits for API requests. Implement retry mechanisms as needed.
3. **Security**:
- Never expose your access token or account credentials. Store them securely.
---