Diurn
Docs / typescript

TypeScript client

npm install diurn, version 0.1.0, Node >=20 and browsers. Exchange calendars and trading hours for the world's markets, from the Diurn API. The guide and the reference below are generated from the package itself, so they describe exactly this version.

Guide

Exchange calendars and trading hours for the world's markets, from the Diurn API: every session, holiday and early close, keyed by MIC.

npm install diurn

An API key is free at https://diurn.io/signin/; set DIURN_API_KEY.

The package has no dependencies and runs in Node (20 and later), Deno, Bun and browsers. Dates and times are Temporal values: Temporal.PlainDate for a day, Temporal.ZonedDateTime in the venue's own zone for a session's times. Where the runtime has Temporal built in, it is used; elsewhere (Node, for now) pass one from a polyfill:

import { Client } from "diurn";
import { Temporal } from "temporal-polyfill"; // or @js-temporal/polyfill

const client = new Client({ temporal: Temporal });

Without either, new Client() throws NoTemporal. Types need TypeScript 6.0 or later, which ships Temporal's.

A calendar

Load a venue's calendar for a range once, then ask it anything about that range without another request. The names are exchange_calendars', in camelCase:

const xnys = await client.calendar("XNYS", "2026-01-01", "2026-12-31");

xnys.isSession("2026-11-26");            // false: Thanksgiving
xnys.nextSession("2026-11-25");          // 2026-11-27
xnys.sessionClose("2026-11-27");         // 2026-11-27T13:00:00-05:00[America/New_York]
xnys.sessionsDistance("2026-11-01", "2026-11-30"); // 20
xnys.isOpenAtTime("2026-11-27T17:30:00Z");         // true
xnys.schedule("2026-11-24", "2026-11-30");         // open, break, close per session

const xtks = await client.calendar("XTKS", "2026-11-01", "2026-11-30");
xtks.sessionBreakStart("2026-11-02");    // 11:30, Tokyo's lunch

Dates may be Temporal.PlainDate or "YYYY-MM-DD"; instants a Temporal.Instant, a ZonedDateTime, or an ISO string with an offset.

Nothing is guessed. A day Diurn cannot answer is neither open nor closed: a question that depends on it throws Indeterminate. A question that reaches past the loaded range throws OutsideLoaded, rather than fetching more behind your back; load a wider range. A session is what /v1/trading-days counts: an open day, an early close, a day open for some products, or a holiday that still trades (NSE's Muhurat session).

A venue with product schedules (CME's Equity Index, Energy and Metals, ...) answers for one with { product }:

const cme = await client.calendar("XCEC", "2026-01-01", "2026-12-31", { product: "Equity Index" });
cme.products; // the schedules it keeps

The API

Every endpoint is a method returning the API's shapes as typed objects, with camelCase fields and Temporal dates:

const now = await client.statuses(["XNYS", "XLON", "XTKS"]);
now.venues["XLON"]?.state;               // "running", "closed", ...

const step = await client.nextTradingDay("XNYS", "2026-11-25");
step.date;                               // 2026-11-27
step.skipped[0]?.reason;                 // "Thanksgiving Day"

const joint = await client.jointNextTradingDay(["XNYS", "XLON"], "2026-12-23", { n: 2 });
const days = await client.exceptions(["XNYS", "XLON"], "2026-11-01", "2026-12-31");

Also health, venue, venues, usage, sessions, day, status, nextOpen, nextClose, previousTradingDay, countTradingDays, sessionsBulk, tradingDays and jointPreviousTradingDay. Options go in a trailing object; on Enterprise, every data method takes asOf to answer from the dataset Diurn was serving at an instant. client.lastHeaders holds the last response's usage headers.

A client is set up with apiKey, baseUrl (DIURN_API_URL), timeoutMs, retries, maxWaitMs, backoffMs, temporal and fetch. Retries are off by default. With retries, a rate limit is waited out after the server's Retry-After, and a 503 or a failed connection backs off from half a second; a plan's refusal is never retried, and a wait longer than maxWaitMs is thrown rather than slept.

Errors

Typed, never prose; test them with instanceof. All extend DiurnError: AuthError (no or inactive key), UnknownVenue, BadRequest, NotInPlan, OutOfWindow (with allowedFrom and allowedTo), MicCapExceeded (with micsInUse and resetsAt), RateLimited (with retryAfterMs), OverLimit (any other plan refusal), Unavailable, Indeterminate (with date), TransportError, DecodeError, InvalidMic, InvalidArgument, OutsideLoaded, NotASession and NoTemporal. An error from the API extends ApiError and keeps its response: error.body.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Calendars

One venue's calendar over a loaded range: client.calendar(...) fetches it once, and every method then answers synchronously.

Calendarclass

class Calendar

One venue's trading calendar over the range of dates it was loaded with.

  • nameproperty
    readonly name: string

    The venue's MIC: a calendar's name, as exchange_calendars names one by its code.

  • marketNameproperty
    readonly marketName: string

    The venue's name in the ISO 10383 registry.

  • tzproperty
    readonly tz: string

    The IANA zone the venue's sessions are quoted in.

  • productsproperty
    readonly products: readonly string[]

    The product schedules the venue keeps; empty for almost every one.

  • productproperty
    readonly product: string | undefined

    The product schedule this calendar answers for, if one was chosen.

  • fromproperty
    readonly from: Temporal.PlainDate

    The first and last dates loaded.

  • toproperty
    readonly to: Temporal.PlainDate
  • daysproperty
    readonly days: readonly Day[]

    Every day loaded, in order.

  • daymethod
    day(date: DateLike): Day

    The day, whatever its kind.

  • isSessionmethod
    isSession(date: DateLike): boolean

    Whether the venue trades on the date.

  • sessionsInRangemethod
    sessionsInRange(from: DateLike, to: DateLike): Temporal.PlainDate[]

    The sessions from from to to, inclusive.

  • nextSessionmethod
    nextSession(date: DateLike): Temporal.PlainDate

    The first session after date, which need not be a session itself.

  • previousSessionmethod
    previousSession(date: DateLike): Temporal.PlainDate

    The last session before date, which need not be a session itself.

  • dateToSessionmethod
    dateToSession(date: DateLike, direction?: "none" | "next" | "previous"): Temporal.PlainDate

    date if it is a session; otherwise the next or previous one, or with "none", NotASession.

  • sessionsWindowmethod
    sessionsWindow(session: DateLike, count: number): Temporal.PlainDate[]

    |count| sessions from session: forwards for a positive count, backwards and ending at session for a negative one.

  • sessionsDistancemethod
    sessionsDistance(start: DateLike, end: DateLike): number

    The number of sessions from start to end, both included; negative when end is before start. A range with an unknown day throws Indeterminate: a count that skipped it would be wrong.

  • isOpenAtTimemethod
    isOpenAtTime(at: InstantLike): boolean

    Whether a session is running at the instant, outside its breaks.

  • nextOpenmethod
    nextOpen(after: InstantLike): Temporal.ZonedDateTime

    The first session open after the instant.

  • nextClosemethod
    nextClose(after: InstantLike): Temporal.ZonedDateTime

    The first session close after the instant.

  • sessionOpenmethod
    sessionOpen(session: DateLike): Temporal.ZonedDateTime | undefined

    The session's first open; undefined where Diurn holds no hours for it.

  • sessionClosemethod
    sessionClose(session: DateLike): Temporal.ZonedDateTime | undefined

    The session's last close.

  • sessionBreakStartmethod
    sessionBreakStart(session: DateLike): Temporal.ZonedDateTime | undefined

    The start of the session's break (Tokyo's lunch); undefined without one.

  • sessionBreakEndmethod
    sessionBreakEnd(session: DateLike): Temporal.ZonedDateTime | undefined

    The end of the session's break.

  • schedulemethod
    schedule(from: DateLike, to: DateLike, options?: { allDays?: boolean }): ScheduleRow[]

    One row per session from from to to; with allDays, one per day, so holidays and unknown days appear with their kind and no times.

CalendarOptionsinterface

interface CalendarOptions

How a calendar is loaded, beyond its venue and range.

  • productproperty
    product?: string

    One of the venue's product schedules (see products); by default the whole venue's sessions are used.

  • asOfproperty
    asOf?: InstantLike

    Answer from the dataset Diurn was serving at this instant (Enterprise).

Dayinterface

interface Day

One day of the calendar.

  • dateproperty
    readonly date: Temporal.PlainDate
  • kindproperty
    readonly kind: DayKindDto
  • verificationproperty
    readonly verification: VerificationDto
  • reasonproperty
    readonly reason: string | undefined

    Why it is not an ordinary day (a holiday's name).

  • sessionsproperty
    readonly sessions: readonly Session[]

Sessioninterface

interface Session

One session: open and close in the venue's zone, its breaks, and the product it is for (undefined: the whole venue).

  • nameproperty
    readonly name: string
  • openproperty
    readonly open: Temporal.ZonedDateTime
  • closeproperty
    readonly close: Temporal.ZonedDateTime
  • breaksproperty
    readonly breaks: readonly readonly [Temporal.ZonedDateTime, Temporal.ZonedDateTime][]

    Pauses inside it (Hong Kong's lunch), start and end.

  • productsproperty
    readonly products: string | undefined
  • verificationproperty
    readonly verification: VerificationDto

ScheduleRowinterface

interface ScheduleRow

A day's schedule as exchange_calendars lays it out: the first open, the last close, and the first break between them; plus Diurn's kind, verification and reason. Times are undefined where Diurn holds no hours for the day.

  • dateproperty
    readonly date: Temporal.PlainDate
  • openproperty
    readonly open: Temporal.ZonedDateTime | undefined
  • breakStartproperty
    readonly breakStart: Temporal.ZonedDateTime | undefined
  • breakEndproperty
    readonly breakEnd: Temporal.ZonedDateTime | undefined
  • closeproperty
    readonly close: Temporal.ZonedDateTime | undefined
  • kindproperty
    readonly kind: DayKindDto
  • verificationproperty
    readonly verification: VerificationDto
  • reasonproperty
    readonly reason: string | undefined

isSessionDayfunction

function isSessionDay(day: Day): boolean

Whether the venue trades: as /v1/trading-days reads a day.

The API client

One method per API operation, returning the response types below. Options go in a trailing object.

Clientclass

class Client

A connection to the Diurn API.

const client = new Client(); // DIURN_API_KEY, DIURN_API_URL
const now = await client.statuses(["XNYS", "XLON", "XTKS"]);

Every endpoint but the registry record, health and the venue list needs a key; a free one is at https://diurn.io/signin/.

Retries are off by default. With retries, a client retries what waiting can fix: a rate limit, after the server's Retry-After; a 503 or a failed connection, backing off from half a second. A plan's refusal (a MIC cap, a date outside the window) is never retried, and a wait longer than maxWaitMs is thrown rather than slept.

  • constructorconstructor
    new Client(options?: ClientOptions)
  • temporalproperty
    readonly temporal: typeof Temporal

    The Temporal this client builds its dates and instants with: the runtime's, or the one it was given.

  • lastHeadersproperty
    get lastHeaders(): Record<string, string>

    The headers of the last response, lower-cased: the usage headers (diurn-mics-day, ratelimit-remaining, ...) and x-diurn-dataset.

  • healthmethod
    health(): Promise<Health>

    Liveness, and which dataset the server is serving. Free.

  • venuemethod
    venue(code: string): Promise<VenueResponse>

    The ISO 10383 record, with the venue's zone, how it is answered, and its product schedules. Free and unmetered.

  • venuesmethod
    venues(query?: VenuesQuery): Promise<VenuesResponse>

    List and search venues, a page at a time. Free and unmetered.

  • usagemethod
    usage(): Promise<UsageView>

    Your usage against your plan. Needs a key; never metered.

  • sessionsmethod
    sessions(code: string, from: DateLike, to: DateLike, options?: SessionsOptions): Promise<DaysResponse>

    Every day from from to to, inclusive, with its sessions.

  • daymethod
    day(code: string, date: DateLike, options?: AsOf): Promise<DayResponse>

    One day, with its provenance in full on plans that include it.

  • statusmethod
    status(code: string, options?: StatusOptions): Promise<StatusResponse>

    Whether the venue is trading at an instant (now, unless at is given).

  • nextOpenmethod
    nextOpen(code: string, from: InstantLike, options?: AsOf): Promise<InstantResponse>

    The next instant the venue starts trading, after from.

  • nextClosemethod
    nextClose(code: string, from: InstantLike, options?: AsOf): Promise<InstantResponse>

    The next instant the venue stops trading, after from.

  • nextTradingDaymethod
    nextTradingDay(code: string, from: DateLike, options?: StepOptions): Promise<StepResponse>

    The nth trading day after from, with the closures passed over.

  • previousTradingDaymethod
    previousTradingDay(code: string, from: DateLike, options?: StepOptions): Promise<StepResponse>

    The nth trading day before from.

  • countTradingDaysmethod
    countTradingDays(code: string, from: DateLike, to: DateLike, options?: AsOf): Promise<CountResponse>

    Trading days from from to to, inclusive; a lower bound where unknown is above zero.

  • statusesmethod
    statuses(codes: Iterable<string>, options?: StatusOptions): Promise<StatusesResponse>

    Whether several venues are trading at an instant (now, unless at is given).

  • exceptionsmethod
    exceptions(codes: Iterable<string>, from: DateLike, to: DateLike, options?: ExceptionsOptions): Promise<ExceptionsResponse>

    Holidays and irregular days across venues, one row each, by date then MIC.

  • sessionsBulkmethod
    sessionsBulk(codes: Iterable<string>, from: DateLike, to: DateLike, options?: AsOf): Promise<BulkResponse>

    Many venues over a range, column-oriented.

  • tradingDaysmethod
    tradingDays(codes: Iterable<string>, from: DateLike, to: DateLike, options?: AsOf): Promise<TradingDaysResponse>

    A date-and-boolean series per venue; null where it cannot say.

  • jointNextTradingDaymethod
    jointNextTradingDay(codes: Iterable<string>, from: DateLike, options?: JointOptions): Promise<JointStepResponse>

    The nth date after from on which all (or any) of the venues trade.

  • jointPreviousTradingDaymethod
    jointPreviousTradingDay(codes: Iterable<string>, from: DateLike, options?: JointOptions): Promise<JointStepResponse>

    The nth date before from on which all (or any) of the venues trade.

  • calendarmethod
    calendar(code: string, from: DateLike, to: DateLike, options?: CalendarOptions): Promise<Calendar>

    A venue's calendar from from to to, loaded once: one call for the venue's record and one per 1,830 days of sessions. Every question a Calendar answers is then answered from what was loaded, without another request.

ClientOptionsinterface

interface ClientOptions

How a client is set up. Every field is optional.

  • apiKeyproperty
    apiKey?: string

    The API key; by default DIURN_API_KEY where the runtime has an environment. A free one is at https://diurn.io/signin/.

  • baseUrlproperty
    baseUrl?: string

    The API's address; by default DIURN_API_URL, else https://api.diurn.io.

  • timeoutMsproperty
    timeoutMs?: number

    How long one request may take, in milliseconds; 30,000 by default.

  • retriesproperty
    retries?: number

    How many times to retry what waiting can fix; 0 by default.

  • maxWaitMsproperty
    maxWaitMs?: number

    The longest single wait before a retry, in milliseconds; 60,000 by default. A server asking for longer gets its error thrown instead.

  • backoffMsproperty
    backoffMs?: number

    The first wait after a 503 or a failed connection, doubling each time; 500 milliseconds by default.

  • temporalproperty
    temporal?: typeof Temporal

    The Temporal to use where the runtime has none (temporal-polyfill).

  • fetchproperty
    fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

    The fetch to send with; the runtime's by default.

DateLiketype

type DateLike = Temporal.PlainDate | string

A date: a Temporal.PlainDate, or "YYYY-MM-DD".

InstantLiketype

type InstantLike = Temporal.Instant | Temporal.ZonedDateTime | string

An instant: a Temporal.Instant or ZonedDateTime, or an ISO string with an offset or Z. A string without one is refused: it is not an instant.

AsOfinterface

interface AsOf

Only answer from the dataset Diurn was serving at this instant (Enterprise).

  • asOfproperty
    asOf?: InstantLike

SessionsOptionsinterface

interface SessionsOptions extends AsOf

Only answer from the dataset Diurn was serving at this instant (Enterprise).

  • kindsproperty
    kinds?: DayKindDto[]

    Only days of these kinds; all days when absent.

  • provenanceproperty
    provenance?: boolean

    The evidence behind each day, on plans that include it.

StatusOptionsinterface

interface StatusOptions extends AsOf

Only answer from the dataset Diurn was serving at this instant (Enterprise).

  • atproperty
    at?: InstantLike

    The instant asked about; now by default.

ExceptionsOptionsinterface

interface ExceptionsOptions extends AsOf

Only answer from the dataset Diurn was serving at this instant (Enterprise).

  • kindsproperty
    kinds?: DayKindDto[]

    The kinds wanted; by default holiday, early_close, open_for_some, unknown.

StepOptionsinterface

interface StepOptions extends AsOf

Only answer from the dataset Diurn was serving at this instant (Enterprise).

  • nproperty
    n?: number

    Trading days to move; 1 by default, at most 366.

  • inclusiveproperty
    inclusive?: boolean

    Count the starting date itself when it trades.

  • onUnknownproperty
    onUnknown?: "error" | "skip"

    Reaching an unknown day: error (default, throws Indeterminate) or skip.

JointOptionsinterface

interface JointOptions extends StepOptions

Only answer from the dataset Diurn was serving at this instant (Enterprise).

  • modeproperty
    mode?: "all" | "any"

    all (default): every venue trades; any: at least one does.

VenuesQueryinterface

interface VenuesQuery

Filters for Client.venues; everything by default.

  • qproperty
    q?: string

    Case-insensitive match on MIC, operating MIC, name or acronym.

  • countryproperty
    country?: string

    ISO 3166-1 alpha-2.

  • resolutionproperty
    resolution?: string[]

    own, operating_mic, country or none.

  • statusproperty
    status?: string[]

    Registry statuses (active, updated, expired) or all; active by default.

  • limitproperty
    limit?: number

    At most 1,000; 100 by default.

  • cursorproperty
    cursor?: string

    nextCursor from the previous page.

micfunction

function mic(code: string): string

A MIC, checked and upper-cased before any request.

VERSIONconstant

const VERSION: "0.1.0"

Errors

Every error the package throws is a DiurnError; test them with instanceof.

DiurnErrorexception

class DiurnError extends Error

Every error this package throws.

ApiErrorexception

class ApiError extends DiurnError

The API answered with an error. error is its stable tag; body the response as sent, for anything not lifted into a field.

  • statusproperty
    readonly status: number
  • errorproperty
    readonly error: string
  • bodyproperty
    readonly body: Record<string, unknown>

DecodeErrorexception

class DecodeError extends DiurnError

A response that does not have the shape it should.

Indeterminateexception

class Indeterminate extends DiurnError

Diurn cannot say whether the market trades on a date: the API's 422 indeterminate, or a calendar asked about an unknown day. Diurn never reports such a day as open or closed.

  • dateproperty
    readonly date: Temporal.PlainDate | undefined
  • responseproperty
    readonly response: ApiError | undefined

    The API's response, when the API said so.

InvalidArgumentexception

class InvalidArgument extends DiurnError

An argument the API would refuse, caught before any request.

InvalidMicexception

class InvalidMic extends DiurnError

Not a MIC: four characters, letters and digits.

  • micproperty
    readonly mic: string

NoTemporalexception

class NoTemporal extends DiurnError

No Temporal to work with: this runtime has none built in, and none was given. Pass one: new Client({ temporal: Temporal }), with Temporal from temporal-polyfill (or @js-temporal/polyfill).

NotASessionexception

class NotASession extends DiurnError

A date that is not a session, where one was required.

  • dateproperty
    readonly date: Temporal.PlainDate

OutsideLoadedexception

class OutsideLoaded extends DiurnError

A calendar was asked about a date outside the range it loaded. It never fetches more on its own: load a wider range.

  • dateproperty
    readonly date: Temporal.PlainDate
  • fromproperty
    readonly from: Temporal.PlainDate
  • toproperty
    readonly to: Temporal.PlainDate

TransportErrorexception

class TransportError extends DiurnError

The API could not be reached, or answered with something that is not the API (a proxy's page, a broken connection, a timeout).

AuthErrorexception

class AuthError extends ApiError

No key (needs_key), or a key that is not active (unauthorized). Keys are free at https://diurn.io/signin/; set DIURN_API_KEY or pass apiKey.

BadRequestexception

class BadRequest extends ApiError

The request could not be understood: a malformed date, too many days, or asOf outside the archive's record.

OverLimitexception

class OverLimit extends ApiError

A refusal from the plan's limits. limit is {kind, used, max} where the API sends it; resetsAt when the limit eases; upgrade where to get more.

  • limitproperty
    readonly limit: Record<string, unknown> | undefined
  • resetsAtproperty
    readonly resetsAt: Temporal.Instant | undefined
  • upgradeproperty
    readonly upgrade: string | undefined

Unavailableexception

class Unavailable extends ApiError

The service could not answer just now (503), for example an asOf dataset that could not be loaded.

  • retryAfterMsproperty
    readonly retryAfterMs: number | undefined

    The server's Retry-After, in milliseconds, where it sent one.

UnknownVenueexception

class UnknownVenue extends ApiError

No such MIC, or no calendar answers it.

MicCapExceededexception

class MicCapExceeded extends OverLimit

Asking for this MIC would exceed a unique-MIC cap (429). Asking again for one of micsInUse is free.

  • micsInUseproperty
    readonly micsInUse: string[]

NotInPlanexception

class NotInPlan extends OverLimit

The plan does not include this: an endpoint, provenance or asOf (403).

OutOfWindowexception

class OutOfWindow extends OverLimit

Dates outside the plan's window (403), refused rather than trimmed. undefined is unbounded.

  • allowedFromproperty
    readonly allowedFrom: Temporal.PlainDate | undefined
  • allowedToproperty
    readonly allowedTo: Temporal.PlainDate | undefined

RateLimitedexception

class RateLimited extends OverLimit

Too many requests a minute (429).

  • retryAfterMsproperty
    readonly retryAfterMs: number | undefined

    The server's Retry-After, in milliseconds, where it sent one.

Response types

What Client returns, exported as the models namespace: generated from the API's OpenAPI document, one interface per response shape, with camelCase fields and Temporal dates.

ApiErrorinterface

interface ApiError

Typed, because SPEC: client-shared-surface requires every client to distinguish auth failure from an unknown calendar from an out-of-range query, and it cannot if the server returns prose.

errorstring
messagestring

BreakDtointerface

interface BreakDto
endTemporal.ZonedDateTime
startTemporal.ZonedDateTime

BulkBodyinterface

interface BulkBody
asOf?Temporal.Instant
fromTemporal.PlainDate
micsstring[]
toTemporal.PlainDate

BulkCalendarinterface

interface BulkCalendar
kindsstring
verificationstring

BulkResponseinterface

interface BulkResponse

Column-oriented: the dates once, then one short code per day per calendar.

asOf?Temporal.Instant
dataset?DatasetServed
datesTemporal.PlainDate[]
fromTemporal.PlainDate
legendLegend
toTemporal.PlainDate
venuesRecord<string, BulkCalendar>

CountResponseinterface

interface CountResponse
asOf?Temporal.Instant
countnumber
dataset?DatasetServed
fromTemporal.PlainDate
micstring
toTemporal.PlainDate
unknownnumber

DataWindowinterface

interface DataWindow

The dates the plan may ask about, from today (UTC). Null is unbounded.

from?Temporal.PlainDate
to?Temporal.PlainDate

DatasetServedinterface

interface DatasetServed

The dataset that answered an as_of request (SPEC-pricing §5.1).

idstring
reconstructedboolean
servedFromTemporal.Instant
servedUntil?Temporal.Instant

DayDtointerface

interface DayDto
dateTemporal.PlainDate
kindDayKindDto
products?ProductSplitDto
provenance?Provenance
reason?string
sessionsSessionDto[]
verificationVerificationDto

DayKindDtotype

type DayKindDto = "open" | "weekend" | "holiday" | "early_close" | "open_for_some" | "unknown"

DayResponseinterface

interface DayResponse

One day, and with as_of, which dataset answered.

dateTemporal.PlainDate
kindDayKindDto
products?ProductSplitDto
provenance?Provenance
reason?string
sessionsSessionDto[]
verificationVerificationDto
asOf?Temporal.Instant
dataset?DatasetServed

DaysResponseinterface

interface DaysResponse
asOf?Temporal.Instant
dataset?DatasetServed
daysDayDto[]
mic?string

ExceptionsBodyinterface

interface ExceptionsBody
asOf?Temporal.Instant
fromTemporal.PlainDate
kindsstring[]
micsstring[]
toTemporal.PlainDate

ExceptionsResponseinterface

interface ExceptionsResponse
asOf?Temporal.Instant
dataset?DatasetServed
daysVenueDay[]
fromTemporal.PlainDate
toTemporal.PlainDate

Healthinterface

interface Health
artifactstring
builtAtTemporal.Instant
datasetstring
mappedVenuesnumber
registryPublishedTemporal.PlainDate
statusstring

InstantResponseinterface

interface InstantResponse
asOf?Temporal.Instant
at?Temporal.ZonedDateTime
dataset?DatasetServed
fromTemporal.Instant
mic?string

JointSkippedinterface

interface JointSkipped

A date passed over: the venues that did not trade it, other than for a weekend.

closedRecord<string, SkippedDay>
dateTemporal.PlainDate

JointStepBodyinterface

interface JointStepBody
asOf?Temporal.Instant
fromTemporal.PlainDate
inclusive?boolean
micsstring[]
mode?string
n?number
onUnknown?string

JointStepResponseinterface

interface JointStepResponse
asOf?Temporal.Instant
dataset?DatasetServed
dateTemporal.PlainDate
fromTemporal.PlainDate
micsstring[]
modestring
nnumber
skippedJointSkipped[]
unknownSkippedTemporal.PlainDate[]
venuesRecord<string, DayKindDto>

Legendinterface

interface Legend
kindsRecord<string, string>
verificationRecord<string, string>

MicWindowinterface

interface MicWindow

One MIC cap's count (SPEC-pricing §6.4). max is null on a plan with every MIC.

max?number
mics?string[]
resetsAt?Temporal.Instant
usednumber
windowstring

OverLimitinterface

interface OverLimit
allowed?OverLimitAllowed
errorOverLimitError
limit?OverLimitLimit
messagestring
micsInUsestring[]
resetsAt?Temporal.Instant
upgrade?string

OverLimitAllowedinterface

interface OverLimitAllowed

For out_of_window: the dates the plan may ask about; null is unbounded

from?Temporal.PlainDate
to?Temporal.PlainDate

OverLimitErrortype

type OverLimitError = "not_in_plan" | "out_of_window" | "mic_cap_exceeded" | "rate_limited"

OverLimitLimitinterface

interface OverLimitLimit
kind?OverLimitLimitKind
max?number
used?number

ProductSplitDtointerface

interface ProductSplitDto

Which products traded on a day that did not treat them alike.

closedstring[]
note?string
openstring[]

Provenanceinterface

interface Provenance

The evidence behind a day. Only ever sent when asked for.

retrieved?Temporal.PlainDate
source?string

Rateinterface

interface Rate
bulkPerMinutenumber
perMinutenumber

ResolutionDtointerface

interface ResolutionDto

How a MIC reaches its answer (SPEC: calendar-membership). The MIC pages state the same.

kindstring
viastring

RunningSessioninterface

interface RunningSession
closeTemporal.ZonedDateTime
namestring
openTemporal.ZonedDateTime
products?string
tradeDateTemporal.PlainDate
verificationVerificationDto

SessionDtointerface

interface SessionDto
breaksBreakDto[]
closeTemporal.ZonedDateTime
namestring
openTemporal.ZonedDateTime
products?string
provenance?Provenance
verificationVerificationDto

SkippedDayinterface

interface SkippedDay

A day stepped over: not a weekend, and not trading.

dateTemporal.PlainDate
kindDayKindDto
reason?string

StateDtotype

type StateDto = "running" | "closed" | "unknown"

Whether the venue is trading at an instant — the intraday axis.

StatusResponseinterface

interface StatusResponse
asOf?Temporal.Instant
atTemporal.Instant
dataset?DatasetServed
dayDayDto
mic?string
nextClose?Temporal.ZonedDateTime
nextOpen?Temporal.ZonedDateTime
running?RunningSession
stateStateDto

StatusesBodyinterface

interface StatusesBody
asOf?Temporal.Instant
at?Temporal.Instant
micsstring[]

StatusesResponseinterface

interface StatusesResponse
asOf?Temporal.Instant
atTemporal.Instant
dataset?DatasetServed
venuesRecord<string, VenueStatus>

StepResponseinterface

interface StepResponse
asOf?Temporal.Instant
dataset?DatasetServed
dateTemporal.PlainDate
fromTemporal.PlainDate
kindDayKindDto
micstring
nnumber
skippedSkippedDay[]
unknownSkippedTemporal.PlainDate[]

TemporalLiketype

type TemporalLike = typeof Temporal

The Temporal implementation decoders build values with.

TradingDaysResponseinterface

interface TradingDaysResponse

A date and whether the venue trades on it, and nothing else.

asOf?Temporal.Instant
dataset?DatasetServed
datesTemporal.PlainDate[]
fromTemporal.PlainDate
toTemporal.PlainDate
venuesRecord<string, TradingSeries>

TradingSeriesinterface

interface TradingSeries
trading(boolean | null)[]
unknownnumber

UsageViewinterface

interface UsageView

An account's usage against its plan (SPEC-pricing §6.4): what GET /v1/usage answers, and what the account page shows.

horizonDataWindow
micsDayMicWindow
micsMonthMicWindow
planstring
rateRate
venueDays?VenueDays

VenueDayinterface

interface VenueDay

One venue's day, in a row-oriented list.

dateTemporal.PlainDate
kindDayKindDto
products?ProductSplitDto
provenance?Provenance
reason?string
sessionsSessionDto[]
verificationVerificationDto
micstring

VenueDaysinterface

interface VenueDays
maxnumber
resetsAt?Temporal.Instant
usednumber

VenueResponseinterface

interface VenueResponse
country?string
micstring
namestring
operatingMicstring
productsstring[]
resolution?ResolutionDto
statusstring
timezone?string

VenueStatusinterface

interface VenueStatus

One venue's entry: StatusResponse without the at the response states once.

dayDayDto
nextClose?Temporal.ZonedDateTime
nextOpen?Temporal.ZonedDateTime
running?RunningSession
stateStateDto

VenuesResponseinterface

interface VenuesResponse
nextCursor?string
venuesVenueResponse[]

VerificationDtotype

type VerificationDto = "verified" | "corroborated" | "inferreddefinitional" | "inferredpredictive" | "inferredadvisory"

How much to trust a served day. Always present.