Package markets.alpaca.client.ws
Enum Class AlpacaStreamEnvironment
- All Implemented Interfaces:
Serializable,Comparable<AlpacaStreamEnvironment>,Constable
Selects between the Alpaca production and sandbox WebSocket endpoints.
Which environment should I use?
- Trading/data credentials (
APCA_TRADING_KEY_ID/APCA_TRADING_SECRET_KEY): authenticate againstPRODUCTION. Trading API keys are scoped to the live data stream and work for all four stream types. - Broker-sandbox credentials: use
SANDBOXfor stock streams. Crypto and news streams are production-only and do not have a sandbox endpoint.
The trading stream uses its own production/paper distinction via TradingEnvironment.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionstream.data.alpaca.markets— live market data (all stream types).stream.data.sandbox.alpaca.markets— stock streams only. -
Method Summary
Modifier and TypeMethodDescriptionbaseUrl()Returns the base WebSocket URL for this environment (no trailing slash).static AlpacaStreamEnvironmentReturns the enum constant of this class with the specified name.static AlpacaStreamEnvironment[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PRODUCTION
stream.data.alpaca.markets— live market data (all stream types). -
SANDBOX
stream.data.sandbox.alpaca.markets— stock streams only.Requires broker-sandbox credentials, not paper-trading credentials. Crypto and news streams have no sandbox endpoint; use
PRODUCTIONfor those.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
baseUrl
Returns the base WebSocket URL for this environment (no trailing slash).
-