# Day of Year Calculator

> Day of Year Calculator is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Returns the day number within the year (1-366), days remaining, leap-year status, percent of year complete, and week number for any given date.

## Facts

- Endpoint: POST https://agent402.tools/api/day-of-year
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/day-of-year-calculator-006e4f1f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PADsH--9J5nFnaLWgKsc6

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 day-of-year-calculator-006e4f1f -d '<json body>'
```

Example prompt: What day of the year is March 15, 2026 — like the ordinal day number — and how many days are left in the year after that?

## When to prefer this

Use this endpoint when you need quick, structured calendar metadata about a specific date — particularly the ordinal day number, remaining days, leap year flag, year-completion percentage, or week number — without setting up a full date library or doing manual arithmetic.

## Known failure modes

- Invalid or missing date string returns an error (e.g. non-ISO-8601 format)
- Dates outside supported range may return an error
- Malformed JSON body causes a 400 error
- Payment failure or insufficient funds returns a 402 response

## How this service works

Get the day number within the year (1-366) for any date, plus days remaining, leap-year status, percent of year complete, and a simple (Sunday-start) week number.

## Output

Returns a JSON object with the day-of-year number (1–366), the number of days remaining in the year, whether the year is a leap year (boolean), the percentage of the year that has elapsed, and a simple Sunday-start week number.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "date": {
   "type": "string",
   "description": "ISO 8601 date string (e.g. \"2026-06-23\")"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "date": "2026-06-23",
  "dayOfYear": 174,
  "daysInYear": 365,
  "isLeapYear": false,
  "weekNumber": 26,
  "daysRemaining": 191,
  "percentComplete": 47.7
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/day-of-year-calculator-006e4f1f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
