๐Ÿ”Œ Week Number API Explorer

Free REST API โ€” No key required โ€” CORS enabled โ€” Try it live

Free No API Key CORS โœ“ HTTPS JSON
GET /api/week Get the current week number
curl https://www.weeknumber.cc/api/week
GET /api/week?date={date} Get the week number for a specific date
YYYY-MM-DD format
curl "https://www.weeknumber.cc/api/week?date=2026-12-25"
GET /api/week?year={year}&week={week} Get the date range for a specific week
curl "https://www.weeknumber.cc/api/week?year=2026&week=25"

๐Ÿ“ Code Examples

JavaScript
Python
Go
cURL
// JavaScript (browser or Node.js) async function getWeekNumber() { const res = await fetch('https://www.weeknumber.cc/api/week'); const data = await res.json(); console.log(data.week_label); // "Week 25 of 2026" console.log(data.week_range); // { monday: "2026-06-15", sunday: "2026-06-21" } return data; } // With a specific date async function getWeekForDate(date) { const res = await fetch( 'https://www.weeknumber.cc/api/week?date=' + date ); return res.json(); } // Install: npm install weeknumber (coming soon) // Or use the free API directly โ€” no key needed!
# Python import requests # Get current week resp = requests.get('https://www.weeknumber.cc/api/week') data = resp.json() print(data['week_label']) # "Week 25 of 2026" print(data['week']) # 25 print(data['year']) # 2026 # Get week for a specific date resp = requests.get( 'https://www.weeknumber.cc/api/week', params={'date': '2026-12-25'} ) data = resp.json() print(data['week']) # Week of Christmas 2026 # Get date range for a week resp = requests.get( 'https://www.weeknumber.cc/api/week', params={'year': 2026, 'week': 1} ) data = resp.json() print(data['week_range']) # {'monday': '...', 'sunday': '...'}
// Go package main import ( "encoding/json" "fmt" "net/http" ) type WeekResult struct { Date string `json:"date"` Week int `json:"week"` Year int `json:"year"` WeekLabel string `json:"week_label"` } func main() { // Get current week resp, _ := http.Get("https://www.weeknumber.cc/api/week") defer resp.Body.Close() var result WeekResult json.NewDecoder(resp.Body).Decode(&result) fmt.Println(result.WeekLabel) // "Week 25 of 2026" }
# cURL examples # Get current week number curl https://www.weeknumber.cc/api/week # Get week number for a date curl "https://www.weeknumber.cc/api/week?date=2026-12-25" # Get date range for a specific week curl "https://www.weeknumber.cc/api/week?year=2026&week=1" # Response format: # { # "date": "2026-06-20", # "week": 25, # "year": 2026, # "week_label": "Week 25 of 2026", # "week_range": { "monday": "...", "sunday": "..." }, # "day_of_week": "Saturday", # "weeks_in_year": 53 # }

โ“ FAQ

Is the API really free?

Yes! 100% free. No API key required. No rate limits (be reasonable). No registration needed.

Can I use it in production?

Yes! It runs on Cloudflare's global edge network. CORS is enabled for browser use. HTTPS only. If you need guaranteed uptime, consider self-hosting or caching the responses.

What week numbering system is used?

ISO 8601 standard. Weeks start on Monday. Week 1 is the week containing the first Thursday of the year.