shodan
Python library and command-line utility for Shodan (https://developer.shodan.io)
What it is and what it does
Shodan is a Python client library for the Shodan search engine, which indexes Internet-connected devices rather than websites. It wraps Shodan's REST API and streaming endpoints, allowing you to search for devices by attributes, retrieve bulk IP information, monitor network alerts, and access exploit data—all from Python code or the command line.
The library has no runtime dependencies, making installation straightforward, but it requires a Shodan API key to function. It is marked Production/Stable and has been in use since 2010, though development is dormant as of late 2024. The package is useful for security researchers, network administrators, and developers automating device discovery and reconnaissance tasks.
Use it for:
- Automate security audits by searching for specific device types or services exposed on the Internet.
- Perform bulk IP lookups to gather geolocation, hosting, and service information for a list of addresses.
- Monitor your organization's network perimeter by setting up alerts for newly discovered exposed services.
- Build reconnaissance tools that integrate Shodan queries into existing security workflows.
- Stream real-time data from Shodan's firehose to detect newly indexed devices matching your criteria.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python access to Shodan's search engine for Internet-connected devices, enabling queries for device information, bulk IP lookups, streaming data, and exploit searches.
Yes, if you need Shodan integration and have an active API key. The package is stable and dependency-free, but its dormancy (no updates since late 2024) means you should verify compatibility with your Python version and test against current Shodan API behavior before relying on it in production. No known vulnerabilities are recorded.
Install
shodan on PyPI
pip
pip install shodanuv
uv add shodanpoetry
poetry add shodanInstalling shodan
Before you install
High install friction with no runtime dependencies. The package is dormant (last release 2023-12-17, no commits since 2024-08-05), though it remains marked Production/Stable and has accumulated 2941 GitHub stars. Maintenance is stalled but the codebase is not archived.
License in practice
Licensed under MIT (permissive), so you can use it freely in commercial and private projects without copyleft obligations.
Quickstart
pip install shodan
from shodan import Shodan
api = Shodan('YOUR_API_KEY')
ipinfo = api.host('8.8.8.8')
print(ipinfo)
Requires a valid Shodan API key from https://account.shodan.io to make any queries.
Verify before relying
- Whether the package works reliably with modern Python versions (classifiers list Python 2.6–3.6 but no newer versions are declared).
- Current state of Shodan's API compatibility and whether the library's dormancy affects real-world usability.
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 971 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 467,163/month — #6,500 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: shodan-1.31.0.tar.gz
Keywords: security, network
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
ipinfoQueries the IPinfo.io API to retrieve…
permissive · top 15,000 on PyPI
censysA Python wrapper for Censys APIs that lets you…
permissive · top 15,000 on PyPI
ipwhoisRetrieves and parses whois and RDAP data for…
permissive · top 15,000 on PyPI
nslookupProvides high-level DNS lookups (A, AAAA, and…
copyleft · top 15,000 on PyPI
pyasnpyasn performs fast offline IP address to…
permissive · top 15,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
aiodiscoverDiscovers hosts on a local network by…
permissive · top 15,000 on PyPI
ip3countryLooks up the ISO 3166-1 alpha-2 country code…
permissive · top 5,000 on PyPI
dnspythondnspython is a DNS toolkit that handles…
permissive · top 1,000 on PyPI
geoip2fastGeoIP2Fast performs fast geolocation lookups…
permissive · top 15,000 on PyPI