A domain that expires takes the website, the e-mail and every subdomain down with it, and the renewal reminder usually goes to a mailbox nobody reads. The opposite question, "is this name free?", is asked just as often and is often answered by parsing WHOIS text that differs from one registry to the next.
Both questions have the same clean answer: RDAP, the official successor of WHOIS. It is free, it needs no account, and it returns JSON straight from the registry.
What RDAP gives you, and what it does not
RDAP (RFC 9082 and 9083) is one HTTPS request per domain:
- HTTP 404 means the registry has no registration for that name.
- HTTP 200 returns a JSON object with
events(registration, expiration, last changed),statuscodes, nameservers and the registrar.
Three things to know before you rely on it:
1. Not every TLD has it. Generic TLDs (.com, .net, .org, .dev, .app...) offer RDAP. Many country TLDs do not: .io, .de, .co, .eu and .jp have no RDAP server in the IANA list at the time of writing. That list is published at https://data.iana.org/rdap/dns.json.
2. "No registration" is not "you can buy it". A registry can hold a name back (reserved names) or sell it at a premium price. Only a registrar's checkout is final.
3. The status codes matter as much as the date. redemption period and pending delete mean the domain has already expired and is on its way out. client hold and server hold mean it is registered but removed from DNS, so nothing on it works.
Option A: curl for one domain
curl -s https://rdap.verisign.com/com/v1/domain/github.com curl -s -o /dev/null -w "%{http_code}\n" https://rdap.verisign.com/com/v1/domain/mybrandidea2027.com The first command returns the full record: look for the expiration entry in events and for the status array. The second prints 404: no such registration. rdap.verisign.com/com/v1 is the server for .com; for another TLD, take the URL from the IANA file above.
Option B: a short Python script for a list
Standard library only. It reads the IANA list once, then asks the right registry for each domain in domains.txt:
import json, sys, time, urllib.request, urllib.error from datetime import datetime, timezone boot = json.load(urllib.request.urlopen("https://data.iana.org/rdap/dns.json", timeout=30)) servers = {tld: urls[0] for tlds, urls in boot["services"] for tld in tlds} def check(domain): base = servers.get(domain.rsplit(".", 1)[-1]) if not base: return "no RDAP for this TLD" try: req = urllib.request.Request(base.rstrip("/") + "/domain/" + domain, headers={"User-Agent": "domain-check"}) data = json.load(urllib.request.urlopen(req, timeout=30)) except urllib.error.HTTPError as e: return "not registered" if e.code == 404 else f"HTTP {e.code}, retry later" exp = next((e["eventDate"] for e in data.get("events", []) if e["eventAction"] == "expiration"), None) if not exp: return "registered, no expiry date published" days = (datetime.fromisoformat(exp.replace("Z", "+00:00")) - datetime.now(timezone.utc)).days return f"expires {exp[:10]} ({days} days) {' '.join(data.get('status', []))}" for line in open(sys.argv[1], encoding="utf-8"): d = line.strip().lower() if d: print(d, "->", check(d)) time.sleep(1) Run it with python check.py domains.txt. Output from a real run:
github.com -> expires 2028-10-09 (687 days) client delete prohibited client transfer prohibited client update prohibited mybrandidea2027.dev -> not registered stripe.io -> no RDAP for this TLD wikipedia.org -> expires 2027-01-13 (51 days) client delete prohibited client transfer prohibited client update prohibited Two details cost time if you skip them. Send a User-Agent header: without one, the .org registry answered 403 in our test. And go slowly: registries rate-limit RDAP, which is why the script waits one second between domains and reports other HTTP errors instead of guessing.
Limits of this script: it expects registrable domains (example.co.uk, not www.example.co.uk or a URL), it has no answer for TLDs without RDAP, it does not retry, and it runs one domain at a time. Put it in cron with a filter on the number of days and you have a working expiry alert for a small portfolio.
Option C: a hosted checker for long lists and schedules
Disclosure: this one is ours. We publish Domain Availability Checker on Apify. It does the same RDAP lookups and adds what the script lacks: bare names combined with a list of TLDs, URLs and subdomains reduced to the registrable domain, a few parallel requests per registry with wait and retry (up to 4 attempts), and a DNS fallback for TLDs without RDAP.
{ "domains": ["apify.com", "https://github.com/login", "mybrandidea2027"], "tlds": ["com", "net", "org", "dev"], "warnDays": 30 } mybrandidea2027 has no dot, so it is checked on the four TLDs. A registered domain comes back like this (real run, shortened):
{ "domain": "github.com", "available": false, "source": "rdap", "registrar": "MarkMonitor Inc.", "expiresAt": "2028-10-09T18:20:50+00:00", "daysLeft": 689, "expiresSoon": false, "statuses": ["client delete prohibited", "client transfer prohibited", "client update prohibited"], "dnssec": false, "warnings": [] } Scheduled weekly, a filter on expiresSoon or on a non-empty warnings gives the alert. Only the registrar (a company) is read: registrant and contact data are never collected, so this is not a WHOIS contact lookup.
It is free during launch: there is no per-domain fee at the moment, you only pay Apify's own platform usage, which the Free plan's monthly credit covers for normal use.
Its limits, stated plainly:
-
available: truemeans the registry has no registration; reserved and premium names look the same. - On a TLD without RDAP, a name found in DNS is reported as registered, without expiry date or registrar. A name not found in DNS gets
available: nulland a warning, because a domain can be registered without nameservers. - Some registries publish no expiry date or registrar: those fields are then null, never guessed.
- A domain still refused by a registry after the retries is returned with
error; run it again later. - It cannot tell you a price.
What to do with the results
- Under 30 days: renew now, and turn on auto-renew with a payment card that is still valid.
-
redemption period: the domain can still be restored through your registrar, at a higher fee. Do not wait forpending delete. - Check the domains you forgot: old brands, campaign sites, the domain behind your e-mail. Those are the ones that expire.
