
There's a Free WHOIS API — Look Up Any Domain's Registration Data Programmatically
I was researching a suspicious email. The sender's domain was registered 3 days ago. That's a red flag. I found it using a free WHOIS API — no key, no signup, just a GET request. The Free WHOIS APIs Several services offer free WHOIS lookups via API: 1. RDAP (Registration Data Access Protocol) RDAP is the official replacement for WHOIS, maintained by IANA. It returns structured JSON. import requests def rdap_lookup ( domain ): # RDAP bootstrap finds the right registry automatically resp = requests . get ( f ' https://rdap.org/domain/ { domain } ' ) if resp . status_code != 200 : return { ' error ' : f ' Status { resp . status_code } ' } data = resp . json () # Extract key info result = { ' domain ' : domain } # Registration dates for event in data . get ( ' events ' , []): if event [ ' eventAction ' ] == ' registration ' : result [ ' registered ' ] = event [ ' eventDate ' ][: 10 ] elif event [ ' eventAction ' ] == ' expiration ' : result [ ' expires ' ] = event [ ' eventDate ' ][: 10 ]
Continue reading on Dev.to Python
Opens in a new tab




