# Webull API: OpenAPI keys, signing and rate limits

URL: https://fincodelabs.com/en/blog/webull-api · Publisher: Fincode (Fincode Yazılım ve Teknoloji A.Ş.), Istanbul, Turkey · Category: Stocks, forex and broker APIs · Published: 2026-11-26 · Updated: 2026-11-26

Webull API (OpenAPI) read 26 Nov 2026: who can apply, keys and paperTrade, HMAC signing conflicts, rate limits, data fees, tested Python.

**Short answer:** The **Webull API** is Webull OpenAPI, an official interface for trading and market data that holders of an opened Webull brokerage account apply for in the Developer Console. As read on 26 November 2026, Webull US reviews live applications in 1 to 2 business days at the earliest and approves paperTrade (sandbox) keys automatically. API access costs nothing extra; real-time US market data needs a separate OpenAPI subscription.

Sources: Webull's developer documentation (changelog last updated 21 November 2026), Help Center and PyPI entries, read 26 November 2026. No Webull account or key was used; the official Python SDK's signing code was checked offline.

Nothing here recommends Webull, another broker or a strategy. Rules depend on the reader's country, and account types and API access vary by country and by Webull entity.

## Does Webull have an API? What the official docs offer

Yes: Webull OpenAPI is the official route, and it is several APIs with different audiences rather than one key that does everything.

**Webull US OpenAPI products, as described on developer.webull.com on 26 November 2026**

| Product | Who it is for | Access |
| --- | --- | --- |
| Trading API | Individuals trading their own account; traders an institution authorizes | App Key and App Secret |
| Market Data API | The same key holders | Key plus OpenAPI data subscriptions for most US data |
| Connect API | Third-party platforms acting for Webull customers | OAuth 2.0 after an application form |
| Broker API | Businesses building a brokerage service | Business route; bot builders are pointed to the Trading API |

The US site uses HTTP for trading and snapshots, MQTT for streaming quotes and gRPC for order events, covering US stocks, options, futures, crypto and event contracts. Webull also runs separate developer sites with their own hosts and markets: [Hong Kong](https://developer.webull.hk/apis/docs/about-open-api) (Hong Kong, US and China A-shares through Stock Connect), Japan (US stocks, ETFs and options, and Japanese stocks), and Singapore, Australia and Thailand (US stocks and ETFs). Other US brokers are compared in the [stock trading API overview](https://fincodelabs.com/en/blog/stock-trading-api).

## Webull API key: who can apply and how

You need an opened Webull brokerage account first; then you apply in the Developer Console, wait for review and generate a key that is shown only once.

1. On webull.com open **Developer Console > Access Credentials > API Keys > Apply for API Service**.
2. Wait for review: 1 to 2 business days at the earliest, Webull says.
3. **Register an API Application**: a name, `Market Data` and `Trading` permissions, optional IP segments, and 2FA, on by default.
4. **Generate Key**. The App Key and App Secret appear once; **Reset Key** invalidates the old pair immediately.

Residence comes first. Webull's US help page says Webull Financial LLC does not open or maintain accounts for people residing outside the United States, asks for proof of US residency for trips over two weeks, and prohibits VPN use.

**Two-factor tokens.** With 2FA on, the first call creates a token and sends an SMS code; you confirm it in the Webull app within 5 minutes or it expires. A token turns `INVALID` after 15 days without API calls, so a server idle over a long break needs a person to approve a new one. Keep the secret out of code and logs, as covered in [API key security for trading bots](https://fincodelabs.com/en/blog/api-key-security-trading-bots).

## Webull paper trading API and the test environment

The paperTrade environment has its own keys, approved automatically within minutes, its own hosts and simulated balances, so it is where to start.

Switch the Developer Console to **paperTrade** and choose **Apply for OpenAPI for PaperTrade**. There is no 2FA in the sandbox. Trading uses `api.sandbox.webull.com` instead of `api.webull.com`.

- **Reset changes IDs.** Resetting one sandbox account resets all of them with new Account IDs, so read IDs at startup.
- **Data is delayed.** Market data that needs a paid subscription arrives 15 minutes delayed in the sandbox unless you hold the matching production OpenAPI subscription.
- **The docs disagree on test accounts.** Getting Started still offers shared test accounts with no application; the SDKs page instead points to the Trading API Application page, where paperTrade keys are requested (process updated 7 November 2026, per the changelog).

## Webull API signature: docs and SDK differ

Every request carries an HMAC signature built from the path, query, signing headers and an MD5 hash of the body, and in four places the official material differs or leaves a gap.

The documented recipe: sort query parameters and the signing headers (`x-app-key`, `x-signature-*`, `x-timestamp`, `host`) by name, join them, append the uppercase MD5 of the exact body, URL-encode, sign with HMAC-SHA1 using the App Secret plus `&`, and Base64 the result. The `x-version` header (`v3`) is required but not signed. Background on schemes like this is in [API signature generation](https://fincodelabs.com/en/blog/api-signature-generation).

**Differences found on 26 November 2026**

| Topic | One source | Another source |
| --- | --- | --- |
| Algorithm | Signature and About pages: HMAC-SHA1; API reference: HMAC-SHA1 is the default | Python SDK 3.1.2 (released 24 November 2026) sends `HMAC-SHA256` and hashes the body with SHA-256 |
| App Secret | Authentication pages: never sent as a header | The [Account List reference](https://developer.webull.com/apis/docs/reference/account-list) lists `x-app-secret` as a required header |
| Repeated query names | Signature page: sort the values, then join | SDK 3.1.2 stores query parameters in a dict: one value per name |
| URL encoding | Python example: a space becomes `%20`, `~` stays | Java example uses `URLEncoder`: a space becomes `+`, `~` becomes `%7E`, `*` stays |

Which variants the server accepts could not be tested without a key. Never send the App Secret in a header. Check your signer against the published example, and avoid spaces and repeated names in query strings where you can. Webull's FAQ adds that `INVALID_TOKEN` often means a signature mismatch, such as passing `json=body` to `requests`, which serializes the body again instead of sending the string you hashed.

## Webull API Python: tested signing and order checks

This sample reproduces Webull's published signature example and tests the order fields and error paths that break first; it ran on 26 November 2026 with Python 3.11.3 and no network access.

The official package is `webull-openapi-python-sdk` (Apache-2.0, 3.1.2, Python 3.8 to 3.14); its SHA-1 signer, given the documented inputs, matches the sample below. Account list, orders, token approval and streaming need a real account and were not run.

```python
import base64, hashlib, hmac, json, re, urllib.parse, uuid

def sign(path, query, headers, body, secret):
    """Documented Webull signature: HMAC-SHA1, version 1.0."""
    params = {}
    for k, v in list(query) + list(headers.items()):
        params.setdefault(k, []).append(str(v))
    str1 = "&".join(k + "=" + "&".join(sorted(params[k])) for k in sorted(params))
    text = path + "&" + str1
    if body:                                  # the exact compact JSON you send
        text += "&" + hashlib.md5(body.encode()).hexdigest().upper()
    encoded = urllib.parse.quote(text, safe="")
    mac = hmac.new((secret + "&").encode(), encoded.encode(), hashlib.sha1)
    return base64.b64encode(mac.digest()).decode()

def order_id(oid, seen):
    if not oid or not oid.strip():
        raise ValueError("empty client_order_id")
    if len(oid) > 32:
        raise ValueError(f"client_order_id has {len(oid)} chars, max 32")
    if oid in seen:
        raise ValueError("duplicate client_order_id")
    seen.add(oid)

def price(text):
    if not re.fullmatch(r"[0-9]{1,9}(\.[0-9]{1,6})?", text) or float(text) <= 0:
        raise ValueError("bad price " + repr(text))
    return text

def send(transport, request):
    try:
        status, text = transport(request)
    except OSError as err:                    # never reached the server
        return "network", str(err)
    if status == 200:
        return "ok", text
    try:
        data = json.loads(text)
    except ValueError:
        data = None
    data = data if isinstance(data, dict) else {}
    kind = {401: "auth", 403: "auth", 429: "rate"}.get(status, "error")
    return kind, f"HTTP {status} {data.get('error_code', '?')}: {data.get('message', text[:40])}"

# Worked example from Webull's Signature page
hdr = {"x-app-key": "776da210ab4a452795d74e726ebd74b6",
       "x-timestamp": "2022-01-04T03:55:31Z", "x-signature-version": "1.0",
       "x-signature-algorithm": "HMAC-SHA1",
       "x-signature-nonce": "48ef5afed43d4d91ae514aaeafbc29ba",
       "host": "api.webull.com"}
body = {"k1": 123, "k2": "this is the api request body", "k3": True,
        "k4": {"foo": [1, 2]}}
q = [("a1", "webull"), ("a2", "123"), ("a3", "xxx"), ("q1", "yyy")]
secret = "0f50a2e853334a9aae1a783bee120c1f"
print("compact:", sign("/trade/place_order", q, hdr, json.dumps(body, separators=(",", ":")), secret))
print("spaced: ", sign("/trade/place_order", q, hdr, json.dumps(body), secret))

seen = set()
for oid in [uuid.uuid4().hex, str(uuid.uuid4()), "", "a1", "a1"]:
    try:
        order_id(oid, seen)
        print("id ok", len(oid))
    except ValueError as err:
        print("id rejected:", err)
for p in ["180.25", "1e400", "NaN"]:
    try:
        print("price ok", price(p))
    except ValueError as err:
        print("price rejected:", err)

def offline(req):
    raise ConnectionError("DNS lookup failed")

print(send(offline, {}))
print(send(lambda r: (403, "<html>Forbidden</html>"), {}))
print(send(lambda r: (401, '{"error_code":"UNAUTHORIZED","message":"Insufficient permission"}'), {}))
```

Output:

```
compact: kvlS6opdZDhEBo5jq40nHYXaLvM=
spaced:  ACoqu8MI6p8vAuCLzzXkGVAgRQg=
id ok 32
id rejected: client_order_id has 36 chars, max 32
id rejected: empty client_order_id
id ok 2
id rejected: duplicate client_order_id
price ok 180.25
price rejected: bad price '1e400'
price rejected: bad price 'NaN'
('network', 'DNS lookup failed')
('auth', 'HTTP 403 ?: <html>Forbidden</html>')
('auth', 'HTTP 401 UNAUTHORIZED: Insufficient permission')
```

The order pages cap `client_order_id` at 32 characters, unique per account: `uuid4().hex` fits, `str(uuid4())` does not. Prices are strings, so validate them as decimal text, not through `float`, which turns `1e400` into infinity. Store the ID before sending, so a timeout is checked against open orders rather than resubmitted; see [client order IDs](https://fincodelabs.com/en/blog/client-order-id).

## Webull API rate limits in production and sandbox

Limits apply per App Key and per endpoint, a breach returns HTTP 429, and Webull warns that repeated breaches may bring temporary IP-level blocking.

**Selected limits from Webull's Rate Limits page, read 26 November 2026 (requests per window)**

| Endpoint | Production | Sandbox |
| --- | --- | --- |
| Account list | 10 per 30 s | 30 per 60 s |
| Balance, positions, open orders, order detail, order history | 2 per 2 s each | 30 per 60 s |
| Preview order | 150 per 10 s | 30 per 60 s |
| Place, replace, cancel order | 600 per 60 s each | 30 per 60 s |
| Instrument lookups | 60 per 60 s | 30 per 60 s |
| Market data, non-display (stocks, options, futures) | 300 per 60 s | 30 per 60 s |

> **Hypothetical example.** A bot calls the account list every 2 seconds: 30 a minute, exactly the sandbox limit. Production allows 10 per 30 seconds, one call every 3 seconds, so the same loop gets 429 responses. Tune polling to the production table and fetch the account list once at startup.

Streaming allows at most 5 MQTT connections per App Key, and subscriptions are not restored after a reconnect, so resubscribe in the reconnect handler. The [token bucket rate limiter](https://fincodelabs.com/en/blog/token-bucket-rate-limiter-python) guide shows one way to keep a per-endpoint budget.

## Webull market data API: subscriptions and costs

Webull says API access itself costs nothing extra and trading fees match the app, but real-time US market data through the API needs separate OpenAPI subscriptions.

**Market data permissions in the Market Data API overview, read 26 November 2026**

| Data | What Webull lists |
| --- | --- |
| US stocks and ETFs | Nasdaq Basic (Level 1) or Nasdaq TotalView (Level 2), non-display OpenAPI use |
| Options | OPRA real-time non-display |
| Futures | CBOT, CME, COMEX, NYMEX individually or the CME Group bundle |
| Overnight session | Overnight Consolidated Level 2 |
| Order flow (footprint indicators) | Order Flow non-display |
| Crypto, event contracts | No additional subscription |

App and desktop subscriptions do not carry over to OpenAPI, and only one device may use Level 1 or Level 2 data at a time. The developer pages state no prices; check Advanced Quotes in your account. Licensing questions in general are covered in the [stock market data API](https://fincodelabs.com/en/blog/stock-market-data-api) guide.

## Unofficial Webull API libraries and account risk

The only route Webull documents for your own code is OpenAPI; older unofficial libraries sit outside it and carry account risk.

The PyPI package `webull` calls itself the unofficial Python interface; its last release, 0.6.1, dates from 10 January 2023. It is not part of Webull's documented OpenAPI, it can break without notice, and logging in through it may conflict with your account terms, so read them first.

Options, futures, margin and event contracts carry risks beyond cash stock trading, including losses larger than the deposit for futures and margin, and automated trading can lose money through bugs as well as markets. For readers in Turkey: the Capital Markets Board (SPK, also CMB) states that leveraged transactions such as forex may be offered to residents only through firms it has authorized, and that it acts to block other offers (Law No. 6362 Articles 99(4) and 109(2)); Article 99/A of Capital Markets Law No. 6362 treats activity by foreign crypto-asset platforms directed at Turkish residents as unauthorized. Take local legal advice.

Fincode's [broker API integration](https://fincodelabs.com/en/services/broker-api-integration) page describes such work in general terms; naming Webull here does not mean Fincode integrates it or has built on it.

Related guide: [Rithmic API](https://fincodelabs.com/en/blog/rithmic-api) · [Robinhood API](https://fincodelabs.com/en/blog/robinhood-api).

Related guide: [Polygon.io (Massive) stock API in Python](https://fincodelabs.com/en/blog/polygon-io-api-python).

## Frequently asked questions

### Is the Webull API free?

Webull's FAQ, read 26 November 2026, says API access costs nothing extra and trading fees match the app; real-time US market data needs a separate OpenAPI subscription.

### Can I use the Webull API outside the US?

Webull US help pages say Webull Financial LLC does not open or maintain accounts for people residing outside the United States. Webull runs separate developer sites for Hong Kong, Japan, Singapore, Australia and Thailand, so access depends on the Webull entity that serves your country.

### Does Webull have a paper trading API?

Yes. The paperTrade environment issues its own keys, approved automatically within minutes, on sandbox hosts with simulated balances.

### Why does the Webull API return INVALID_TOKEN with a valid token?

Webull's Trading API FAQ says this often means a signature mismatch, for example a JSON body sent in a different form from the string used for the MD5 hash.

## Sources

- [Webull OpenAPI: Getting Started](https://developer.webull.com/apis/docs/getting-started)
- [Webull OpenAPI: About Webull OpenAPI (protocols, markets, SDKs)](https://developer.webull.com/apis/docs/about-open-api)
- [Webull OpenAPI: Trading API Application (individual and paperTrade keys)](https://developer.webull.com/apis/docs/authentication/IndividualApplicationAPI)
- [Webull OpenAPI: Stock Trading (order fields, client_order_id limit)](https://developer.webull.com/apis/docs/trade-api/stock)
- [Webull OpenAPI: Signature (algorithm and worked example)](https://developer.webull.com/apis/docs/authentication/signature)
- [Webull OpenAPI: Token (two-factor verification)](https://developer.webull.com/apis/docs/authentication/token)
- [Webull OpenAPI: Rate Limits](https://developer.webull.com/apis/docs/rate-limits)
- [Webull OpenAPI: SDKs and Tools (hosts for production and test)](https://developer.webull.com/apis/docs/sdk)
- [Webull OpenAPI: Market Data API Overview (permissions)](https://developer.webull.com/apis/docs/market-data-api/overview)
- [Webull OpenAPI: Market Data API FAQ (MQTT connections)](https://developer.webull.com/apis/docs/market-data-api/faq)
- [Webull OpenAPI: Trading API FAQ](https://developer.webull.com/apis/docs/trade-api/faq)
- [Webull OpenAPI: Change Log (entries to 21 November 2026)](https://developer.webull.com/apis/docs/changelog)
- [PyPI: webull-openapi-python-sdk (version 3.1.2, 24 November 2026)](https://pypi.org/project/webull-openapi-python-sdk/)
- [Webull Help Center: Trading abroad and residency](https://www.webull.com/help/faq/10863-Can-I-trade-on-Webull-when-I-m-abroad)
- [Capital Markets Law No. 6362 (Turkish, consolidated text)](https://www.mevzuat.gov.tr/mevzuatmetin/1.5.6362.pdf)

> This guide is general information about software and markets, not investment, legal or tax advice. Automated trading can lose money, past or backtested performance does not guarantee future results, and the rules that apply depend on your jurisdiction and your exchange's terms. Sources, checks and corrections: see the [editorial policy](https://fincodelabs.com/en/editorial-policy).

---

Published by Fincode (Fincode Yazılım ve Teknoloji A.Ş.), a software company in Istanbul, Turkey: https://fincodelabs.com/en/blog/webull-api

Cite as: Fincode, "Webull API: OpenAPI keys, signing and rate limits", updated November 26, 2026, https://fincodelabs.com/en/blog/webull-api
