Week number and week-year for dates under ISO 8601, US or custom rules (53-week years)

$0.005 USDC per call · Business, finance and compliance · POST /api/v1/week-number · Id week-number

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

FieldTypeRequiredDescription
systemstring; one of "iso", "us", "custom"yesiso: weekStart Monday, minimalDays 4. us: weekStart Sunday, minimalDays 1. custom: give weekStart and minimalDays.
weekStartinteger; 0..6no0=Sunday..6=Saturday (custom).
minimalDaysinteger; 1..7noDays of the new year the first week must contain (custom).
itemsarray<object>; max 200 itemsyes

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.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: 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.
itemsarray<object>no
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways 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