A simple WHOIS lookup API built with Flask that allows users to query domain registration data. It uses the python-whois module to retrieve WHOIS information.
- Web Interface: Easily enter a domain name to use the API.
- Theming: Enjoy both dark and light themes in the UI.
- Endpoints:
/whois?domain=<domain>
/whois/<domain>
- Rate Limiting: Enabled by default. To edit, copy
.env.example
to.env
and adjust the setting.
- Installation via Docker (Online)
- Local Setup Instructions
- API Endpoint
- Credits
- License
- Contributing
- Author
You can run the pre-built Docker image from GitHub's Container Registry without needing to clone the repository:
docker run -p 5000:5000 ghcr.io/thebiemgamer/whoisapi:latest
After running the container, visit http://localhost:5000 to access the API.
- Docker (optional — for containerized deployment)
- Python 3.9+ (for local development)
For local development, clone the repository:
git clone https://github.com/TheBiemGamer/WhoIsApi.git
cd WhoIsApi
If you prefer to build your own Docker image:
docker build -t whois-api .
docker run -p 5000:5000 whois-api
Visit http://localhost:5000 after the container starts.
If you'd like to run the app directly on your machine:
-
Install Dependencies
pip install -r requirements.txt
-
Start the Application
- Using Flask's Development Server:
cd whoisapi flask run
- Using Gunicorn for a Production-like Environment:
gunicorn -w 4 -b 0.0.0.0:5000 whoisapi.app:app
Then, open your browser at http://localhost:5000.
Query WHOIS data for a specified domain.
- domain: The domain name to look up (e.g.,
example.com
).
GET /whois/example.com
or
GET /whois?domain=example.com
{
"address": null,
"city": null,
"country": null,
"creation_date": "1995-08-14T04:00:00",
"dnssec": "signedDelegation",
"domain_name": "EXAMPLE.COM",
"emails": null,
"expiration_date": "2025-08-13T04:00:00",
"name": null,
"name_servers": [
"A.IANA-SERVERS.NET",
"B.IANA-SERVERS.NET"
],
"org": null,
"referral_url": null,
"registrant_postal_code": null,
"registrar": "RESERVED-Internet Assigned Numbers Authority",
"registrar_url": "http://res-dom.iana.org",
"reseller": null,
"state": null,
"status": [
"clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited",
"clientTransferProhibited https://icann.org/epp#clientTransferProhibited",
"clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited"
],
"updated_date": "2024-08-14T07:01:34",
"whois_server": "whois.iana.org"
}
-
Invalid Domain Name:
{ "error": "Invalid domain name" }
-
No WHOIS Data Found:
{ "error": "No WHOIS data found for example.com" }
This project uses the python-whois library to fetch WHOIS information.
- python-whois: A Python wrapper for querying WHOIS servers and retrieving domain registration data.
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! If you’d like to contribute, please fork the repository and submit a pull request with your improvements or suggestions.