# Day-of-Year Calculator

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

Returns the ordinal day of the year (1–366), total days in that year, and whether the year is a leap year for a given Gregorian date.

## Facts

- Endpoint: POST https://datetime.openverbs.com/v1/day-of-year
- Price: $0.004/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-72ffebcf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VWNk6kXGQr64HyaO-PhdL

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-72ffebcf -d '<json body>'
```

Example prompt: What ordinal day of the year is September 23, 2025, and is 2025 a leap year?

## When to prefer this

Use this endpoint when you need to convert a specific Gregorian calendar date into its ordinal day-of-year number, determine the total days in a year, or check for leap years — especially in date arithmetic, scientific logging, scheduling, or calendar display pipelines. Prefer over manual calculation when correctness for edge cases (leap years, century years) matters.

## Known failure modes

- Invalid date values (e.g. month 13, day 32) return a validation error
- Year outside the range 1–9999 returns a schema validation error
- Missing required fields (year, month, or day) return a 400-level error
- Non-integer inputs for date components are rejected by schema validation

## How this service works

Return the ordinal day of the year (1..366), the number of days in that year and whether it is a leap year.

## Output

Returns the ordinal day of the year (an integer from 1 to 366), the total number of days in that year (365 or 366), and a boolean indicating whether the year is a leap year.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "year": {
       "type": "integer",
       "minimum": 1,
       "maximum": 9999
      },
      "month": {
       "type": "integer",
       "minimum": 1,
       "maximum": 12
      },
      "day": {
       "type": "integer",
       "minimum": 1,
       "maximum": 31
      }
     },
     "required": [
      "year",
      "month",
      "day"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/day-of-year-calculator-72ffebcf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from datetime.openverbs.com](https://www.zero.xyz/host/datetime.openverbs.com/llms.txt)
