Week Number API
Free JSON API โ no API key required, CORS enabled
โ Free forever ยท โ No rate limit ยท โ Open sourceOverview
The WeekNumber.cc API lets you get week numbers, date ranges, and ISO 8601 compliance data in JSON format. Perfect for calendars, scheduling tools, payroll systems, and productivity apps.
| Feature | Detail |
|---|---|
| Base URL | https://weeknumber.cc/api/week |
| Format | JSON |
| Authentication | None required |
| CORS | Enabled (all origins) |
| Rate Limit | None |
| Cache | 1 hour (CDN cached) |
Endpoints
GET
/api/week
Get the current week number and date range.
{
"date": "2026-06-24",
"week": 26,
"year": 2026,
"week_label": "Week 26 of 2026",
"week_range": {
"monday": "2026-06-22",
"sunday": "2026-06-28"
},
"day_of_week": "Wednesday",
"weeks_in_year": 53
}
GET
/api/week?date=2026-12-31
Get week number for a specific date.
# JavaScript
fetch('https://weeknumber.cc/api/week?date=2026-12-31')
.then(r => r.json())
.then(data => console.log(data));
# Python
import requests
r = requests.get('https://weeknumber.cc/api/week', params={'date': '2026-12-31'})
print(r.json())
# curl
curl 'https://weeknumber.cc/api/week?date=2026-12-31'
GET
/api/week?year=2026&week=25
Get the date range for a specific year and week number.
{
"year": 2026,
"week": 25,
"week_label": "Week 25 of 2026",
"week_range": {
"monday": "2026-06-15",
"sunday": "2026-06-21"
},
"weeks_in_year": 53
}
Query Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
date | string | Date in YYYY-MM-DD format. Returns the week for this date. | 2026-06-24 |
year | integer | The year (1900-2100). | 2026 |
week | integer | The week number (1-53). | 25 |
Usage Examples
๐ Embed Week Badge on Your Website
<!-- Show current week badge -->
<img src="https://weeknumber.cc/og/week" alt="This is Week 26 of 2026" />
<!-- Or use the dynamic API -->
<script>
fetch('https://weeknumber.cc/api/week')
.then(r => r.json())
.then(data => {
document.getElementById('week-badge').innerHTML =
`This is ${data.week_label} (${data.week_range.monday} โ ${data.week_range.sunday})`;
});
</script>
๐ Calendar Integration
// Get all 53 weeks of 2026
const weeks = [];
for (let w = 1; w <= 53; w++) {
const r = await fetch(`https://weeknumber.cc/api/week?year=2026&week=${w}`);
const data = await r.json();
weeks.push({
week: data.week,
start: data.week_range.monday,
end: data.week_range.sunday
});
}
Attribution
This API is free to use. We ask that you link back to WeekNumber.cc when using the API in production.
Source: https://weeknumber.cc
Usage: Free to use. No API key required. Please link back to weeknumber.cc