Rust SDK · Feature

Domain Age Checker in Rust

Newly registered domains are a strong fraud and spam signal. domain_age 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. domain_age turns a raw WHOIS record into a simple registration date and age in days, and domain_age_batch lets you screen a whole slice — sign-up email domains, referral links, or outbound targets — in a single request.

Prerequisites

1

Age of one domain with domain_age

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

let client = Client::new(std::env::var("IP_API_IO_KEY")?);

let age = client.domain_age("example.com").await?;

println!("{}", age.is_valid);          // true
if let Some(date) = &age.registration_date {
    println!("{date}");                // "1995-08-14"
}
if let Some(days) = age.age_in_days {
    println!("{days}");                // 11000+
    if days < 30 {
        // treat brand-new domains as higher risk
    }
}
2

Many domains with domain_age_batch

Check a slice of domains in one request (returns an Error if empty).

let batch = client
    .domain_age_batch(&["example.com", "brand-new-domain.xyz"])
    .await?;

for (domain, age) in &batch.results {
    if let Some(days) = age.age_in_days {
        println!("{domain} {days}");
    }
}
Reference

Response reference

DomainAge (from domain_age)

FieldTypeDescription
domainStringThe domain checked
is_validboolWhether age could be determined
registration_dateOption<String>First registration date
age_in_yearsOption<i32>Age in whole years
age_in_daysOption<i64>Age in days
errorOption<String>Reason when is_valid is false

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

FAQ

Frequently asked questions

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

Call client.domain_age(domain).await?. It returns is_valid, the registration_date, and the age as both age_in_years and age_in_days, derived from WHOIS data. Nullable fields are Option<T>.

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. age_in_days < 30 — catches a lot of abuse before it reaches your users.

Can I check many domains at once?

Yes. client.domain_age_batch(domains).await? checks a slice of domains in one request and returns a results map of domain to age. It returns an Error if the slice is empty.

Start building with the ip-api.io Rust SDK

Run cargo add ip-api-io, drop in your free API key, and ship in minutes — one async 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 crate is open source. Open an issue or pull request on GitHub and we'll take a look.

Open on GitHub