Python client for SniffCat API.
Project description
sniffcat
Python client for the SniffCat IP reputation and abuse reporting API. https://pypi.org/project/sniffcat/
Features
- Fetch blacklist of suspicious IPs
- Check reputation and abuse score for any IP
- View reports about IP activity
- Report suspicious IPs (e.g., for port scanning, spam, malware, etc.)
Installation
pip install sniffcat
Usage
from sniffcat import SniffCatClient
# Initialize the client with your API token
client = SniffCatClient("your_api_token")
# Example 1: Get blacklist with default confidence
blacklist = client.get_blacklist()
print("Blacklist:", blacklist)
# Example 2: Get blacklist with custom confidence
blacklist_80 = client.get_blacklist(confidence_min=80)
print("Blacklist (confidence >= 80):", blacklist_80)
# Example 3: Check reputation and abuse score for an IP
ip_info = client.check_ip("1.1.1.1")
print("IP info:", ip_info)
# Example 4: Get reports for an IP
reports = client.get_ip_reports("1.1.1.1")
print("IP reports:", reports)
# Example 5: Report an IP for port scanning with default comment
result = client.report_ip_port_scan("1.1.1.1")
print("Report result:", result)
# Example 6: Report an IP for port scanning with custom comment
result_custom = client.report_ip_port_scan("1.1.1.1", comment="Suspicious port scan detected from this IP")
print("Custom report result:", result_custom)
# Example 7: Report IP as spam (category 2) and malware (category 3)
result_multi = client.report_ip("1.2.3.4", [2, 3], comment="Spam and malware activity detected")
print("Multi-category report result:", result_multi)
Categories
See all available categories at https://sniffcat.com/documentation/categories
API Documentation
See full API docs at https://sniffcat.com/documentation/api
License
MIT
Changelog
[0.1.8] - 2025-09-02
Changed
- The payload key for reporting IPs was changed from
categorytocategoriesinreport_ip()to match SniffCat API requirements.
Added
- Custom
User-Agentheader:
Now all requests use
Mozilla/5.0 (compatible; SniffCat.py/{version}; +https://github.com/SniffCatDB/sniffcat.py)
to help bypass Cloudflare Bot Fight Mode.
Fixed
- Improved error handling for non-JSON responses from the API.
- Documentation and usage examples updated to use
SniffCatClientand the newcategoriesparameter.
Older changes available
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sniffcat-0.1.8.tar.gz.
File metadata
- Download URL: sniffcat-0.1.8.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
152a38c4063f67b2b18488d04076e4a0c1b4651c1b19cd8062b8efea988c215b
|
|
| MD5 |
25ab893cd691a5dadace20ecb292bf55
|
|
| BLAKE2b-256 |
2931194a62fe0bd099cd5b2b1282744178515ab2b4344d0f3d849ac858f1df64
|
File details
Details for the file sniffcat-0.1.8-py3-none-any.whl.
File metadata
- Download URL: sniffcat-0.1.8-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1024ad3b35961cb0db4a9f00c0513ef41c6c4c378bdbe7aa281326bcb91e382
|
|
| MD5 |
db3120ef56929e23cf0a4ae359a5a52f
|
|
| BLAKE2b-256 |
0ff6bfb4f6ed410dfa519097cf140769423aca8de7d0bfca16f129f0fe3530bb
|