Developer Libraries
Third-party Integrations
Unlock WHOIS Data with Python: WhoisFreaks SDK Made Simple
The WhoisFreaks Python SDK offers robust WHOIS lookup functionality, allowing developers to access both real-time and historical WHOIS data. This enables you to retrieve comprehensive domain registration details, monitor ownership history, and analyze domain changes—making it an essential resource for domain research and cybersecurity efforts.
How to perform WHOIS Lookup(s) Using Python?
The Python WHOIS SDK package enables you to perform a wide range of WHOIS lookups, including live, historical, reverse, and bulk live lookup queries.
To use the WhoisFreaks Go SDK for WHOIS lookups, follow these steps:
First, ensure that Python and the WhoisFreaks Python SDK are installed on your system. To install the necessary modules, please visit the Installation Steps page.
In all lookups, replace "your_api_key" with your actual API key.
-
Whois Live Lookup
whois_lookup (with whois='live' as param) fetches real-time WHOIS information for a specific domain using the WhoisFreaks WHOIS Lookup service.
python Copywhois_lookup(whois='live', api_key='your_api_key', domain_name='example.com')
Parameter:
- domain_name: The domain name for which live WHOIS information is requested (e.g., "example.com").
- api_key: Get your API key from our billing dashboard.
- format: Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
Returns:
- Success: A JSON string containing the domain_info structure with live domain details.
- Error: A JSON string containing the error structure if an API error occurs, or 'nil' if the request fails.
For a comprehensive details of response fields, please refer to the WHOIS Live documentation.Example Usage:
python Copyfrom whoisfreaks import WhoisfreaksApi from whoisfreaks.core.api_error import ApiError client = WhoisfreaksApi() try: response = client.whois_lookup(whois='live', api_key='your_api_key', domain_name='example.com') response = {k: v for k, v in response.dict().items() if v is not None} # Filtering the Null values print(response) except ApiError as e: print(e.body)
Replace "example.com" with the domain you wish to query.
-
Whois Bulk Live Lookup
bulk_domain_lookup retrieves live WHOIS data for multiple domains simultaneously using WhoisFreaks' WHOIS Bulk Lookup module. Please note that the maximum limit is 100 domains per request. If you need to perform a live DNS lookup for more than 100 domains, you can contact us or sign in to submit a bulk request via file upload. You may upload a file containing over 100 domains, up to a maximum of 3,000,000.
python Copybulk_domain_lookup(api_key='your_api_key', domain_names=['google.es', 'hey.com', 'jfreaks.com', 'ss.ssss'])
Parameters:
- domain_names: A list of strings containing the domain names for which live WHOIS information is requested.
- api_key: Get your API key from our billing dashboard.
- format: Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
Returns:
- Success: A JSON list of bulk_whois_response containing a structure with live domain information for all requested domain names in the bulk request.
- Error: A JSON string containing the error structure if an API error occurs, or 'nil' if the request fails.
For a comprehensive details of response fields, please visit the Bulk WHOIS Lookup's documentation.Example Usage:
python Copyfrom whoisfreaks import WhoisfreaksApi from whoisfreaks.core.api_error import ApiError client = WhoisfreaksApi() try: response = client.bulk_domain_lookup(api_key='your_api_key', domain_names=['google.es', 'hey.com', 'jfreaks.com', 'ss.ssss']) response = {k: v for k, v in response.dict().items() if v is not None} # Filtering the Null values print(response) except ApiError as e: print(e.body)
Replace the domain names in the domain_names list with the domains you wish to query.
-
Whois Historical Lookup
whois_lookup (with whois='historical' as param) retrieves historical WHOIS information for a domain using WhoisFreaks' Historical Lookup service.
python Copy.whois_lookup(whois='historical', api_key='your_api_key', domain_name='example.com')
Parameter:
- domain_name: The domain name for which historical WHOIS information is requested (e.g., "example.com").
- api_key: Get your API key from our billing dashboard.
- format: Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
Returns:
- Success: A JSON string containing the whois_domains_historical structure with historical domain information..
- Error: A JSON string containing the error structure if an API error occurs, or 'nil' if the request fails.
For a comprehensive details of response fields, you can visit the WHOIS Historical's documentation.Example Usage:
python Copyfrom whoisfreaks import WhoisfreaksApi from whoisfreaks.core.api_error import ApiError client = WhoisfreaksApi() try: response = client.whois_lookup(whois='historical', api_key='your_api_key', domain_name='google.com') response = {k: v for k, v in response.dict().items() if v is not None} # Filtering the Null values print(response) except ApiError as e: print(e.body)
Replace "example.com" with the domain you wish to query.
-
Whois Reverse Lookup
whois_lookup (with whois='reverse' as param) performs a reverse whois lookup using the WhoisFreaks' reverse lookup module from Python SDK.
python Copywhois_lookup(whois='reverse', api_key='your_api_key', keyword='example')
Parameters:
- keyword: The keyword to search for in domain records.
- email: The email address to search for in domain records.
- company: The company name to search for in domain records.
- owner: The owner name to search for in domain records. Provide only one parameter from the four options mentioned above.
- mode: Two modes are available mini & default. Just like Reverse Lookup whois.reverse_lookup is used to perform a reverse whois lookup in mini mode with an extra param in it i.e., mode='mini'. By default, mode is set to default.
- format: Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
- exact: The 'exact' parameter can be either 'true' or 'false'. Exact match is allowed only in case of keywords, owner/registrant, or company, not emails as in case of emails response is already fetched based on exact match.
- page: The optional page number for paginated results. Leave empty for the first page.
- api_key: Get your API key from our billing dashboard.
Returns:
- Success: A JSON string containing a whois_domains_historical struct with reverse whois information and some other info.
- Error: A JSON string containing the error structure if an API error occurs, or 'nil' if the request fails.
For detailed info about the response fields, you can visit the Reverse Whois Lookup's documentation.Example Usage:
python Copyfrom whoisfreaks import WhoisfreaksApi from whoisfreaks.core.api_error import ApiError client = WhoisfreaksApi() try: response = client.whois_lookup(whois='reverse', api_key='your_api_key', keyword='example') response = {k: v for k, v in response.dict().items() if v is not None} # Filtering the Null values print(response) except ApiError as e: print(e.body)
Replace keyword, email, owner, company, and page with the desired keyword, email address, owner name, company name, and page number, respectively.
-
IP Whois Lookup
ip_whois_lookup fetches real-time WHOIS information for a specific domain using the WhoisFreaks WHOIS Lookup service.
python Copyip_whois_lookup(api_key='your_api_key', ip='1.1.1.1')
Parameter:
- ip: The IPv4 or IPv6 for which IP WHOIS information are requested (e.g., "8.8.8.8", "fe80::200:5aee:feaa:20a2").
- api_key: Get your API key from our billing dashboard.
- format: Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
Returns:
- Success: A JSON string containing the ip_info structure with different IP details.
- Error: A JSON string containing the error structure if an API error occurs, or 'nil' if the request fails.
For a more details related to the response fields, you can visit the IP Lookup's documentation.Example Usage:
python Copyfrom whoisfreaks import WhoisfreaksApi from whoisfreaks.core.api_error import ApiError client = WhoisfreaksApi() try: response = client.ip_whois_lookup(api_key='your_api_key', ip='1.1.1.1') response = {k: v for k, v in response.dict().items() if v is not None} # Filtering the Null values print(response) except ApiError as e: print(e.body)
Replace "fe80::200:5aee:feaa:20a2" with the IPv4 or IPv6 you wish to query.
-
ASN Whois Lookup
asn_lookup fetches real-time ASN information for a specific Autonomous System Number using the WhoisFreaks ASN Lookup tool.
python Copyasn_lookup(api_key='your_api_key', asn='1213')
Parameter:
- asn: The ASN number for which information is being requested (e.g., "1" or "AS1").
- api_key: Get your API key from our billing dashboard.
- format: Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
Returns:
- Success: A JSON string containing the asn_info structure with real time ASN details.
- Error: A JSON string containing the error structure if an API error occurs, or 'nil' if the request fails.
For a comprehensive details of response fields, please refer to the ASN Lookup's documentation.Example Usage:
python Copyfrom whoisfreaks import WhoisfreaksApi from whoisfreaks.core.api_error import ApiError client = WhoisfreaksApi() try: response = client.asn_lookup(api_key='your_api_key', asn='1213') response = {k: v for k, v in response.dict().items() if v is not None} # Filtering the Null values print(response) except ApiError as e: print(e.body)
Replace "AS1213" with the ASN you wish to query.
To perform other lookups using the Python SDK, click on one of the related options below.
DNS Lookups
Provides live, reverse, historical, and bulk DNS lookup services.
Domain Availability
Checks domain availability across TLDs and suggests alternatives.
SSL Lookups
Performs SSL lookup and shows certificate chain from start to present.
Access the official WhoisFreaks Python SDK documentation for detailed WHOIS lookup functionality.

WhoisFreaks Python SDK
Use this powerful Python-based SDK to easily integrate, interact with, and manage data from the WhoisFreaks API seamlessly.
whoisfreaks.docs.buildwithfern.com