Skip to content

Whoisjson/whoisjson-python-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhoisJSON Python Client

A simple and reusable Python client for the WhoisJSON API service.

Free accounts include 500 requests per month. Check out our full documentation for more details about our API.

Installation

pip install whoisjson

Usage

from whoisjson import WhoisJsonClient

# Initialize the client
client = WhoisJsonClient(api_key="your-api-key")

# 1. WHOIS Lookup
try:
    whois_result = client.whois("example.com")  # or client.lookup() for backward compatibility
    print(whois_result)
except Exception as e:
    print(f"Error: {e}")

# 2. DNS Lookup
try:
    dns_result = client.nslookup("example.com")
    print(dns_result)
except Exception as e:
    print(f"Error: {e}")

# 3. SSL Certificate Check
try:
    ssl_result = client.ssl_cert_check("example.com")
    print(ssl_result)
except Exception as e:
    print(f"Error: {e}")

Available Endpoints

The client provides access to the following WhoisJSON API endpoints:

  1. whois(domain): Get WHOIS information for a domain
  2. nslookup(domain): Get DNS records for a domain
  3. ssl_cert_check(domain): Get SSL certificate information for a domain

Features

  • Simple and intuitive API
  • Type hints for better IDE support
  • Proper error handling
  • Support for both free and premium API access
  • Comprehensive examples included

Examples

Check out the examples directory for ready-to-use example scripts demonstrating all features.

To run the demo:

python examples/demo.py

Requirements

  • Python 3.6+
  • requests>=2.25.0

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Releases

No releases published

Packages

No packages published

Languages