Java client for Alpaca Markets APIs.
REST clients are generated at build time from Alpaca OpenAPI specs. WebSocket stream clients and
Broker Events SSE helpers are handwritten and committed in src/main/java/markets/alpaca/client/.
- Getting started — installation, credentials, and examples
- API reference — classes, methods, and generated REST models
- Runnable examples — local Trading, Market Data, Broker, and pagination workflows
- LLM usage guide — guidance for coding assistants
- Documentation development — local Docusaurus setup
- Contributing guide — issues, pull requests, and release instructions
Java 17+ is required. OpenAPI specs are fetched by default, so a normal build does not need local
spec files. Generated REST sources are written to build/generated/.
./gradlew build # generate, compile, and test
./gradlew generateApis # generate clients for IDE setup
./gradlew check # full local verification
./gradlew integrationTest # live tests; skips when credentials are absentFor the complete task list and local spec configuration, see AGENTS.md. For
integration-test credentials see TESTING.md, and for release procedures see
RELEASING.md.
Every successful current push to main publishes the current -SNAPSHOT version to Central
Snapshots. Scope the snapshot repository to this module:
repositories {
mavenCentral()
maven {
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
mavenContent { snapshotsOnly() }
content { includeModule("markets.alpaca", "alpaca-java") }
}
}
dependencies {
implementation("markets.alpaca:alpaca-java:0.1.2-SNAPSHOT")
}For release consumption, use Maven Central as shown in the Getting Started guide.
Read the contributing guide for the pull-request workflow. Before changing the
SDK, also read AGENTS.md for generated-code boundaries, local OpenAPI spec
configuration, testing, and publishing safeguards.