Free Trading Days API

The data behind this site, as JSON. Free to use, no API key, CORS enabled. If you use it in something public, a link back to howmanytradingdays.com is appreciated.

GET

/api/trading-days

https://howmanytradingdays.com/api/trading-days

Trading-day totals, month-by-month counts, and the full holiday calendar for a year. Defaults to the current year; pass ?year=2027 for any year from 1950 to 2100. For the current year, remaining holds the live days-left count.

Code examples & sample response
# curl
curl https://howmanytradingdays.com/api/trading-days?year=2026
// JavaScript (browser or Node — CORS is enabled)
const res = await fetch(
  "https://howmanytradingdays.com/api/trading-days?year=2026"
);
const data = await res.json();

console.log(data.tradingDays);           // 251
console.log(data.remaining.tradingDays); // days left (current year only)
console.log(data.holidays[0]);           // { date, name, status }
# Python
import requests

data = requests.get(
    "https://howmanytradingdays.com/api/trading-days", params={"year": 2026}
).json()
print(data["tradingDays"])  # 251

Sample response:

{
  "year": 2026,
  "tradingDays": 251,
  "tradingDaysHalfDayAdjusted": 250,
  "weekdays": 261,
  "marketHolidays": 10,
  "earlyCloseSessions": 2,
  "remaining": { "tradingDays": 91, "fullDays": 90, "halfDays": 2 },
  "months": [ { "month": 1, "name": "January", "tradingDays": 20 }, ... ],
  "holidays": [
    { "date": "2026-01-01", "name": "New Year's Day", "status": "closed" },
    ...
    { "date": "2026-11-27", "name": "Day After Thanksgiving",
      "status": "early-close", "closesAtET": "13:00" }
  ],
  "source": "https://howmanytradingdays.com"
}
GET

/api/count

https://howmanytradingdays.com/api/count?from=2026-11-02&to=2026-12-31

Count trading days between any two dates (inclusive) — the calculator, as an API. Both from and to are required, as YYYY-MM-DD.

Code examples & sample response
# curl
curl "https://howmanytradingdays.com/api/count?from=2026-11-02&to=2026-12-31"

Sample response (early closes count as 0.5):

{
  "from": "2026-11-02",
  "to": "2026-12-31",
  "tradingDays": 41,
  "fullDays": 40,
  "halfDays": 2,
  "calendarDays": 59,
  "source": "https://howmanytradingdays.com"
}
GET

/api/is-trading-day

https://howmanytradingdays.com/api/is-trading-day?date=2026-11-27

Check whether a specific date is a trading session — and if so, when it closes. Also returns the previous and next trading days. date defaults to today (ET).

Code examples & sample response
# curl
curl "https://howmanytradingdays.com/api/is-trading-day?date=2026-11-27"

Sample response:

{
  "date": "2026-11-27",
  "weekday": "Friday",
  "isTradingDay": true,
  "isEarlyClose": true,
  "holiday": "Day After Thanksgiving",
  "closesAtET": "13:00",
  "previousTradingDay": "2026-11-25",
  "nextTradingDay": "2026-11-30",
  "source": "https://howmanytradingdays.com"
}
GET

/api/offset

https://howmanytradingdays.com/api/offset?date=2026-08-21&days=2

Add (or subtract) trading days from a date — useful for settlement math: days=1 from a trade date gives the T+1 settlement date, automatically skipping weekends and holidays. days may be negative; range ±1000.

Code examples & sample response
# curl — T+2 from a Friday lands on Tuesday
curl "https://howmanytradingdays.com/api/offset?date=2026-08-21&days=2"

Sample response:

{
  "date": "2026-08-21",
  "tradingDaysAdded": 2,
  "result": "2026-08-25",
  "resultWeekday": "Tuesday",
  "resultIsEarlyClose": false,
  "source": "https://howmanytradingdays.com"
}
GET

/api/market-status

https://howmanytradingdays.com/api/market-status

Whether U.S. equity markets are open right now, based on regular session hours (9:30 a.m.–4:00 p.m. ET) and the NYSE/Nasdaq holiday calendar.

Code examples & sample response
# curl
curl https://howmanytradingdays.com/api/market-status
// JavaScript — e.g. show an open/closed badge on your site
const res = await fetch("https://howmanytradingdays.com/api/market-status");
const { isOpen, isEarlyClose, closesAtET } = await res.json();

badge.textContent = isOpen
  ? `Market open — closes ${closesAtET} ET`
  : "Market closed";

Sample response:

{
  "isOpen": true,
  "isTradingDay": true,
  "isEarlyClose": false,
  "closesAtET": "16:00",
  "closedReason": null,
  "nextSessionDate": "2026-08-21",
  "opensAtET": "09:30",
  "timezone": "America/New_York",
  "source": "https://howmanytradingdays.com"
}

Notes

  • tradingDays counts early-close sessions as full days (the standard ~252 convention); tradingDaysHalfDayAdjusted counts them as 0.5.
  • Holidays are computed algorithmically from NYSE/Nasdaq calendar rules — scheduled closures only, not unscheduled ones (e.g. days of mourning).
  • Responses are cached briefly at the edge. No rate limits, no key — please be reasonable.
  • Free for personal and commercial use. Attribution with a link is appreciated.

Disclaimer: This API and its data are provided free of charge, "as is," without warranty of any kind — including accuracy, completeness, availability, or fitness for any purpose. Nothing here is financial, investment, or trading advice. You are solely responsible for how you use this API and for any decisions or outcomes that result. By using it, you agree that HowManyTradingDays.com and its creator bear no liability for any loss or damage arising from its use, its unavailability, or any errors in its data.