# Age Calculator API

> Age Calculator converts a date of birth into exact age broken down by years, months, weeks, days, hours, minutes, and seconds. It also provides the age in written words and a countdown to the next birthday.

**Endpoint:** `GET https://api.apiverve.com/v1/agecalculator`  
**Category:** Calendar  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/agecalculator

## Overview

Age Calculator works by analyzing the date of birth provided and calculating the age. It uses advanced algorithms to calculate the age based on the date of birth and returns the calculated age.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/agecalculator?dob=1990-01-01&timezone=America%2FChicago" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `dob` | string | Yes | The date of birth to calculate the age from (format: YYYY-MM-DD). date |
| `timezone` | string | No | IANA timezone used to interpret the date of birth and to determine "today" when computing the age. default America/Chicago. timezone |

## Response fields

- `dob` — string · Date of birth as provided in request (format: YYYY-MM-DD)
- `age_breakdown` — object · Age expressed in years, months, weeks, days, hours, minutes, and seconds
  - `age_breakdown.years` — number · Person's age in complete years
  - `age_breakdown.months` — number · Total age in months (a running total, not a remainder; see age_breakdown.exact)
  - `age_breakdown.weeks` — number · Total age in weeks (a running total, not a remainder; see age_breakdown.exact)
  - `age_breakdown.days` — number · Total age in days (a running total, not a remainder; see age_breakdown.exact)
  - `age_breakdown.hours` — number · Total age in hours (a running total, not a remainder; see age_breakdown.exact)
  - `age_breakdown.minutes` — number · Total age in minutes
  - `age_breakdown.seconds` — number · Total age in seconds
- `age_words` — object · Age expressed in words (e.g., thirty-five years old)
  - `age_words.years` — string · Age in written word form (e.g., thirty-five)
  - `age_words.ordinal` — string · Age in ordinal word form (e.g., thirty-fifth)
  - `age_words.full` — string · Age as complete phrase (e.g., thirty-five years old)
  - `age_words.locale` — string · Locale used for word generation (e.g., en-US)
- `timezone` — string · Timezone associated with the calculation (e.g., America/Chicago)
- `locale` — string · Locale code for the response (e.g., en-US)
- `next_birthday` — object · Countdown to next birthday in months, weeks, days, hours, minutes, seconds
  - `next_birthday.months` — number · Months until next birthday
  - `next_birthday.weeks` — number · Weeks until next birthday
  - `next_birthday.days` — number · Days until next birthday
  - `next_birthday.hours` — number · Hours until next birthday
  - `next_birthday.minutes` — number · Minutes until next birthday
  - `next_birthday.seconds` — number · Seconds until next birthday
- `insights` — object · Derived facts about the date of birth: generation, zodiac signs, birthstone, weekday born and US legal milestones
  - `insights.generation` — string · Generational cohort (e.g., Millennial, Gen Z, Baby Boomer) · (premium)
  - `insights.zodiacSign` — string · Western zodiac sign based on birth date (e.g., Capricorn, Leo) · (premium)
  - `insights.chineseZodiac` — string · Chinese zodiac animal based on birth year (e.g., Dragon, Tiger) · (premium)
  - `insights.birthstone` — string · Traditional birthstone for birth month (e.g., Diamond, Ruby) · (premium)
  - `insights.dayOfWeekBorn` — string · Day of the week person was born (e.g., Monday, Friday) · (premium)
  - `insights.isLeapYearBirth` — boolean · Whether the person was born in a leap year · (premium)
  - `insights.milestones` — object · Legal milestones achieved (canVoteUS, canDrinkUS, canRentCarUS, seniorDiscount) · (premium)
    - `insights.milestones.canVoteUS` — boolean · Whether person is eligible to vote in United States elections · (premium)
    - `insights.milestones.canDrinkUS` — boolean · Whether person is legal age to drink alcohol in United States · (premium)
    - `insights.milestones.canRentCarUS` — boolean · Whether person meets age requirement to rent cars in United States · (premium)
    - `insights.milestones.seniorDiscount` — boolean · Whether person is eligible for senior citizen discounts · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "dob": "1990-01-01",
    "age_breakdown": {
      "years": 35,
      "months": 431,
      "weeks": 1876,
      "days": 13133,
      "hours": 315208,
      "minutes": 18912499,
      "seconds": 1134749976
    },
    "age_words": {
      "years": "thirty-five",
      "ordinal": "thirty-fifth",
      "full": "thirty-five years old",
      "locale": "en-US"
    },
    "timezone": "America/Chicago",
    "locale": "en-US",
    "next_birthday": {
      "months": 0,
      "weeks": 2,
      "days": 15,
      "hours": 367,
      "minutes": 22060,
      "seconds": 1323623
    },
    "insights": {
      "generation": "Millennial",
      "zodiacSign": "Capricorn",
      "chineseZodiac": "Horse",
      "birthstone": "Garnet",
      "dayOfWeekBorn": "Monday",
      "isLeapYearBirth": false,
      "milestones": {
        "canVoteUS": true,
        "canDrinkUS": true,
        "canRentCarUS": true,
        "seniorDiscount": false
      }
    }
  }
}
```

## Use cases

- **User Onboarding Verification** — When a new user registers, verify their exact age in years from their birth date before activating account features.
- **Birthday Campaign Scheduling** — Marketing platforms track the countdown to each customer's next birthday in days and hours to trigger timely promotional discount codes.
- **Pediatric Patient Intake** — Health record systems record patient age broken down into months and weeks for infants who need age-specific developmental checks.
- **Profile Milestone Cards** — Display a user's age written out in words on community profile cards and count down to their next birthday celebration.

## SDKs

- **npm** — `npm install @apiverve/agecalculator` (https://www.npmjs.com/package/@apiverve/agecalculator)
- **PyPI** — `pip install apiverve-agecalculator` (https://pypi.org/project/apiverve-agecalculator/)
- **NuGet** — `dotnet add package APIVerve.API.AgeCalculator` (https://www.nuget.org/packages/APIVerve.API.AgeCalculator)
- **Source** — https://github.com/apiverve/agecalculator-api

## More

- Full reference: https://docs.apiverve.com/ref/agecalculator
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
