Domain Age API: Get a Domain's Age

October 21, 2026
Domain Age API: Get a Domain's Age

You need to know how old a domain is and when it expires so you can make decisions like blocking newly registered domains on your network, scoring signups from risky domains, or auditing where ads run before a domain is about to lapse. By the end of this guide, you’ll call a single API to get a domain’s creation date, age in days, expiration date, and days left until expiration—and wire those fields into your filtering, enrichment, or monitoring pipeline.

Why Klazify is the right API when domain age matters

When you rely on domain age for security, privacy, ad quality, or compliance, you often also need consistent categorization for policy gates and auditing. Klazify pairs domain registration signals (age/expiration) with accurate content categorization in one platform so you can enforce rules with fewer moving parts.

Illustration: Domain Age API: Get a Domain's Age
  • Accurate website categorization using AI: Domain age alone doesn’t tell you intent. Klazify analyzes full site content and maps to IAB categories, letting you combine “new domains” with sensitive categories to tighten controls (e.g., block fresh domains that look like finance or downloads).
  • Global coverage: Many domains host non-English content or have region-specific pages. Klazify’s analysis works across languages, so your age-based rules apply consistently worldwide.
  • Real-time classification: Domain signals and content shift. Klazify’s on-demand analysis avoids stale lookups so your age checks and category screens stay aligned with current site behavior.
  • Industry-level categories: IAB taxonomy output lets ad tech and brand safety teams pair domain age thresholds with standard categories used across exchanges and DSPs.
  • Simple API integration: A straightforward REST API lets you fetch domain age/expiration and, when needed, fetch categories from the main categorization endpoint in the same workflow.
  • Compliance and filtering: Combine domain age rules (e.g., block domains younger than N days) with category allowlists/denylists for effective policy enforcement in proxies, SASE, and parental controls.

What you get from the domain age endpoint

Use the dedicated endpoint to retrieve domain registration timing:

  • domain_age_date: The domain’s creation date (YYYY-MM-DD).
  • domain_age_days_ago: How many days ago the domain was created (string; cast to integer in code).
  • domain_expiration_date: The next expiration date (YYYY-MM-DD).
  • domain_expiration_days_left: How many days until expiration (string; cast to integer).

These fields let you implement policies like “reject signups from domains younger than 14 days,” “alert if a vendor’s domain expires within 30 days,” or “avoid ad placements on domains within 7 days of expiration.”

Make your first request

Send a POST request with a JSON body that includes the URL you want to analyze. Authenticate via Bearer token. Failed or unreachable calls are not billed.

curl -s -X POST https://www.klazify.com/api/domain_expiration \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://cbsnews.com"}'

If you don’t have an API key yet, start with the Starter plan ($39.99/mo, 7-day trial). Create a free account here: Register.

Parse the response in code

This example shows how to call the same endpoint from Python, extract the four domain age fields, and convert the day counts to integers you can compare against thresholds.

import os
import json
import requests
from datetime import date

API_KEY = os.getenv("KLAZIFY_API_KEY", "YOUR_API_KEY")
ENDPOINT = "https://www.klazify.com/api/domain_expiration"

def get_domain_age_fields(url: str):
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
payload = {"url": url}
resp = requests.post(ENDPOINT, headers=headers, data=json.dumps(payload), timeout=15)
resp.raise_for_status()
data = resp.json()

# The endpoint returns a JSON including the four fields below.
# Cast numeric-day strings to integers for comparisons.
age_date = data.get("domain_age_date")
age_days_ago = int(data.get("domain_age_days_ago")) if data.get("domain_age_days_ago") is not None else None
exp_date = data.get("domain_expiration_date")
exp_days_left = int(data.get("domain_expiration_days_left")) if data.get("domain_expiration_days_left") is not None else None

return {
"domain_age_date": age_date,
"domain_age_days_ago": age_days_ago,
"domain_expiration_date": exp_date,
"domain_expiration_days_left": exp_days_left
}

def should_block_new_domain(age_days: int, threshold_days: int = 14) -> bool:
return age_days is not None and age_days < threshold_days

def needs_expiration_alert(exp_days_left: int, window_days: int = 30) -> bool:
return exp_days_left is not None and exp_days_left <= window_days

if __name__ == "__main__":
fields = get_domain_age_fields("https://example.com")
print(fields)

if fields["domain_age_days_ago"] is not None and should_block_new_domain(fields["domain_age_days_ago"]):
print("Block or step-up verify: new domain.")

if fields["domain_expiration_days_left"] is not None and needs_expiration_alert(fields["domain_expiration_days_left"]):
print("Alert: domain approaching expiration.")

Full JSON example and how to use the fields

This is an official example JSON showing categorization data together with domain registration fields. Use it to understand where the domain age fields appear and how they’re structured.


{
"domain": {
"categories": [
{
"confidence": 0.92,
"name": "/Computers & Electronics/Consumer Electronics",
"IAB-632-596": "Consumer Electronics/Technology & Computing/Consumer Electronics"
},
{
"confidence": 0.89,
"name": "/Internet & Telecom/Mobile & Wireless/Mobile Phones"
}
],
"social_media": null,
"logo_url": "https://klazify.s3.amazonaws.com/2110787991611585019600ed5fb1d1300.04730104.png"
},
"success": true,
"objects": {
"company": {
"url": "https://www.apple.com/",
"name": "Apple",
"city": "Cupertino",
"stateCode": "CA",
"countryCode": "US",
"employeesRange": "100K+",
"revenue": 274515000000,
"raised": null,
"tags": [
"E-commerce",
"Consumer Electronics",
"Mobile",
"B2C"
],
"tech": [
"omniture_adobe_analytics",
"atlassian_confluence",
"successfactors",
"apache_apex",
"talend",
"oracle_peoplesoft",
"salesforce",
"stripe",
"dell_boomi_atomsphere",
"gigya",
"sage_50cloud",
"quickbooks",
"webmethods",
"apache_tomcat",
"alteryx",
"tibco_rendezvous",
"atlassian_jira",
"..."
]
}
},
"domain_registration_data": {
"domain_age_date": "1987-02-19",
"domain_age_days_ago": "13026",
"domain_expiration_date": "2030-02-20",
"domain_expiration_days_left": "123"
},
"similar_domains": [
"bestbuy.com",
"icloud.com",
"microsoft.com",
"macrumors.com",
"google.com",
"samsung.com",
"twitter.com",
"hp.com",
"bhphotovideo.com",
"dell.com"
]
}

How to apply the fields:

  • domain_age_date: Store as a date column for audits and historical analysis.
  • domain_age_days_ago: Use for threshold-based gating (e.g., block < 14 days) and for scoring models.
  • domain_expiration_date: Use in vendor due diligence and ad partner checks to avoid lapses.
  • domain_expiration_days_left: Trigger reminders or escalations (e.g., renewals at 30, 14, 7, 3 days).

Map domain age decisions to actions in your stack

  • Security filtering (proxy/SWG/SASE): Deny or step-up authenticate sessions from domains younger than a defined threshold.
  • Signup enrichment (risk/anti-abuse): Flag or require additional verification if the email domain age_days_ago < 7 or 14.
  • Ad verification and brand safety: Avoid buying inventory on domains with expiration_days_left under a limit; optionally pair with IAB categories from the categorization endpoint for policy alignment.
  • CRM and vendor management: Create tasks when partner domains are within 30 days of expiration.

Reference: fields and typical uses

Field Type Example Common Uses
domain_age_date string (YYYY-MM-DD) 1987-02-19 Audit record, timeline charts, SLA references
domain_age_days_ago string (cast to int) 13026 Threshold checks (e.g., block < N days), risk scoring
domain_expiration_date string (YYYY-MM-DD) 2030-02-20 Renewal planning, partner due diligence
domain_expiration_days_left string (cast to int) 123 Alerts at 30/14/7 days, ad placement safeguards

Combine domain age with categorization when you need context

Many teams combine age rules with content category rules for stronger controls. When you need categories alongside age, call the main endpoint (for website classification and IAB mapping):

  • Endpoint URL: https://www.klazify.com/api/categorize
  • Purpose: Website classification and content categorization

For example, enforce “block new domains < 14 days that also match sensitive categories” or “allow older domains if they are in approved IAB categories.” See the Documentation for request/response details and mapping guidance.

Operational guidance: batching, caching, and unknown domains

Batching and throughput

  • Batch inputs upstream: de-duplicate domains before hitting the API. A single domain often appears many times across sessions or events.
  • Parallelize with care: Use connection pooling and modest concurrency, and respect published rate policies in the docs. If you encounter 429 or transient errors, back off and retry with jitter.

Caching strategy

  • Cache by registrable domain (e.g., example.com) rather than full URL. Age and expiration are domain-level signals.
  • Recommended TTLs: Domain age changes daily, and expiration countdown decreases by a day, so a 24-hour TTL is typically sufficient. For high-sensitivity checks (e.g., renewals), refresh more frequently as expiration approaches.
  • Store both the date fields and the day-count fields so you can recompute days-left locally if needed.

Handling unknown or new domains

  • If the response omits a date or day count for edge cases, treat it as “unknown” and fail safe by requiring additional checks or applying stricter policies.
  • Put new or unresolved domains into a short recheck queue (e.g., retry after a few minutes or hours) and alert if the domain is critical to workflow.

Mapping to your taxonomy

  • When your policies require categories beyond domain age (e.g., allowlists/denylists), use IAB mappings from the categorization endpoint and maintain a lookup table to your internal policy groups.
  • Normalize category names and codes at ingest time to avoid downstream conditionals scattered across services.

Build it into your data pipeline

  1. Ingest: Extract domains from events (HTTP logs, signups, vendor lists).
  2. Normalize: Lowercase, strip subdomains as needed, and validate syntax.
  3. Deduplicate: Use a set or a daily rolling Bloom filter to cut redundant calls.
  4. Enrich: Call the domain age endpoint; optionally call categorization for IAB mappings.
  5. Cache: Persist results keyed by registrable domain with a 24-hour TTL; include a next-refresh timestamp.
  6. Act: Evaluate business rules:
    • Block/allow or step-up verification based on age thresholds.
    • Create tasks or alerts for expiring domains.
    • Score signups or partners using age_days_ago as a feature.
  7. Observe: Log request latency, success flags, and response completeness. Failed or unreachable calls are not billed, but you should still retry per your policies.

Quality and governance considerations

  • Dates and timezone: Dates are returned as YYYY-MM-DD. Store them as dates rather than strings to prevent locale parsing issues.
  • Numeric day counts: The response provides days-ago and days-left as strings. Cast them to integers for comparisons and analytics.
  • SLA checks: Add monitors for unexpected spikes in unknown/missing fields and for response latency vs. your pipeline SLAs.
  • Idempotency: If you run enrichment jobs repeatedly, check your cache first to limit redundant calls.

Plan, billing, and getting access

Starter is $39.99/mo with a 7-day trial. Failed or unreachable calls are not billed. You can create a free account and get your API key here: Register. For implementation specifics, see the Documentation. If you are evaluating model compliance, the MCP page covers details.

FAQ

  • Does the API return both domain age and expiration? Yes. You’ll receive creation date and age in days, plus expiration date and days left. Cast the day counts to integers for comparisons.
  • How often should I refresh domain age data? For most use cases, once per day is sufficient. If you watch for impending expirations, refresh more frequently as the date approaches.
  • How do I block newly registered domains? After calling the endpoint, check domain_age_days_ago < your threshold (e.g., 7 or 14). Deny or step-up authenticate the request, and re-evaluate as the cache refreshes.
  • Can I combine age checks with content categories? Yes. Use the main categorization endpoint for IAB categories and apply combined rules (e.g., new domains in sensitive categories are blocked).
  • What happens if the request fails? Implement retries with backoff and consult logs. Failed or unreachable calls are not billed, but ensure your pipeline fails safe with conservative defaults.

Ready to add domain age checks to your risk gates, signup enrichment, or ad placements? Create your free account to get an API key and start testing today: Register. For request/response details and examples, visit the Documentation, and review compliance notes on the MCP page.

Ready to use Klazify?

Start classifying websites, enriching company data, and exploring web intelligence.

Get Started Free