Skip to content

apiverve/whois-lookup-python-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

WHOIS Lookup Tool | APIVerve API Tutorial

License: MIT Build Python APIVerve | WHOIS Lookup

A Python CLI tool that looks up domain registration information. View registrar, dates, nameservers, and contact details.

Screenshot


Get Your Free API Key

This tutorial requires an APIVerve API key. Sign up free - no credit card required.


Features

  • Look up WHOIS data for any domain
  • View registrar information
  • See creation and expiry dates
  • View nameservers
  • See domain status codes
  • Contact information (when available)
  • Interactive mode or command-line arguments

Quick Start

  1. Clone this repository

    git clone https://github.com/apiverve/whois-lookup-python-tutorial.git
    cd whois-lookup-python-tutorial
  2. Install dependencies

    pip install -r requirements.txt
  3. Add your API key

    Open lookup.py and replace the API key:

    API_KEY = 'your-api-key-here'
  4. Run the tool

    Interactive mode:

    python lookup.py

    Command line mode:

    python lookup.py github.com

Usage Examples

Look up a domain

$ python lookup.py github.com

=======================================================
  WHOIS Lookup: github.com
=======================================================

  Registrar Information
  ---------------------------------------------------
  Registrar:      MarkMonitor Inc.
  Created:        2007-10-09
  Expires:        2026-10-09
  Updated:        2024-09-08

  Domain Status
  ---------------------------------------------------
    clientDeleteProhibited
    clientTransferProhibited
    clientUpdateProhibited

  Nameservers
  ---------------------------------------------------
    dns1.p08.nsone.net
    dns2.p08.nsone.net
    dns3.p08.nsone.net
    dns4.p08.nsone.net
    ns-1283.awsdns-32.org
    ns-1707.awsdns-21.co.uk
    ns-421.awsdns-52.com
    ns-520.awsdns-01.net

=======================================================

Project Structure

whois-lookup-python-tutorial/
├── lookup.py           # Main Python script
├── requirements.txt    # Dependencies (requests)
├── screenshot.jpg      # Preview image
├── LICENSE             # MIT license
├── .gitignore          # Git ignore rules
└── README.md           # This file

How It Works

  1. User provides a domain name
  2. Script cleans and validates the input
  3. API queries WHOIS database
  4. Script formats and displays results

The API Call

response = requests.get(
    'https://api.apiverve.com/v1/whoislookup',
    params={'domain': domain},
    headers={'x-api-key': API_KEY}
)

API Reference

Endpoint: GET https://api.apiverve.com/v1/whoislookup

Query Parameters:

Parameter Type Required Description
domain string Yes Domain to look up (e.g., "google.com")

Example Response:

{
  "status": "ok",
  "error": null,
  "data": {
    "domainName": "MYSPACE.COM",
    "registrar": "GoDaddy.com, LLC",
    "createdDate": "1996-02-22T05:00:00Z",
    "expiryDate": "2029-02-23T05:00:00Z",
    "updatedDate": "2023-01-17T00:16:21Z",
    "domainStatus": [
      "client delete prohibited",
      "client transfer prohibited"
    ],
    "nameServers": [
      "ns-cloud-a1.googledomains.com",
      "ns-cloud-a2.googledomains.com"
    ],
    "registrarURL": "http://www.godaddy.com"
  }
}

Use Cases

  • Domain research - Check who owns a domain
  • Due diligence - Verify domain ownership
  • Expiry tracking - Monitor domain expiration
  • Brand protection - Find infringing domains
  • Security investigation - Research suspicious domains
  • Sales prospecting - Find domain contact info

Customization Ideas

  • Add domain expiry alerts
  • Monitor multiple domains from a list
  • Save results to CSV/JSON
  • Build a web interface
  • Compare WHOIS history over time
  • Integrate with CRM systems

Related APIs

Explore more APIs at APIVerve:

Free Plan Note

This tutorial works with the free APIVerve plan. Some APIs may have:

  • Locked fields: Premium response fields return null on free plans
  • Ignored parameters: Some optional parameters require a paid plan

The API response includes a premium object when limitations apply. Upgrade anytime to unlock all features.

License

MIT - see LICENSE

Links

About

WHOIS lookup tool for domain registration information using Python

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages