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.
pip install whoisjsonfrom 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}")The client provides access to the following WhoisJSON API endpoints:
whois(domain): Get WHOIS information for a domainnslookup(domain): Get DNS records for a domainssl_cert_check(domain): Get SSL certificate information for a domain
- Simple and intuitive API
- Type hints for better IDE support
- Proper error handling
- Support for both free and premium API access
- Comprehensive examples included
Check out the examples directory for ready-to-use example scripts demonstrating all features.
To run the demo:
python examples/demo.py- Python 3.6+
- requests>=2.25.0
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.