Skip to content

calendar_year

FreeValueStandardPro

Retrieve the complete trading calendar for an entire year, including every trading day, holiday, and early close day.

Code Example

rust
let data = tdx.calendar_year("2026").await?;
for t in &data {
    println!("date={} is_open={} open_time={} close_time={}",
        t.date, t.is_open, t.open_time, t.close_time);
}
python
data = tdx.calendar_year("2026")
for t in data:
    print(f"date={t.date} is_open={t.is_open} "
          f"open_time={t.open_time} close_time={t.close_time}")
typescript
const data = tdx.calendarYear('2026');
for (const t of data) {
    console.log(`date=${t.date} is_open=${t.is_open} open_time=${t.open_time} close_time=${t.close_time}`);
}
cpp
auto data = client.calendar_year("2026");
for (const auto& t : data) {
    printf("date=%d is_open=%d open_time=%d close_time=%d\n",
        t.date, t.is_open, t.open_time, t.close_time);
}

Parameters

yearstringrequired
4-digit year (e.g. "2024")

Response

Returns an array of CalendarDay records with calendar info for non-standard days in the year (holidays, early closes):

datei32
Date as YYYYMMDD integer
is_openi32
1 if the market is open, 0 if closed
open_timei32
Market open time (milliseconds from midnight ET). 0 if closed.
close_timei32
Market close time (milliseconds from midnight ET). 0 if closed.
statusi32
Day type: 0 = open, 1 = early close, 2 = full close (holiday), 3 = weekend

Sample Response

json
[
  {"date": 20260101, "is_open": 0, "open_time": 0, "close_time": 0},
  {"date": 20260119, "is_open": 0, "open_time": 0, "close_time": 0},
  {"date": 20260216, "is_open": 0, "open_time": 0, "close_time": 0}
]

Returns market holidays for the year. is_open=0 with open_time=0 indicates a full closure. Early closures show non-zero close_time (e.g., 46800000 = 1:00 PM).

Notes

  • The server returns only non-standard days (holidays and early closes), not every calendar day.
  • Useful for building local trading calendars and scheduling data collection.
  • Future years may have incomplete data if the exchange has not yet published the full calendar.
  • Reflects NYSE trading hours only.

Released under the Apache-2.0 License.