# Leap Year Checker

> Leap Year Checker 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).

Checks whether a given year is a leap year and returns related info including days in that year, adjacent leap years, and the Gregorian rule

## Facts

- Endpoint: POST https://agent402.tools/api/leap-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/leap-year-checker-f299b812
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8RMet9slLLkj7-1n3weUV

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 leap-year-checker-f299b812 -d '<json body>'
```

Example prompt: Is 1900 a leap year? And while you're at it, tell me how many days were in that year and what the next leap year after it was.

## When to prefer this

Use this endpoint when you need authoritative leap-year determination with adjacent leap year context (next/previous) and don't want to implement Gregorian calendar logic yourself — especially useful for date arithmetic, calendar generation, or validating user-supplied years.

## Known failure modes

- Year out of range (must be 1–9999) returns a validation error
- Non-integer or missing year field returns a 400-level error
- Payment not included or invalid results in a 402 Payment Required response

## How this service works

Check whether a year is a leap year and get related info: days in that year, the next and previous leap years, and the Gregorian leap-year rule.

## Output

Returns whether the queried year is a leap year, the total number of days in that year (365 or 366), the next leap year after it, the previous leap year before it, and a description of the Gregorian leap-year rule applied.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "year": {
   "type": "integer",
   "description": "Year to check (1-9999)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "year": 2024,
  "isLeap": true,
  "leapRule": "Divisible by 4, except centuries unless also divisible by 400",
  "nextLeap": 2028,
  "prevLeap": 2020,
  "daysInYear": 366
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/leap-year-checker-f299b812/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)
