Skip to content

🔎 A free no-CORS WHOIS/RDAP lookup API, for fetching domain registration info

License

Notifications You must be signed in to change notification settings

Lissy93/who-dat

Repository files navigation


Free & Open Source WHOIS Lookup Service
No-CORS, no auth API that's publicly available or easily self-hostable
🌐 who-dat.as93.net


Contents

API Usage

TL;DR Get the WHOIS records for a site: curl https://who-dat.as93.net/example.com

For detailed request + response schemas, and to try the API out, you can reference the spec

Base URL

The base URL for the public API is who-dat.as93.net

If you're self-hosting (recommended) then replace this with your own base URL.

Endpoints

Single Domain Lookup /[domain]

  • URL: /[domain]
  • Method: GET
  • URL Params: None
  • Success Response:
    • Code: 200
    • Content: WHOIS data for the specified domain in JSON format.
  • Error Response:
    • Code: 400 BAD REQUEST
    • Content: { "error": "Domain not specified" }
    • Code: 404 NOT FOUND
    • Content: { "error": "Domain not found" }
  • Sample Call:
Command Line
curl https://who-dat.as93.net/example.com
JavaScript
fetch('https://who-dat.as93.net/example.com')
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
Python
import requests

response = requests.get('https://who-dat.as93.net/example.com')
if response.status_code == 200:
    print(response.json())
else:
    print("Error:", response.status_code)

Multiple Domain Lookup /multi

  • URL: /multi
  • Method: GET
  • Query Params:
    • domains: A comma-separated list of domains.
  • Success Response:
    • Code: 200
    • Content: Array of WHOIS data for the specified domains in JSON format.
  • Error Response:
    • Code: 400 BAD REQUEST
    • Content: { "error": "No domains specified" }
    • Code: 500 INTERNAL SERVER ERROR
    • Content: { "error": "[error message]" }
  • Sample Call:
curl "https://who-dat.as93.net/multi?domains=example.com,example.net"

Who-Dat Swagger Docs


Deployment

Option 1: Vercel

This is the quickest and easiest way to get up-and-running. Simply fork the repository, then login to Vercel (using GitHub), and after importing your fork, it will be deployed! There's no additional config or keys needed, and it should work just fine on the free plan.

Alternatively, just hit the button below for 1-click deploy 👇

1-Click Deploy to Vercel

Option 2: Docker

The light-weight Docker image is published to DockerHub (hub.docker.com/r/lissy93/who-dat), as well as GHCR (here).

Providing you've got Docker installed, you can get everything by running:

docker run -p 8080:8080 --dns 8.8.8.8 --dns 8.8.4.4 lissy93/who-dat

Deploy from Docker

Option 3: Binary

Head to the Releases Tab, download and extract the pre-built executable for your system, then run it.

Example

If you're using the command line, you can do something like this
Don't forget to update (v1.0) with the version number you want, and (linux-amd64) with your system's architecture.

# Download the binary for your system (from releases tab)
wget https://github.com/Lissy93/who-dat/releases/download/v0.9/who-dat-v0.9-linux-amd64.tar.gz -O ./who-dat.tar.gz

# Extract the compressed file
tar -xzvf who-dat.tar.gz

# Make it executable
chmod +x who-dat

# Run Who-Dat!
./who-dat

(Or, if you're a Microsoft fanboy, you can just double-click the who-dat.exe after extracting in Windows Explorer)

Option 4: Build from Source

Follow the setup instructions in the Development section.
Then run go build -a -installsuffix cgo -o who-dat . to generate the binary for your system.
You'll then be able to execute the newly built ./who-dat file directly to start the application.


Authentication

Authentication is optional, and can be enabled by setting the AUTH_KEY environment variable.

When authentication is enabled, all API requests must include the key in the Authorization header, using one of the formats indicated below.

Raw API Key

curl -H "Authorization: your-secret-key" https://who-dat.yourdomain.com/example.com

Bearer Token Format

curl -H "Authorization: Bearer your-secret-key" https://who-dat.yourdomain.com/example.com

If authentication is not configured (no AUTH_KEY set), the API will remain publicly accessible.


Development

Prerequisites: You'll need Go and Node installed. You will likley also want Git and/or Docker.

git clone [email protected]:Lissy93/who-dat.git
cd who-dat
go get
npm install
npm run build

Then run either npx vercel dev, or go run main.go

Alternativley, build the Docker container with docker build -t who-dat .

Open in GitPod Open in VS Code


Web Interface

There's a very simple frontend included in the app. This is built with Alpine.js, so is super light-weight, and only adds about 100kb to the total executable. The web interface is used to view WHOIS records for a given domain, and also hosts the API documentation.


Contributing

Contributions of any kind are welcome (and would be much appreciated!). Be sure to follow our Code of Conduct.
If you're new to open source, I've put together some guides in Git-In, but feel free to reach out if you need any support.

Not a coder? You can still help, by raising bugs you find, updating docs, or consider sponsoring me on GitHub

Sponsor


Mirror

We've got a (non-Microsoft) mirror of this repository hosted on CodeBerg, at codeberg.org/alicia/who-dat

CodeBerg Mirror


Credits

Inspiration

This project was inspired by someshkar/whois-api by Somesh Kar.

Tech Credits
  • The frontend is built with Alpine.js1, Vite2, TS3 and SCSS4 (plus the usual web tech stack).
  • The backend is written in Go5, and was made possible thanks to json-iterator/go and likexian/whois-parser
  • Demo deployed to Vercel6 (but also available on DockerHub7), and source of course on GitHub8 and CodeBerg9.
Contributors
liss-bot
Alicia Bot
Lissy93
Alicia Sykes
SamLS98
Sammy LS
phill-holland
Phill Holland
Sponsors
vincentkoc
Vincent Koc
AnandChowdhary
Anand Chowdhary
shrippen
Shrippen
bile0026
Zach Biles
UlisesGascon
Ulises Gascón
digitalarche
Digital Archeology
InDieTasten
InDieTasten
araguaci
Araguaci
bmcgonag
Brian McGonagill
vlad-tim
Vlad
helixzz
HeliXZz
patvdv
Patrick Van Der Veken
MioOgbeni
Tomáš Novák
mryesiller
Göksel Yeşiller
sushibait
Shiverme Timbers
forwardemail
Forward Email - Open-source & Privacy-focused Email Service (2023)
getumbrel
Umbrel
OlliVHH
HamburgerJung
frankdez93
Frankdez93
terminaltrove
Terminal Trove
st617
St617
nrvo
Nrvo
hudsonrock-partnerships
Hudsonrock-partnerships

More Like This

You might be interested in Web-Check, an all-in-one tool for fetching info on a given domain name.

If you like projects like these, consider following me on GitGub 😊
I'm often putting out new (free & open source) utilities, relating to security, privacy, OSINT, Linux and self-hosting.


License

Lissy93/Who-Dat is licensed under MIT © Alicia Sykes 2024.
For information, see TLDR Legal > MIT

Expand License
The MIT License (MIT)
Copyright (c) Alicia Sykes <[email protected]> 

Permission is hereby granted, free of charge, to any person obtaining a copy 
of this software and associated documentation files (the "Software"), to deal 
in the Software without restriction, including without limitation the rights 
to use, copy, modify, merge, publish, distribute, sub-license, and/or sell 
copies of the Software, and to permit persons to whom the Software is furnished 
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included install 
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANT ABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

© Alicia Sykes 2024
Licensed under MIT

Thanks for visiting :)

References

➧ See Credits

Footnotes

  1. Alpine.js - A rugged, minimal framework for composing JavaScript behavior in your markup.

  2. Vite - A build tool that aims to provide a faster and leaner development experience for modern web projects.

  3. TypeScript - A typed superset of JavaScript that compiles to plain JavaScript.

  4. SCSS - A preprocessor scripting language that is interpreted or compiled into Cascading Style Sheets (CSS).

  5. Go Lang - An open source programming language that makes it easy to build simple, reliable, and efficient software.

  6. Vercel - Static hosting and shit

  7. DockerHub - Container registry hosting and shit

  8. GitHub - A platform for version control and collaboration. It lets you and others work together on projects from anywhere.

  9. Codeberg - A free and open-source forge for collaborative software development.