alpaca-java 0.1.2-SNAPSHOT API
Alpaca Java Client
The Alpaca Java client provides generated REST clients and handwritten convenience layers for Alpaca Broker, Market Data, Trading, WebSocket, and Broker Events SSE APIs.
Start Here
Most applications should start with
AlpacaClient or
AlpacaClientFactory.
AlpacaClient is the immutable facade for common workflows.
AlpacaClientFactory creates preconfigured generated REST clients, stream
clients, and SSE clients for lower-level use.
REST APIs
REST clients are generated at build time from the configured Alpaca OpenAPI specs. Each API
has independent generated api, model, and http
packages:
- Broker REST API with models under broker.model and transport classes under broker.http.
- Market Data REST API with models under data.model and transport classes under data.http.
- Trading REST API with models under trading.model and transport classes under trading.http.
Use the generated clients directly when you need complete endpoint coverage. Use the handwritten packages when you want named request objects, immutable facades, pagination helpers, futures adapters, or stream lifecycle management.
Handwritten Packages
- trading contains convenience facades for common Trading API workflows.
- data contains convenience facades for common Market Data workflows.
-
rest contains pagination,
response metadata, rate-limit, and
CompletableFutureadapters for generated REST clients. - http contains shared OkHttp configuration, logging, and retry helpers.
- broker.sse contains Broker Events Server-Sent Events clients.
- ws contains handwritten WebSocket clients for stock data, crypto data, news, and trading updates.
Generated Sources
Generated REST sources live under build/generated and are not committed. This
documentation is generated after generateApis, so it reflects whichever public
or local OpenAPI specs were configured for the build.