Menu

1 / 2

Domain WHOIS API: Get Registration, Expiry and Ownership Data in One Call

DEV Community·Alexey D·6 months ago
#pxxfALhS
#api#webdev#python#security#domain
Reading 0:00
15s threshold

Need to know who owns a domain or when it expires? One API call gives you everything.

Domain WHOIS Lookup API

import requests

r = requests . post ( " https://domainwhoislookup.p.rapidapi.com/whois " , json = { " domain " : " github.com " }, headers = { " X-RapidAPI-Key " : " YOUR_KEY " , " Content-Type " : " application/json " } ) print ( r . json ())

Enter fullscreen mode

Exit fullscreen mode

Response:

{ "domain" : "github.com" , "registrar" : "MarkMonitor, Inc." , "creation_date" : "2007-10-09T18:20:50" , "expiration_date" : "2026-10-09T18:20:50" , "days_until_expiry" : 157 , "name_servers" : [ "ns1.p16.dynect.net" ], "ip_address" : "140.82.113.4" , "is_expired" : false , "org" : "GitHub, Inc." , "country" : "US" }

Enter fullscreen mode

Exit fullscreen mode

Monitor domain expiry

def check_expiry ( domain ): r = requests .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.