Documentation
¶
Overview ¶
Package webullapi4go is an idiomatic Go SDK for the Webull OpenAPI.
The root module provides the shared client in client and service clients in data, stream, trade, events, connect, display, brokerfd, and brokerfd/events. Broker API HK is provided by the separate broker module. The optional webull package aliases selected core-client types and options; it is not an aggregate service facade.
Shared public foundations live in pkg/errors, pkg/observability, pkg/resilience, pkg/transport, pkg/types, pkg/domain/money, and pkg/domain/order. Public financial DTOs use money.Money for required and response values, or *money.Money for optional and request values; decimal JSON strings remain the wire representation.
The current request, OMS, streaming, event-telemetry, and documentation hardening is tagged in repository v2.1.1. This is a repository patch release, not a published Go-semver v2 module; v2 module publication remains deferred, and this module remains github.com/shing1211/webullapi4go.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package brokerfd provides the Webull Broker FD (US) API client.
|
Package brokerfd provides the Webull Broker FD (US) API client. |
|
events
Package events provides a gRPC event-streaming client for the Webull Broker FD (US) API.
|
Package events provides a gRPC event-streaming client for the Webull Broker FD (US) API. |
|
Package client is the public entry point to the Webull OpenAPI SDK.
|
Package client is the public entry point to the Webull OpenAPI SDK. |
|
Package conformance holds the committed wire-conformance fixtures and the manifest that records where each one came from.
|
Package conformance holds the committed wire-conformance fixtures and the manifest that records where each one came from. |
|
Package connect provides a client for the Webull Connect API, an OAuth 2.0 flow for third-party applications.
|
Package connect provides a client for the Webull Connect API, an OAuth 2.0 flow for third-party applications. |
|
Package data provides the Webull Market Data API client.
|
Package data provides the Webull Market Data API client. |
|
Package display provides a client for the Webull Display Solution API, a separate product from the core Market Data API with its own host, authentication, and endpoint paths.
|
Package display provides a client for the Webull Display Solution API, a separate product from the core Market Data API with its own host, authentication, and endpoint paths. |
|
Package events provides a client for Webull's gRPC trade-event stream.
|
Package events provides a client for Webull's gRPC trade-event stream. |
|
examples
|
|
|
account
command
Command account lists the authenticated user's trading accounts and, for one account, prints its balance and open positions.
|
Command account lists the authenticated user's trading accounts and, for one account, prints its balance and open positions. |
|
account-monitor
command
Command account-monitor periodically prints an account's balance, buying power, and initial margin.
|
Command account-monitor periodically prints an account's balance, buying power, and initial margin. |
|
auth
command
Command auth creates or reuses a Webull access token and prints its status.
|
Command auth creates or reuses a Webull access token and prints its status. |
|
brokerfd
command
Command brokerfd demonstrates read-only Broker FD (US) API operations.
|
Command brokerfd demonstrates read-only Broker FD (US) API operations. |
|
brokerfd-events
command
Command brokerfd-events connects to the Webull Broker FD gRPC event stream, subscribes to events for one or more trading accounts, and prints each received data event until interrupted with Ctrl+C.
|
Command brokerfd-events connects to the Webull Broker FD gRPC event stream, subscribes to events for one or more trading accounts, and prints each received data event until interrupted with Ctrl+C. |
|
data-fundamentals
command
Command data-fundamentals fetches fundamental data for AAPL over the Market Data HTTP API.
|
Command data-fundamentals fetches fundamental data for AAPL over the Market Data HTTP API. |
|
events
command
Command events connects to the Webull gRPC trade-event stream, subscribes to order events for one trading account, and prints each decoded event until interrupted with Ctrl+C.
|
Command events connects to the Webull gRPC trade-event stream, subscribes to order events for one trading account, and prints each decoded event until interrupted with Ctrl+C. |
|
marketdata
command
Command marketdata fetches a market snapshot and recent daily bars for AAPL over the Market Data HTTP API.
|
Command marketdata fetches a market snapshot and recent daily bars for AAPL over the Market Data HTTP API. |
|
options
command
Command options demonstrates a multi-leg US options order preview.
|
Command options demonstrates a multi-leg US options order preview. |
|
order
command
Command order demonstrates the stock-order lifecycle: it previews a small AAPL limit buy and, only when explicitly opted in, places it far below the market and immediately cancels it.
|
Command order demonstrates the stock-order lifecycle: it previews a small AAPL limit buy and, only when explicitly opted in, places it far below the market and immediately cancels it. |
|
path-probe
command
Command path-probe compares the paths the SDK calls against the paths in the official Webull OpenAPI definition for endpoints where the two disagree.
|
Command path-probe compares the paths the SDK calls against the paths in the official Webull OpenAPI definition for endpoints where the two disagree. |
|
probe
command
probe tests data package endpoints and arbitrary paths against the live HK and US sandboxes.
|
probe tests data package endpoints and arbitrary paths against the live HK and US sandboxes. |
|
streaming
command
Command streaming connects to the Webull streaming broker over MQTT-over- WebSocket, subscribes to AAPL quote/snapshot/tick pushes, and consumes bounded channels until interrupted with Ctrl+C or the two-minute run limit expires.
|
Command streaming connects to the Webull streaming broker over MQTT-over- WebSocket, subscribes to AAPL quote/snapshot/tick pushes, and consumes bounded channels until interrupted with Ctrl+C or the two-minute run limit expires. |
|
watchlist
command
Command watchlist lists the authenticated user's watchlists.
|
Command watchlist lists the authenticated user's watchlists. |
|
gen
|
|
|
internal
|
|
|
auth
Package auth implements Webull request signing and token lifecycle management.
|
Package auth implements Webull request signing and token lifecycle management. |
|
region
Package region describes Webull OpenAPI deployment regions and the service endpoints (HTTP, MQTT, gRPC) for each environment.
|
Package region describes Webull OpenAPI deployment regions and the service endpoints (HTTP, MQTT, gRPC) for each environment. |
|
pkg
|
|
|
domain/order
Package order implements the SDK's order management domain model: a validated state machine that enforces the legal transitions of a Webull order through its lifecycle.
|
Package order implements the SDK's order management domain model: a validated state machine that enforces the legal transitions of a Webull order through its lifecycle. |
|
errors
Package errs defines the typed error model shared by every webullapi4go package.
|
Package errs defines the typed error model shared by every webullapi4go package. |
|
observability
Package observability provides OpenTelemetry tracing and metrics integration for the Webull API SDK.
|
Package observability provides OpenTelemetry tracing and metrics integration for the Webull API SDK. |
|
resilience
Package resilience groups the SDK's resilience primitives:
|
Package resilience groups the SDK's resilience primitives: |
|
resilience/breaker
Package breaker implements the circuit-breaker pattern.
|
Package breaker implements the circuit-breaker pattern. |
|
resilience/clock
Package clock provides the time source used by the SDK's resilience primitives so that retry, rate limiting, and circuit-breaking behaviour can be tested with an injected, deterministic clock.
|
Package clock provides the time source used by the SDK's resilience primitives so that retry, rate limiting, and circuit-breaking behaviour can be tested with an injected, deterministic clock. |
|
resilience/ratelimit
Package ratelimit implements a token-bucket rate limiter and a keyed variant for applying independent limits per endpoint.
|
Package ratelimit implements a token-bucket rate limiter and a keyed variant for applying independent limits per endpoint. |
|
resilience/retry
Package retry provides context-aware retries with exponential backoff and optional jitter.
|
Package retry provides context-aware retries with exponential backoff and optional jitter. |
|
transport
Package transport provides the HTTP transport layer used by the public client.
|
Package transport provides the HTTP transport layer used by the public client. |
|
transport/mqtt
Package mqtt is the low-level MQTT transport used by the public stream package to receive Webull market-data pushes.
|
Package mqtt is the low-level MQTT transport used by the public stream package to receive Webull market-data pushes. |
|
types
Package types defines shared Webull domain types that are safe for external use.
|
Package types defines shared Webull domain types that are safe for external use. |
|
Package stream provides Webull market-data streaming over MQTT.
|
Package stream provides Webull market-data streaming over MQTT. |
|
Package trade provides the Webull Trading HTTP API client.
|
Package trade provides the Webull Trading HTTP API client. |
|
Package webull provides optional aliases for selected core-client types and options.
|
Package webull provides optional aliases for selected core-client types and options. |