Skip to main content

Find where to report a domain for abuse

Project description


PyPI version Python CI Coverage Status

Yet another way to find where to report an abuse.


This tool is highly inspired from the following libraries:


  • Python 3.10+


pip install abuse_whois

# or if you want to use built-in REST API
pip install abuse_whois[api]


As a library

from abuse_whois import get_abuse_contacts

await get_abuse_contacts("")
await get_abuse_contacts("")
await get_abuse_contacts("")
await get_abuse_contacts("")

As a CLI tool

$ abuse_whois | jq .


$ uvicorn abuse_whois.api.main:app
INFO:     Started server process [2283]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on (Press CTRL+C to quit)

$ http localhost:8000/api/whois/ address=

With Docker

git clone
cd abuse_whois
docker build . -t abuse-whois
docker run -i -d -p 8000:8000 abuse-whois


All settings can be done via environment variables or .env file.

Name Type Default Desc.
QUERY_TIMEOUT int 10 Timeout value for whois lookup (seconds)
QUERY_CACHE_SIZE int 1024 Cache size for whois lookup
QUERY_CACHE_TTL int 3600 Cache TTL value for whois lookup (seconds)
QUERY_MAX_RETRIES int 3 Max retries on timeout error
RULE_EXTENSIONS CommaSeparatedStrings yaml,yml Rule file extensions
ADDITIONAL_WHOIS_RULE_DIRECTORIES CommaSeparatedStrings Additional directories contain whois rule files
ADDITIONAL_SHARED_HOSTING_RULE_DIRECTORIES CommaSeparatedStrings Additional directories contain shared hosting rule files


abuse_whois works based on a combination of static rules and a parsing result of whois response.

Please submit a PR (or submit a feature request) if you find something missing.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abuse_whois-0.8.4.tar.gz (17.2 kB view hashes)

Uploaded source

Built Distribution

abuse_whois-0.8.4-py3-none-any.whl (34.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page