Java SDK · Feature

Domain Age Checker in Java

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.

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

Catch throwaway domains early

Abuse rings register domains in bulk and burn them fast, so a domain's age is one of the cheapest, highest-signal fraud checks you can run. domainAge turns a raw WHOIS record into a simple registration date and age in days, and domainAgeBatch lets you screen a whole list — sign-up email domains, referral links, or outbound targets — in a single request.

Prerequisites

1

Age of one domain with domainAge

Returns the registration date and the age in years and days.

IpApiClient client = IpApiClient.builder()
        .apiKey(System.getenv("IP_API_IO_KEY"))
        .build();

DomainAge age = client.domainAge("example.com");

System.out.println(age.isValid());          // true
System.out.println(age.registrationDate());  // "1995-08-14"
if (age.ageInDays() != null) {
    System.out.println(age.ageInDays());     // 11000+
    if (age.ageInDays() < 30) {
        // treat brand-new domains as higher risk
    }
}
2

Many domains with domainAgeBatch

Check a list of domains in one request (throws if empty).

var batch = client.domainAgeBatch(
        List.of("example.com", "brand-new-domain.xyz"));

batch.results().forEach((domain, age) -> {
    if (age.ageInDays() != null) {
        System.out.println(domain + " " + age.ageInDays());
    }
});
Reference

Response reference

DomainAge (from domainAge)

AccessorTypeDescription
domain()StringThe domain checked
isValid()booleanWhether age could be determined
registrationDate()StringFirst registration date
ageInYears()IntegerAge in whole years
ageInDays()LongAge in days
error()StringReason when isValid() is false

domainAgeBatch(domains) returns a BatchDomainAge — a results() map (Map<String, DomainAge>) of domain to age.

FAQ

Frequently asked questions

How do I check a domain's age in Java?

Call client.domainAge(domain). It returns isValid(), the registrationDate(), and the age as both ageInYears() and ageInDays(), derived from WHOIS data. Nullable fields may be null.

Why is domain age a fraud signal?

Freshly registered domains are disproportionately used for phishing, spam, and throwaway accounts. Flagging domains created in the last few days — e.g. ageInDays() < 30 — catches a lot of abuse before it reaches your users.

Can I check many domains at once?

Yes. client.domainAgeBatch(domains) checks a list of domains in one request and returns a results() map of domain to age. It throws if the list is empty.

Start building with the ip-api.io Java SDK

Add io.ip-api:ipapi to your build, drop in your free API key, and ship in minutes — one 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 io.ip-api:ipapi library is open source. Open an issue or pull request on GitHub and we'll take a look.

Open on GitHub