Prerequisites
- A .NET 6+ project with
IpApiIoadded - A free ip-api.io API key
Age of one domain with DomainAgeAsync
Returns the registration date and the age in years and days.
var client = new IpApiClient(Environment.GetEnvironmentVariable("IP_API_IO_KEY")!);
var age = await client.DomainAgeAsync("example.com");
Console.WriteLine(age.IsValid); // True
Console.WriteLine(age.RegistrationDate); // "1995-08-14"
if (age.AgeInDays is { } days)
{
Console.WriteLine(days); // 11000+
if (days < 30)
{
// treat brand-new domains as higher risk
}
} Many domains with DomainAgeBatchAsync
Check a list of domains in one request (throws if empty).
var batch = await client.DomainAgeBatchAsync(
new[] { "example.com", "brand-new-domain.xyz" });
foreach (var (domain, age) in batch.Results)
if (age.AgeInDays is { } days)
Console.WriteLine($"{domain} {days}");