Age Calculator

The Age Calculator endpoint allows you to calculate the age of someone or a thing with a given time such as a date of birth.

Endpoint

  • URL: https://api.erensko.xyz/v1/age-calculator

  • Method: GET

  • Description: Calculates the time difference from the current time to the specified date of birth and provides the age.

URL Parameters

Key
Value

dob

The date of birth to get the age of, in format of YYYY-MM-DD

Headers

Key
Value

Authorization

Your own personal API key, create one by clicking here. This is required.

Request Example

GET https://api.erensko.xyz/v1/age-calculator?dob=2022-9-23

Example Response:

{
  "dob": "2022-09-23",
  "age": "2",
  "years": 2,
  "months": 2,
  "days": 10,
  "weeks": 115,
  "hours": 1932,
  "minutes": 115920,
  "seconds": 6955200,
  "humanReadableAge": "2 years, 2 months, 10 days",
  "timeOfBirth": "2022-09-23T00:00:00Z",
  "isLeapYear": false,
  "timeZone": "UTC",
  "nextBirthdayInDays": 355,
  "ageGroup": "Toddler",
  "willBe18At": "2039-09-23T00:00:00Z",
  "ageInDays": 730,
  "birthdayPassedThisYear": false
}

The Age Calculator endpoint is an efficient tool for calculating the age of someone with their date of birth!

Last updated