JavaScript SDK · Feature

Domain Age Checks in Node.js

Newly registered domains are a strong fraud and spam signal. domainAge returns how long ago a domain was registered, derived from WHOIS data, so you can flag or block domains created days ago — for one domain or a whole list.

Trusted by thousands of businesses
Fast JSON API responses
Real-time validation
Simple integration, SDKs & examples
What it does

New domains are risky domains

Spam, phishing, and fraud campaigns burn through cheap, freshly registered domains faster than blocklists can catch them. Domain age is one of the most reliable early signals you can add: a domain registered days ago deserves more scrutiny than one that's been around for years. domainAge gives you that number in one call.

Prerequisites

1

Age of one domain with domainAge

import { IpApiClient } from "ip-api-io";

const client = new IpApiClient({ apiKey: process.env.IP_API_IO_KEY });

const age = await client.domainAge("example.com");

console.log(age.is_valid);           // true
console.log(age.registration_date);  // "1995-08-14"
console.log(age.age_in_years);       // 30
console.log(age.age_in_days);        // 11000+

if ((age.age_in_days ?? Infinity) < 30) {
  // treat brand-new domains as higher risk
}
2

Many domains with domainAgeBatch

Check a list of domains in one request (non-empty; throws RangeError if empty).

const batch = await client.domainAgeBatch([
  "example.com",
  "brand-new-domain.xyz",
]);

for (const [domain, age] of Object.entries(batch.results)) {
  console.log(domain, age.age_in_days);
}
Reference

Response reference

domainAge() resolves to a DomainAge; domainAgeBatch() returns a results map of domain → DomainAge.

FieldTypeDescription
domainstringThe domain checked
is_validbooleanWhether age could be determined
registration_datestring | nullFirst registration date
age_in_yearsnumber | nullAge in whole years
age_in_daysnumber | nullAge in days
errorstring | nullReason when is_valid is false
FAQ

Frequently asked questions

How do I check a domain's age in Node.js?

Call await client.domainAge(domain). It returns is_valid, the registration_date, and the age in age_in_years and age_in_days, derived from WHOIS data.

Why is domain age a useful fraud signal?

Fraud and spam operations cycle through freshly registered throwaway domains. A domain only days or weeks old is statistically far riskier than an established one, so checking age in days lets you add friction or block at sign-up and checkout.

Can I check many domains at once?

Yes. client.domainAgeBatch(domains) checks a list in one request and returns a results map of domain to DomainAge. The list must be non-empty; the SDK throws a RangeError if it is empty.

What happens if the age can't be determined?

The response sets is_valid to false and populates error with the reason, while registration_date, age_in_years and age_in_days will be null. Always check is_valid first.

Start building with the ip-api.io JavaScript SDK

Install ip-api-io, drop in your free API key, and ship in minutes — one typed client for geolocation, fraud detection, and email validation.

Need support?

Explore how IP-API.io can enhance your security, provide robust bot protection, and improve IP geolocation accuracy for your applications.

Contact Support

Found a bug in the SDK?

The ip-api-io package is open source. Open an issue or pull request on GitHub and we'll take a look.

Open on GitHub