CALENDAR

Leap Year API

GET/leap-year

Check whether a given year is a Gregorian leap year.

No signup or API key required.

Parameters

yearintegeroptional · query
Gregorian year to check, from 1 to 9999. Defaults to the current UTC year.
formatenumoptional · query
Response format. Defaults to json.
jsontext

No request body. Unknown or repeated query parameters return HTTP 400.

Returns 200 OK

A JSON object with the following fields.

yearinteger
The supplied year or current UTC year.
leapboolean
Whether this is a Gregorian leap year, including century exceptions.

Plain text

With format=text: Only true or false, without the year.

Errors

Validation and service errors always return JSON, including when format=text.

errorstring
A machine-readable error code, such as invalid_parameter or rate_limited.
messagestring
A description of the problem.

400 Invalid parameters.

414 Query string exceeds 2048 characters.

429 Rate limit reached. Wait the seconds in Retry-After before retrying.

Usage notes

Optional year: integer 1..9999, default current UTC year. Gregorian leap-year rule including century exceptions. Text returns the boolean.

Validate a calendar example or explain February’s extra day. Supply year to check a specific year, or omit it to use the current UTC year.

Responses are not cached. Browser requests are supported through open CORS.

120 requests per minute per IP, with up to 30 per 10 seconds, shared across APIs. Limits are approximate per Cloudflare location. Full usage limits ↗