Date & Time
Count weekdays in a range API
Counts how many of each weekday fall in an inclusive date range (e.g. how many Mondays in June), plus total weekday vs weekend day counts, using O(1) arithmetic. Answers 'How many Fridays between two dates?', 'Weekday vs weekend day count for this span?'.
Price$0.02per request
MethodPOST
Route/v1/datetime/weekday-occurrences
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
datetimeweekday-countoccurrencesrangecalendarhow-many-mondaysweekendstally
API URL
Integration docshttps://x402.hexl.dev/v1/datetime/weekday-occurrencesExample request
{
"start": "2026-06-01",
"end": "2026-06-30"
}Example response
{
"start": "2026-06-01",
"end": "2026-06-30",
"totalDays": 30,
"counts": {
"Sunday": 4,
"Monday": 5,
"Tuesday": 5,
"Wednesday": 4,
"Thursday": 4,
"Friday": 4,
"Saturday": 4
},
"weekdays": 22,
"weekends": 8,
"interpretation": "30 day(s) inclusive: 22 weekday(s) + 8 weekend day(s); e.g. 5 Monday(s), 4 Friday(s)."
}Input schema
{
"type": "object",
"required": [
"start",
"end"
],
"properties": {
"start": {
"type": "string",
"examples": [
"2026-06-01"
]
},
"end": {
"type": "string",
"examples": [
"2026-06-30"
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}