Python Power: Dive Deep into WHOIS Record Data.

Getting WHOIS record data use case.


Sometimes as a webmaster you have to check WHOIS records for certain domain and there is a very useful online service for web developers and SEO professionals on "WhoisXML API" that provides Domain & IP Data Intelligence for Greater Enterprise Security and RESTful APIs that we will use.

Using it's APIs you can perform many handy data requests, for example check WHOIS data of a certain domain name, an IP address, or an email address. You will need to register and get your personal API key.

WHOIS record data check.



This Python script below will use information from "WhoisXML API" and present it in text form as a output without the need to use a web browser.
Checking WHOIS data can be easily automated now !



Python code to check WHOIS record data:



import requests


# website = 'python-code.pro'
website = 'yandex.ru'

APIKEY ='at_ZUVkrukr4Uhhhsfq2j6dyv2VhFGWYV'
    
whois_url = f'https://www.whoisxmlapi.com/whoisserver/WhoisService?apiKey={APIKEY}&domainName={website}'

r = requests.get(whois_url)

whois_info = r.text.lower()

print(f'For {website} domain.')
print(f'\n Whois information: {whois_info}')

WHOIS record data output:


whois data output.





See also related topics: