# WritersLogic Week Number Calculator

> WritersLogic Week Number Calculator is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Computes ISO 8601, US-convention, or custom week numbers, week-years, week counts, and week boundary dates for up to 200 dates, optionally verifying asserted week/week-year values.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/week-number?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-week-number-calculator-b0edba77
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_x7y-gwdi4opUrc4qtqF1W

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability writerslogic-week-number-calculator-b0edba77 -d '<json body>'
```

Example prompt: What ISO 8601 week number and week-year does 2027-01-01 fall into, and what are the first and last days of that week? Also check whether my claim that it's in week 1 of 2027 is correct.

## When to prefer this

Use this endpoint when an agent needs to compute, convert, or verify week numbers across ISO 8601 and US conventions, especially in bulk (up to 200 dates) or when validating existing week labels in reports, schedules, or file names. Prefer it over manual date math when cross-convention accuracy matters or when the week-year boundary (e.g. Jan 1 falling in the prior year's last week) is critical. For fiscal-year week calendars, use a fiscal-period endpoint instead.

## Known failure modes

- Date string does not match YYYY-MM-DD pattern — validation error returned
- More than 200 items submitted — request rejected with max-items error
- system=custom provided without weekStart or minimalDays — error indicating missing custom parameters
- claimedWeek value outside 1–54 range — schema validation failure
- Network or payment failure returns HTTP 402 or 5xx with no week data

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

For each input date, returns the week number, week-year, total number of weeks in that week-year, and the ISO-formatted first and last day of the week. If claimedWeek or claimedWeekYear were supplied, also returns a boolean indicating whether the assertion is correct.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "items": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "date"
    ],
    "properties": {
     "date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "maxLength": 10
     },
     "claimedWeek": {
      "type": "integer",
      "maximum": 54,
      "minimum": 1
     },
     "claimedWeekYear": {
      "type": "integer",
      "maximum": 3000,
      "minimum": 1000
     }
    }
   },
   "maxItems": 200,
   "minItems": 1
  },
  "system": {
   "enum": [
    "iso",
    "us",
    "custom"
   ],
   "type": "string",
   "description": "iso: weekStart Monday, minimalDays 4. us: weekStart Sunday, minimalDays 1. custom: give weekStart and minimalDays."
  },
  "weekStart": {
   "type": "integer",
   "maximum": 6,
   "minimum": 0,
   "description": "0=Sunday..6=Saturday (custom)."
  },
  "minimalDays": {
   "type": "integer",
   "maximum": 7,
   "minimum": 1,
   "description": "Days of the new year the first week must contain (custom)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-week-number-calculator-b0edba77/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
