Developer Libraries

cURL
API

Python
API SDK

Javascript
API

C#
API

Go
API SDK

Java
API

Swift
API

C++
API

Node JS
API

PHP
API

Ruby
API

Third-party Integrations

make logo Make

MISP

MS Security Copilot

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 Copy
                                whois_lookup(whois='live', api_key='your_api_key', domain_name='example.com')
                            

    Parameter:

    1. domain_name: The domain name for which live WHOIS information is requested (e.g., "example.com").
    2. api_key: Get your API key from our billing dashboard.
    3. format: Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.

    Returns:

    1. Success: A JSON string containing the domain_info structure with live domain details.
    2. 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 Copy
                                from 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 Copy
                                bulk_domain_lookup(api_key='your_api_key', domain_names=['google.es', 'hey.com', 'jfreaks.com', 'ss.ssss'])
                            

    Parameters:

    1. domain_names: A list of strings containing the domain names for which live WHOIS information is requested.
    2. api_key: Get your API key from our billing dashboard.
    3. format: Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.

    Returns:

    1. Success: A JSON list of bulk_whois_response containing a structure with live domain information for all requested domain names in the bulk request.
    2. 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 Copy
                                from 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:

    1. domain_name: The domain name for which historical WHOIS information is requested (e.g., "example.com").
    2. api_key: Get your API key from our billing dashboard.
    3. format: Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.

    Returns:

    1. Success: A JSON string containing the whois_domains_historical structure with historical domain information..
    2. 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 Copy
                                from 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 Copy
                                whois_lookup(whois='reverse', api_key='your_api_key', keyword='example')
                            

    Parameters:

    1. keyword: The keyword to search for in domain records.
    2. email: The email address to search for in domain records.
    3. company: The company name to search for in domain records.
    4. owner: The owner name to search for in domain records.
    5. Provide only one parameter from the four options mentioned above.
    6. 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.
    7. format: Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
    8. 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.
    9. page: The optional page number for paginated results. Leave empty for the first page.
    10. api_key: Get your API key from our billing dashboard.

    Returns:

    1. Success: A JSON string containing a whois_domains_historical struct with reverse whois information and some other info.
    2. 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 Copy
                                from 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 Copy
                                ip_whois_lookup(api_key='your_api_key', ip='1.1.1.1')
                            

    Parameter:

    1. ip: The IPv4 or IPv6 for which IP WHOIS information are requested (e.g., "8.8.8.8", "fe80::200:5aee:feaa:20a2").
    2. api_key: Get your API key from our billing dashboard.
    3. format: Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.

    Returns:

    1. Success: A JSON string containing the ip_info structure with different IP details.
    2. 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 Copy
                                from 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 Copy
                                asn_lookup(api_key='your_api_key', asn='1213')
                            

    Parameter:

    1. asn: The ASN number for which information is being requested (e.g., "1" or "AS1").
    2. api_key: Get your API key from our billing dashboard.
    3. format: Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.

    Returns:

    1. Success: A JSON string containing the asn_info structure with real time ASN details.
    2. 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 Copy
                                from 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.


Access the official WhoisFreaks Python SDK documentation for detailed WHOIS lookup functionality.

Python SDK Integration

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