shodancli is an extensible Python command-line client for the Shodan API.
Currently, it supports the explore command for discovering exposed systems across individual IPv4 addresses and ranges.
shodancli can be installed using a Python package manager of your choice.
Below are some popular options — we recommend using either pipx or uv.
pipx install "git+https://github.com/ret2src/shodancli.git"uv tool install "git+https://github.com/ret2src/shodancli.git"python3 -m pip install "git+https://github.com/ret2src/shodancli.git"python3 -m venv .venv
.venv/bin/pip install -e .Set your Shodan API key:
export SHODAN_API_KEY=your_key_hereShow top-level help:
shodancli --helpShow command help:
shodancli explore --helpshodancli explore currently supports:
- Individual public IPv4 addresses such as
1.1.1.1 - Public CIDR ranges such as
8.8.8.0/24 - Public dash ranges such as
8.8.8.8-8.8.8.15 - Public shorthand dash ranges such as
8.8.8.8-15
Non-public IPv4 addresses and ranges are rejected during input validation and reported as warnings.
The output includes:
- Discovered IPs (and hostnames if available)
- Discovered Ports (per range and overall)
- System counts (per range and overall)
Explore IPv4 ranges with inline inputs:
shodancli explore --ranges "1.1.1.1, 8.8.8.0/24, 8.8.8.8-8.8.8.15, 60.12.212.75-79"Explore IPv4 ranges from a line-separated input file:
shodancli explore --file ranges.txtExplore IPv4 ranges from STDIN:
cat ranges.txt | shodancli explore