Week number and week-year for dates under ISO 8601, US or custom rules (53-week years)
Returns the week number, week-year, number of weeks in that year and the week's first and last day for up to 200 dates under ISO 8601 (Monday start, week 1 holds 4 January), the US convention (Sunday start, week 1 holds 1 January) or a custom weekStart/minimalDays rule, and checks an asserted week or week-year (2027-01-01 is ISO 2026-W53). Built for an agent reading or writing week-based dates in reports, schedules and file names. Fiscal week calendars are handled by fiscal-period; it does not decide which convention a document used.
What you get
1 January falls in week 52, 53 or 1 depending on the convention; mixed conventions silently shift weekly totals.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/week-number. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/week-number \
-H 'content-type: application/json' \
-d '{"system":"iso","items":[{"date":"2027-01-01","claimedWeek":53,"claimedWeekYear":2026},{"date":"2026-12-31"}]}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
system | string; one of "iso", "us", "custom" | yes | iso: weekStart Monday, minimalDays 4. us: weekStart Sunday, minimalDays 1. custom: give weekStart and minimalDays. |
weekStart | integer; 0..6 | no | 0=Sunday..6=Saturday (custom). |
minimalDays | integer; 1..7 | no | Days of the new year the first week must contain (custom). |
items | array<object>; max 200 items | yes |
Example request body
{
"system": "iso",
"items": [
{
"date": "2027-01-01",
"claimedWeek": 53,
"claimedWeekYear": 2026
},
{
"date": "2026-12-31"
}
]
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
items | array<object> | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the calendar-deadline-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent