Skip to main content

Command-line interface for checking and reporting abusive IP addresses with AbuseIPDB

Project description

abip-cli

abip-cli is a Python package that installs the abip command for checking and reporting abusive IP addresses with the AbuseIPDB API.

It supports single IP lookups, CIDR block checks, abuse reports, and blacklist queries with either rich terminal output or JSON for scripting.

Features

  • Check the reputation of a single IP address
  • Inspect an entire CIDR block for reported addresses
  • Submit abuse reports to AbuseIPDB
  • Fetch blacklist entries with filters for confidence, IP version, and countries
  • Use readable terminal output or --json for automation

Install

pip install abip-cli

The package name on PyPI is abip-cli, but the installed command is:

abip

You can also run it as a module:

python -m abip --help

Authentication

Create an AbuseIPDB API token and make it available as ABUSEIPDB_TOKEN.

Preferred for installed CLI usage:

export ABUSEIPDB_TOKEN="your-token-here"

For local development, a .env file is also supported:

ABUSEIPDB_TOKEN=your-token-here

Usage

Show help:

abip --help

Show the installed version:

abip --version

Check a single IP:

abip check 8.8.8.8
abip check 8.8.8.8 --days 90 --verbose
abip --json check 8.8.8.8

Check a CIDR block:

abip block 203.0.113.0/24
abip --json block 203.0.113.0/24 --days 7

Report an abusive IP:

abip report 203.0.113.10 --categories 18,22 --comment "SSH brute-force attempts"
abip report 203.0.113.10 --categories 14 --comment "Port scanning" --timestamp 2025-01-10T15:04:05Z

Fetch blacklist data:

abip blacklist
abip blacklist --min-confidence 75 --limit 50
abip blacklist --ip-version 4 --countries US,CN
abip --json blacklist --limit 10

Exit codes

  • 0 for successful execution
  • 1 for API and runtime errors

Development

Install development dependencies with uv:

uv sync --group dev

Run tests:

uv run pytest

Build distributions:

uv run python -m build
uv run twine check dist/*

Release

This repository includes GitHub Actions workflows for CI and PyPI publishing via Trusted Publishing.

Before the first release, configure the project on PyPI to trust this GitHub repository, then create a GitHub release to trigger publishing.

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

abip_cli-0.1.0.tar.gz (43.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abip_cli-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file abip_cli-0.1.0.tar.gz.

File metadata

  • Download URL: abip_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 43.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for abip_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5ea76eb8bd42405dfd9b1adfcaefaa0c5583e80ccbf4d30262339160830c4428
MD5 3db40cb64fe336e2b2b9664cd66c59ca
BLAKE2b-256 ac986dc20510c7d806f2fb0f871fcf7fca62bc99b8c368787961a1e6d54971fe

See more details on using hashes here.

File details

Details for the file abip_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: abip_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for abip_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e712e3e1081cfc3b0251bb20f050384d24a1313ff1f4f72f2062756d780bfb3
MD5 abffdb7ac2d91756108d36101477dbf4
BLAKE2b-256 4f3f6b41e33441d0600c99425a0f4d59b26e72f0b3f81f3e4ed56842fdf159d3

See more details on using hashes here.

Supported by

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