Loading the API reference…

Browse the API reference

Get a market's current trading state

get https://quant-ws.prod.thinkalpha.io/markets/{marketIdentifierCode}/state

Returns the trading state of a market at this instant: whether it is open, the phase it is in, the trading session (local date) it belongs to, and the next open and close. asOf is the server's clock at request time, so the state always reflects "now".

A phase counts as open when its type is named in openPhases; when openPhases is absent or empty, every phase whose status is not Closed counts. A phase wholly inside an open phase (for example an opening auction) does not end the stretch, and touching or overlapping open phases form one open stretch. The schedule search expands in three-day steps up to 15 local calendar days on either side of today; whole phases returned by the calendar can extend beyond the search window. nextOpen or nextClose is null when the loaded schedule does not show that transition.

To count only the primary trading session as open, send regularHoursOnly=true; it cannot be combined with openPhases. For scheduled phases over a range rather than the state right now, use GET /markets/{marketIdentifierCode}/trading-hours.

Authentication
Bearer token or Client credentials (HTTP Basic)

Path parameters

  • marketIdentifierCode string required

    The ISO 10383 market identifier code (MIC) of a market listed in the market master.

Query parameters

  • openPhases PhaseType[]

    Phase types that count as open; repeat the parameter for several. When present, only the named types count as open (this replaces the default rule); when absent, every phase whose `status` is not `Closed` counts. Cannot be combined with `regularHoursOnly`.

  • regularHoursOnly boolean | string

    When `true`, count only the primary trading session as open. Cannot be combined with `openPhases`.

Responses

Trading state of a market at an instant.

  • marketIdentifierCode string required

    The MIC the state describes (echoes the requested market).

  • timezone string required

    The IANA time zone of the market, which defines its local dates.

  • asOf string<date-time> required

    The instant the state describes; the server's clock at request time.

  • session string<date> required

    The market-local date of the current open phase, or of the latest one before `asOf`; today when there is none.

  • isOpen boolean required

    Whether the market is open at `asOf`.

  • SpecificTradingSchedule nullable required

    The phase containing `asOf` (an open one while open). The operation answers 404 instead when no phase covers `asOf`, so a successful response always carries one.

  • SpecificTradingSchedule[] required

    Every phase that starts on the session date.

  • MarketPhaseTransition nullable required

    The start of the next open stretch after `asOf`, with its first phase; `null` when none appears in the loaded schedule. The search reaches up to 15 local calendar days on either side of today, and whole phases can extend beyond the search window.

  • MarketPhaseTransition nullable required

    The end of the current open stretch, or of the next one while closed, with the phase that begins then; `null` when the loaded schedule does not show the transition. The search reaches up to 15 local calendar days on either side of today, and whole phases can extend beyond the search window.