java.lang.Object
net.jacobpeterson.alpaca.openapi.marketdata.api.ForexApi

public class ForexApi extends Object
  • Constructor Details

    • ForexApi

      public ForexApi()
    • ForexApi

      public ForexApi(ApiClient apiClient)
  • 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

      public ForexLatestRatesResp latestRates(String currencyPairs) throws ApiException
      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 - The maximum number of data points to return in the response. The API may return less, even if there are more available data points in the requested interval. Always check the next_page_token for more pages. The limit applies to the total number of data points, not per symbol! (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 - The maximum number of data points to return in the response. The API may return less, even if there are more available data points in the requested interval. Always check the next_page_token for more pages. The limit applies to the total number of data points, not per symbol! (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 - The maximum number of data points to return in the response. The API may return less, even if there are more available data points in the requested interval. Always check the next_page_token for more pages. The limit applies to the total number of data points, not per symbol! (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 - The maximum number of data points to return in the response. The API may return less, even if there are more available data points in the requested interval. Always check the next_page_token for more pages. The limit applies to the total number of data points, not per symbol! (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