Class AlpacaTraderAPI
java.lang.Object
net.jacobpeterson.alpaca.rest.trader.AlpacaTraderAPI
AlpacaTraderAPI
is the class used to interface with the Alpaca Trader API endpoints. This class is
thread-safe.-
Constructor Summary
ConstructorsConstructorDescriptionAlpacaTraderAPI
(String traderKeyID, String traderSecretKey, String traderOAuthToken, TraderAPIEndpointType traderAPIEndpointType, okhttp3.OkHttpClient okHttpClient) Instantiates a newAlpacaTraderAPI
. -
Method Summary
Modifier and TypeMethodDescriptionGets theAccountActivitiesApi
.Gets theAccountConfigurationsApi
.accounts()
Gets theAccountsApi
.assets()
Gets theAssetsApi
.calendar()
Gets theCalendarApi
.clock()
Gets theClockApi
.Gets the internalApiClient
.orders()
Gets theOrdersApi
.Gets thePortfolioHistoryApi
.Gets thePositionsApi
.Gets theCorporateActionsApi
.Gets theWatchlistsApi
.
-
Constructor Details
-
AlpacaTraderAPI
public AlpacaTraderAPI(String traderKeyID, String traderSecretKey, String traderOAuthToken, TraderAPIEndpointType traderAPIEndpointType, okhttp3.OkHttpClient okHttpClient) Instantiates a newAlpacaTraderAPI
.- Parameters:
traderKeyID
- the Trader key IDtraderSecretKey
- the Trader secret keytraderOAuthToken
- the Trader OAuth tokentraderAPIEndpointType
- theTraderAPIEndpointType
okHttpClient
- an existingOkHttpClient
ornull
to create a new default instance
-
-
Method Details
-
getInternalAPIClient
Gets the internalApiClient
.- Returns:
- the
ApiClient
-
accountActivities
Gets theAccountActivitiesApi
. Lazily instantiated.- Returns:
- the
AccountActivitiesApi
-
accountConfigurations
Gets theAccountConfigurationsApi
. Lazily instantiated.- Returns:
- the
AccountConfigurationsApi
-
accounts
Gets theAccountsApi
. Lazily instantiated.- Returns:
AccountsApi
-
assets
Gets theAssetsApi
. Lazily instantiated.- Returns:
AssetsApi
-
calendar
Gets theCalendarApi
. Lazily instantiated.- Returns:
CalendarApi
-
clock
Gets theClockApi
. Lazily instantiated.- Returns:
ClockApi
-
traderCorporateActions
Gets theCorporateActionsApi
. Lazily instantiated.- Returns:
- the
CorporateActionsApi
-
orders
Gets theOrdersApi
. Lazily instantiated.- Returns:
OrdersApi
-
portfolioHistory
Gets thePortfolioHistoryApi
. Lazily instantiated.- Returns:
PortfolioHistoryApi
-
positions
Gets thePositionsApi
. Lazily instantiated.- Returns:
PositionsApi
-
watchlists
Gets theWatchlistsApi
. Lazily instantiated.- Returns:
WatchlistsApi
-