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
yearstringrequired4-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):
datei32Date as
YYYYMMDD integeris_openi321 if the market is open, 0 if closedopen_timei32Market open time (milliseconds from midnight ET).
0 if closed.close_timei32Market close time (milliseconds from midnight ET).
0 if closed.statusi32Day type:
0 = open, 1 = early close, 2 = full close (holiday), 3 = weekendSample 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=0withopen_time=0indicates a full closure. Early closures show non-zeroclose_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.