java.lang.Object
markets.alpaca.client.openapi.trading.api.ClockApi

public class ClockApi extends Object
Generated client for ClockApi operations.

This class is generated from the configured OpenAPI spec. Operation method Javadocs include OAS summaries, descriptions, parameters, return types, response details, and external documentation links when present in the spec.

Operations

  • clock: Get Market Clock
  • legacyClock: Get US Market Clock
  • Constructor Details

    • ClockApi

      public ClockApi()
    • ClockApi

      public ClockApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • getHostIndex

      public int getHostIndex()
    • setHostIndex

      public void setHostIndex(int hostIndex)
    • getCustomBaseUrl

      public String getCustomBaseUrl()
    • setCustomBaseUrl

      public void setCustomBaseUrl(String customBaseUrl)
    • clockCall

      public okhttp3.Call clockCall(@Nullable String markets, @Nullable OffsetDateTime time, ApiCallback _callback) throws ApiException
      Build call for clock
      Parameters:
      markets - Comma-separated list of markets. Available market codes by region: **United States** - `BMO`: Bank of Montreal. US banking calendar (US operations). - `BNYM`: The Bank of New York Mellon. US banking calendar. - `BOATS`: Blue Ocean Alternative Trading System. US overnight trading. - `IEX`: Investors Exchange. US equities. - `IEXG`: Investors Exchange. US equities. - `NASDAQ`: National Association of Securities Dealers Automated Quotations. US equities. - `NYSE`: New York Stock Exchange. US equities. - `OCEA`: BlueOcean ATS. US overnight trading. - `OPRA`: Options Price Reporting Authority. US options. - `OTC`: Over-The-Counter. US OTC equities. - `OTCM`: OTC Markets. US OTC equities. - `SIFMA`: Securities Industry and Financial Markets Association. US bonds. - `XNAS`: NASDAQ. US equities. - `XNYS`: New York Stock Exchange. US equities. **Europe** - `CEUX`: Cboe CEUX Europe. European equities (Cboe Netherlands). - `CHIX`: Cboe CHIX Europe. European equities (Cboe UK). - `ISE`: Euronext Dublin. Irish equities. - `LSE`: London Stock Exchange. UK equities. - `MTA`: Euronext Milan. Italian equities. - `MTAA`: Euronext Milan. Italian equities. - `XAMS`: Euronext Amsterdam. Dutch equities. - `XBRU`: Euronext Brussels. Belgian equities. - `XDUB`: Euronext Dublin. Irish equities. - `XETR`: Frankfurt Stock Exchange. German equities. - `XETRA`: Frankfurt Stock Exchange. German equities. - `XLIS`: Euronext Lisbon. Portuguese equities. - `XLON`: London Stock Exchange. UK equities. - `XPAR`: Euronext Paris. French equities. **Asia & Middle East** - `HKEX`: Hong Kong Stock Exchange. Hong Kong equities. - `JPX`: Japan Exchange Group. Japanese equities. - `TADAWUL`: Saudi Stock Exchange. Saudi equities. - `XHKG`: Hong Kong Stock Exchange. Hong Kong equities. - `XSAU`: Saudi Stock Exchange. Saudi equities. - `XTKS`: Japan Exchange Group. Japanese equities. (optional)
      time - Instead of the current time, use this time for the clock. (optional)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      400 One of the request parameters is invalid. See the returned message for details. * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      429 Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit. * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      500 Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum. -
    • clock

      public ClockResp clock(@Nullable String markets, @Nullable OffsetDateTime time) throws ApiException
      Get Market Clock This API serves information about multiple markets: the current time, if it's a market day, the current phase of the market, etc.
      Parameters:
      markets - Comma-separated list of markets. Available market codes by region: **United States** - `BMO`: Bank of Montreal. US banking calendar (US operations). - `BNYM`: The Bank of New York Mellon. US banking calendar. - `BOATS`: Blue Ocean Alternative Trading System. US overnight trading. - `IEX`: Investors Exchange. US equities. - `IEXG`: Investors Exchange. US equities. - `NASDAQ`: National Association of Securities Dealers Automated Quotations. US equities. - `NYSE`: New York Stock Exchange. US equities. - `OCEA`: BlueOcean ATS. US overnight trading. - `OPRA`: Options Price Reporting Authority. US options. - `OTC`: Over-The-Counter. US OTC equities. - `OTCM`: OTC Markets. US OTC equities. - `SIFMA`: Securities Industry and Financial Markets Association. US bonds. - `XNAS`: NASDAQ. US equities. - `XNYS`: New York Stock Exchange. US equities. **Europe** - `CEUX`: Cboe CEUX Europe. European equities (Cboe Netherlands). - `CHIX`: Cboe CHIX Europe. European equities (Cboe UK). - `ISE`: Euronext Dublin. Irish equities. - `LSE`: London Stock Exchange. UK equities. - `MTA`: Euronext Milan. Italian equities. - `MTAA`: Euronext Milan. Italian equities. - `XAMS`: Euronext Amsterdam. Dutch equities. - `XBRU`: Euronext Brussels. Belgian equities. - `XDUB`: Euronext Dublin. Irish equities. - `XETR`: Frankfurt Stock Exchange. German equities. - `XETRA`: Frankfurt Stock Exchange. German equities. - `XLIS`: Euronext Lisbon. Portuguese equities. - `XLON`: London Stock Exchange. UK equities. - `XPAR`: Euronext Paris. French equities. **Asia & Middle East** - `HKEX`: Hong Kong Stock Exchange. Hong Kong equities. - `JPX`: Japan Exchange Group. Japanese equities. - `TADAWUL`: Saudi Stock Exchange. Saudi equities. - `XHKG`: Hong Kong Stock Exchange. Hong Kong equities. - `XSAU`: Saudi Stock Exchange. Saudi equities. - `XTKS`: Japan Exchange Group. Japanese equities. (optional)
      time - Instead of the current time, use this time for the clock. (optional)
      Returns:
      ClockResp
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      400 One of the request parameters is invalid. See the returned message for details. * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      429 Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit. * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      500 Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum. -
    • clockWithHttpInfo

      public ApiResponse<ClockResp> clockWithHttpInfo(@Nullable String markets, @Nullable OffsetDateTime time) throws ApiException
      Get Market Clock This API serves information about multiple markets: the current time, if it's a market day, the current phase of the market, etc.
      Parameters:
      markets - Comma-separated list of markets. Available market codes by region: **United States** - `BMO`: Bank of Montreal. US banking calendar (US operations). - `BNYM`: The Bank of New York Mellon. US banking calendar. - `BOATS`: Blue Ocean Alternative Trading System. US overnight trading. - `IEX`: Investors Exchange. US equities. - `IEXG`: Investors Exchange. US equities. - `NASDAQ`: National Association of Securities Dealers Automated Quotations. US equities. - `NYSE`: New York Stock Exchange. US equities. - `OCEA`: BlueOcean ATS. US overnight trading. - `OPRA`: Options Price Reporting Authority. US options. - `OTC`: Over-The-Counter. US OTC equities. - `OTCM`: OTC Markets. US OTC equities. - `SIFMA`: Securities Industry and Financial Markets Association. US bonds. - `XNAS`: NASDAQ. US equities. - `XNYS`: New York Stock Exchange. US equities. **Europe** - `CEUX`: Cboe CEUX Europe. European equities (Cboe Netherlands). - `CHIX`: Cboe CHIX Europe. European equities (Cboe UK). - `ISE`: Euronext Dublin. Irish equities. - `LSE`: London Stock Exchange. UK equities. - `MTA`: Euronext Milan. Italian equities. - `MTAA`: Euronext Milan. Italian equities. - `XAMS`: Euronext Amsterdam. Dutch equities. - `XBRU`: Euronext Brussels. Belgian equities. - `XDUB`: Euronext Dublin. Irish equities. - `XETR`: Frankfurt Stock Exchange. German equities. - `XETRA`: Frankfurt Stock Exchange. German equities. - `XLIS`: Euronext Lisbon. Portuguese equities. - `XLON`: London Stock Exchange. UK equities. - `XPAR`: Euronext Paris. French equities. **Asia & Middle East** - `HKEX`: Hong Kong Stock Exchange. Hong Kong equities. - `JPX`: Japan Exchange Group. Japanese equities. - `TADAWUL`: Saudi Stock Exchange. Saudi equities. - `XHKG`: Hong Kong Stock Exchange. Hong Kong equities. - `XSAU`: Saudi Stock Exchange. Saudi equities. - `XTKS`: Japan Exchange Group. Japanese equities. (optional)
      time - Instead of the current time, use this time for the clock. (optional)
      Returns:
      ApiResponse<ClockResp>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      400 One of the request parameters is invalid. See the returned message for details. * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      429 Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit. * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      500 Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum. -
    • clockAsync

      public okhttp3.Call clockAsync(@Nullable String markets, @Nullable OffsetDateTime time, ApiCallback<ClockResp> _callback) throws ApiException
      Get Market Clock (asynchronously) This API serves information about multiple markets: the current time, if it's a market day, the current phase of the market, etc.
      Parameters:
      markets - Comma-separated list of markets. Available market codes by region: **United States** - `BMO`: Bank of Montreal. US banking calendar (US operations). - `BNYM`: The Bank of New York Mellon. US banking calendar. - `BOATS`: Blue Ocean Alternative Trading System. US overnight trading. - `IEX`: Investors Exchange. US equities. - `IEXG`: Investors Exchange. US equities. - `NASDAQ`: National Association of Securities Dealers Automated Quotations. US equities. - `NYSE`: New York Stock Exchange. US equities. - `OCEA`: BlueOcean ATS. US overnight trading. - `OPRA`: Options Price Reporting Authority. US options. - `OTC`: Over-The-Counter. US OTC equities. - `OTCM`: OTC Markets. US OTC equities. - `SIFMA`: Securities Industry and Financial Markets Association. US bonds. - `XNAS`: NASDAQ. US equities. - `XNYS`: New York Stock Exchange. US equities. **Europe** - `CEUX`: Cboe CEUX Europe. European equities (Cboe Netherlands). - `CHIX`: Cboe CHIX Europe. European equities (Cboe UK). - `ISE`: Euronext Dublin. Irish equities. - `LSE`: London Stock Exchange. UK equities. - `MTA`: Euronext Milan. Italian equities. - `MTAA`: Euronext Milan. Italian equities. - `XAMS`: Euronext Amsterdam. Dutch equities. - `XBRU`: Euronext Brussels. Belgian equities. - `XDUB`: Euronext Dublin. Irish equities. - `XETR`: Frankfurt Stock Exchange. German equities. - `XETRA`: Frankfurt Stock Exchange. German equities. - `XLIS`: Euronext Lisbon. Portuguese equities. - `XLON`: London Stock Exchange. UK equities. - `XPAR`: Euronext Paris. French equities. **Asia & Middle East** - `HKEX`: Hong Kong Stock Exchange. Hong Kong equities. - `JPX`: Japan Exchange Group. Japanese equities. - `TADAWUL`: Saudi Stock Exchange. Saudi equities. - `XHKG`: Hong Kong Stock Exchange. Hong Kong equities. - `XSAU`: Saudi Stock Exchange. Saudi equities. - `XTKS`: Japan Exchange Group. Japanese equities. (optional)
      time - Instead of the current time, use this time for the clock. (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
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      400 One of the request parameters is invalid. See the returned message for details. * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      429 Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit. * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      500 Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum. -
    • legacyClockCall

      public okhttp3.Call legacyClockCall(ApiCallback _callback) throws ApiException
      Build call for legacyClock
      Parameters:
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      429 Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit. * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      500 Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum. -
    • legacyClock

      public LegacyClock legacyClock() throws ApiException
      Get US Market Clock The clock API serves the current market timestamp, whether or not the market is currently open, as well as the times of the next market open and close.
      Returns:
      LegacyClock
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      429 Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit. * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      500 Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum. -
    • legacyClockWithHttpInfo

      public ApiResponse<LegacyClock> legacyClockWithHttpInfo() throws ApiException
      Get US Market Clock The clock API serves the current market timestamp, whether or not the market is currently open, as well as the times of the next market open and close.
      Returns:
      ApiResponse<LegacyClock>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      429 Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit. * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      500 Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum. -
    • legacyClockAsync

      public okhttp3.Call legacyClockAsync(ApiCallback<LegacyClock> _callback) throws ApiException
      Get US Market Clock (asynchronously) The clock API serves the current market timestamp, whether or not the market is currently open, as well as the times of the next market open and close.
      Parameters:
      _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
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      429 Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit. * X-RateLimit-Limit -
      * X-RateLimit-Remaining -
      * X-RateLimit-Reset -
      500 Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum. -