Class AlpacaClient
The generated REST ApiClient classes are mutable. This client owns configured
generated clients internally and exposes narrower workflow facades for common calls. When an
unsupported generated endpoint is needed, call one of the new*Client() methods to get a
fresh mutable generated client that can be customized without mutating this client.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for immutableAlpacaClientinstances.static final classSafe order workflows exposed byAlpacaClient.static final classSafe stock-market-data workflows exposed byAlpacaClient. -
Method Summary
Modifier and TypeMethodDescriptionReturns the Broker Events SSE client configured for this client.static AlpacaClient.Builderbuilder(AlpacaCredentials credentials) Creates a client builder.Returns a fresh mutable generated Broker client for endpoints not covered by this facade.Returns a fresh mutable generated Market Data client for endpoints not covered by this facade.Returns a fresh mutable generated Trading client for endpoints not covered by this facade.orders()Returns common Trading order workflows without exposing the mutable generated client.stocks()Returns common Market Data stock workflows without exposing the mutable generated client.
-
Method Details
-
builder
Creates a client builder.The supplied credentials are used for Trading, Market Data, and Broker APIs unless overridden with
AlpacaClient.Builder.tradingCredentials(AlpacaCredentials),AlpacaClient.Builder.dataCredentials(AlpacaCredentials), orAlpacaClient.Builder.brokerCredentials(AlpacaCredentials). -
orders
Returns common Trading order workflows without exposing the mutable generated client. -
stocks
Returns common Market Data stock workflows without exposing the mutable generated client. -
brokerEventsSseClient
Returns the Broker Events SSE client configured for this client. -
newTradingClient
Returns a fresh mutable generated Trading client for endpoints not covered by this facade.Mutating the returned client does not affect this client or future calls to this method.
-
newDataClient
Returns a fresh mutable generated Market Data client for endpoints not covered by this facade.Mutating the returned client does not affect this client or future calls to this method.
-
newBrokerClient
Returns a fresh mutable generated Broker client for endpoints not covered by this facade.Mutating the returned client does not affect this client or future calls to this method.
-