API Almanac
API reference › Date

Days, weeks, months and business days between two dates

GET/v1/date/diff

GET/v1/date/diff

Days, weeks, months and business days between two dates

Business days count both ends when they are working days (like Excel's NETWORKDAYS). With country, public holidays are excluded too; without it, only the weekend is.

PARAMETERS
fromquery · stringREQUIRED
Start date
e.g. 2026-12-18
toquery · stringREQUIRED
End date
e.g. 2027-01-05
countryquery · string
Country for holidays and weekend definition
e.g. US
subdivisionquery · string
State / province for regional holidays
e.g. string
In the full reference
REQUEST
curl "https://api.apialmanac.com/v1/date/diff?from=2026-12-18&to=2027-01-05" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "from": "2026-12-18",
  "to": "2027-01-05",
  "days": 18,
  "weeks": 2.57,
  "calendar": {
    "years": 0,
    "months": 0,
    "days": 18
  },
  "business_days": 11,
  "weekend_days": 6,
  "holiday_days": 2,
  "calendar_used": "United States",
  "holidays": [
    {
      "date": "2026-12-25",
      "name": "Christmas Day"
    },
    {
      "date": "2027-01-01",
      "name": "New Year's Day"
    }
  ]
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.