Class ForexApi
java.lang.Object
net.jacobpeterson.alpaca.openapi.marketdata.api.ForexApi
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlatestRates
(String currencyPairs) Latest rates for currency pairs Get the latest forex rates for the given currency pairs.protected okhttp3.Call
latestRatesAsync
(String currencyPairs, ApiCallback<ForexLatestRatesResp> _callback) Latest rates for currency pairs (asynchronously) Get the latest forex rates for the given currency pairs.protected okhttp3.Call
latestRatesCall
(String currencyPairs, ApiCallback _callback) Build call for latestRatesprotected ApiResponse<ForexLatestRatesResp>
latestRatesWithHttpInfo
(String currencyPairs) Latest rates for currency pairs Get the latest forex rates for the given currency pairs.rates
(String currencyPairs, String timeframe, OffsetDateTime start, OffsetDateTime end, Long limit, Sort sort, String pageToken) Historical rates for currency pairs Get historical forex rates for the given currency pairs in the given time interval, and at the given timeframe (snapshot frequency).protected okhttp3.Call
ratesAsync
(String currencyPairs, String timeframe, OffsetDateTime start, OffsetDateTime end, Long limit, Sort sort, String pageToken, ApiCallback<ForexRatesResp> _callback) Historical rates for currency pairs (asynchronously) Get historical forex rates for the given currency pairs in the given time interval, and at the given timeframe (snapshot frequency).protected okhttp3.Call
ratesCall
(String currencyPairs, String timeframe, OffsetDateTime start, OffsetDateTime end, Long limit, Sort sort, String pageToken, ApiCallback _callback) Build call for ratesprotected ApiResponse<ForexRatesResp>
ratesWithHttpInfo
(String currencyPairs, String timeframe, OffsetDateTime start, OffsetDateTime end, Long limit, Sort sort, String pageToken) Historical rates for currency pairs Get historical forex rates for the given currency pairs in the given time interval, and at the given timeframe (snapshot frequency).
-
Constructor Details
-
ForexApi
public ForexApi() -
ForexApi
-
-
Method Details
-
latestRatesCall
protected okhttp3.Call latestRatesCall(String currencyPairs, ApiCallback _callback) throws ApiException Build call for latestRates- Parameters:
currencyPairs
- (required)_callback
- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException
- If fail to serialize the request body object
-
latestRates
Latest rates for currency pairs Get the latest forex rates for the given currency pairs.- Parameters:
currencyPairs
- (required)- Returns:
- ForexLatestRatesResp
- Throws:
ApiException
- If fail to call the API, e.g. server error or cannot deserialize the response body
-
latestRatesWithHttpInfo
protected ApiResponse<ForexLatestRatesResp> latestRatesWithHttpInfo(String currencyPairs) throws ApiException Latest rates for currency pairs Get the latest forex rates for the given currency pairs.- Parameters:
currencyPairs
- (required)- Returns:
- ApiResponse<ForexLatestRatesResp>
- Throws:
ApiException
- If fail to call the API, e.g. server error or cannot deserialize the response body
-
latestRatesAsync
protected okhttp3.Call latestRatesAsync(String currencyPairs, ApiCallback<ForexLatestRatesResp> _callback) throws ApiException Latest rates for currency pairs (asynchronously) Get the latest forex rates for the given currency pairs.- Parameters:
currencyPairs
- (required)_callback
- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException
- If fail to process the API call, e.g. serializing the request body object
-
ratesCall
protected okhttp3.Call ratesCall(String currencyPairs, String timeframe, OffsetDateTime start, OffsetDateTime end, Long limit, Sort sort, String pageToken, ApiCallback _callback) throws ApiException Build call for rates- Parameters:
currencyPairs
- (required)timeframe
- (optional, default to 1Min)start
- The inclusive start of the interval. Format: RFC-3339 or YYYY-MM-DD. If missing, the default value is the beginning of the current day. (optional)end
- The inclusive end of the interval. Format: RFC-3339 or YYYY-MM-DD. If missing, the default value is the current time. (optional)limit
- Number of maximum data points to return in a response. The limit applies to the total number of data points, not per symbol! You can use the `next_page_token` to fetch the next at most `limit` responses. (optional, default to 1000)sort
- Sort data in ascending or descending order. (optional, default to asc)pageToken
- Pagination token to continue from. The value to pass here is returned in specific requests when more data is available than the request limit allows. (optional)_callback
- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException
- If fail to serialize the request body object
-
rates
public ForexRatesResp rates(String currencyPairs, String timeframe, OffsetDateTime start, OffsetDateTime end, Long limit, Sort sort, String pageToken) throws ApiException Historical rates for currency pairs Get historical forex rates for the given currency pairs in the given time interval, and at the given timeframe (snapshot frequency).- Parameters:
currencyPairs
- (required)timeframe
- (optional, default to 1Min)start
- The inclusive start of the interval. Format: RFC-3339 or YYYY-MM-DD. If missing, the default value is the beginning of the current day. (optional)end
- The inclusive end of the interval. Format: RFC-3339 or YYYY-MM-DD. If missing, the default value is the current time. (optional)limit
- Number of maximum data points to return in a response. The limit applies to the total number of data points, not per symbol! You can use the `next_page_token` to fetch the next at most `limit` responses. (optional, default to 1000)sort
- Sort data in ascending or descending order. (optional, default to asc)pageToken
- Pagination token to continue from. The value to pass here is returned in specific requests when more data is available than the request limit allows. (optional)- Returns:
- ForexRatesResp
- Throws:
ApiException
- If fail to call the API, e.g. server error or cannot deserialize the response body
-
ratesWithHttpInfo
protected ApiResponse<ForexRatesResp> ratesWithHttpInfo(String currencyPairs, String timeframe, OffsetDateTime start, OffsetDateTime end, Long limit, Sort sort, String pageToken) throws ApiException Historical rates for currency pairs Get historical forex rates for the given currency pairs in the given time interval, and at the given timeframe (snapshot frequency).- Parameters:
currencyPairs
- (required)timeframe
- (optional, default to 1Min)start
- The inclusive start of the interval. Format: RFC-3339 or YYYY-MM-DD. If missing, the default value is the beginning of the current day. (optional)end
- The inclusive end of the interval. Format: RFC-3339 or YYYY-MM-DD. If missing, the default value is the current time. (optional)limit
- Number of maximum data points to return in a response. The limit applies to the total number of data points, not per symbol! You can use the `next_page_token` to fetch the next at most `limit` responses. (optional, default to 1000)sort
- Sort data in ascending or descending order. (optional, default to asc)pageToken
- Pagination token to continue from. The value to pass here is returned in specific requests when more data is available than the request limit allows. (optional)- Returns:
- ApiResponse<ForexRatesResp>
- Throws:
ApiException
- If fail to call the API, e.g. server error or cannot deserialize the response body
-
ratesAsync
protected okhttp3.Call ratesAsync(String currencyPairs, String timeframe, OffsetDateTime start, OffsetDateTime end, Long limit, Sort sort, String pageToken, ApiCallback<ForexRatesResp> _callback) throws ApiException Historical rates for currency pairs (asynchronously) Get historical forex rates for the given currency pairs in the given time interval, and at the given timeframe (snapshot frequency).- Parameters:
currencyPairs
- (required)timeframe
- (optional, default to 1Min)start
- The inclusive start of the interval. Format: RFC-3339 or YYYY-MM-DD. If missing, the default value is the beginning of the current day. (optional)end
- The inclusive end of the interval. Format: RFC-3339 or YYYY-MM-DD. If missing, the default value is the current time. (optional)limit
- Number of maximum data points to return in a response. The limit applies to the total number of data points, not per symbol! You can use the `next_page_token` to fetch the next at most `limit` responses. (optional, default to 1000)sort
- Sort data in ascending or descending order. (optional, default to asc)pageToken
- Pagination token to continue from. The value to pass here is returned in specific requests when more data is available than the request limit allows. (optional)_callback
- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException
- If fail to process the API call, e.g. serializing the request body object
-