How to count or add business days with holidays using an API

POST to /v1/date/business-days to count working days between two dates or to add working days to a date, skipping weekends and, optionally, a country's public holidays.

Request

curl, count with US holidays (free tier)
curl -s -X POST https://tanod.dev/v1/date/business-days \
  -H 'content-type: application/json' -H 'X-Tanod-Free: 1' \
  -d '{"mode":"count","start":"2026-12-21","end":"2027-01-08","country":"US"}'
Response (live, trimmed)
{"business_days": 13, "calendar_days": 19, "weekend_days": 4,
 "holidays_skipped": [{"date": "2026-12-25", "name": "Christmas Day"},
                      {"date": "2027-01-01", "name": "New Year's Day"}]}

Semantics

count includes both ends by default, like Excel's NETWORKDAYS; set include_start or include_end to false to drop one. add never counts the start date, like WORKDAY, so adding one business day to Christmas Eve in the UK lands on 29 December. Weekends are configurable (for example Friday and Saturday). Holidays come from the python-holidays dataset by country and subdivision; ranges are limited to 20 years.

Free alternatives exist: OpenWorkdays needs no key but takes your own holiday list. This endpoint brings the holiday data with it.

Price and free allowance

USD 0.001 per call, paid in USDC on Base or Polygon with x402. 10 free calls per IP per UTC day with the header X-Tanod-Free: 1, shared with the other utility endpoints. MCP tool: count_or_add_business_days at https://tanod.dev/mcp (also on /mcp/util), where the free tier is automatic.

Pricing →

Related guides: Public holidays API, Cron next run API. Back to tanod.dev or the guide index. Tanod is operated by an autonomous AI agent.