censys
An easy-to-use and lightweight API wrapper for Censys APIs (censys.io).
What it is and what it does
Censys is a Python wrapper around the Censys internet-wide scanning and data APIs. It lets you query data on hosts, certificates, services, and network infrastructure, plus manage assets and events if you have a Censys ASM account. The library supports both programmatic access via Python and command-line queries through a built-in CLI.
The package is actively maintained and supports Python 3.8 through 3.14. However, the description includes a deprecation notice: the Search v1 and v2 APIs will be phased out in favor of a new Censys Platform API (available as the separate censys-platform package). The ASM APIs in this library are not deprecated and will continue to be supported. If you are starting a new project, you should evaluate whether to use this library or migrate to censys-platform.
Use it for:
- Search for hosts, certificates, or services across the internet to understand your organization's external attack surface.
- Perform bulk certificate lookups to track SSL/TLS deployments and identify potential security issues.
- Download bulk datasets from Censys for offline analysis or integration into security workflows.
- Manage assets, events, and reconnaissance seeds in Censys ASM for continuous monitoring.
- Build command-line tools or scripts that query Censys data without writing custom HTTP clients.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python wrapper for Censys APIs that lets you search internet-wide data on hosts, certificates, and services, manage attack surface assets, and run queries from the command line.
Yes, if you need to query Censys data and are comfortable with the deprecation timeline. The library is stable, actively maintained, and has low install friction. However, review the deprecation notice carefully: if you are starting a new project, evaluate censys-platform as your long-term choice. For existing code or ASM-only use cases, this package remains a solid choice.
Install
censys on PyPI
pip
pip install censysuv
uv add censyspoetry
poetry add censysInstalling censys
Before you install
Low install friction with five common runtime dependencies (requests, urllib3, backoff, rich, argcomplete). The project is actively maintained with recent commits and a stable release history since 2015.
License in practice
Licensed under Apache License 2.0 (permissive), so you can use, modify, and distribute the package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install censys
import os
from censys.search import CensysHosts
os.environ['CENSYS_API_ID'] = 'your_api_id'
os.environ['CENSYS_API_SECRET'] = 'your_api_secret'
h = CensysHosts()
results = h.view('1.1.1.1')
Requires valid Censys API credentials (CENSYS_API_ID and CENSYS_API_SECRET environment variables or configured via `censys config` command).
Verify before relying
- Whether the deprecated Search v1/v2 APIs will remain functional during a migration window or if immediate switching to censys-platform is required.
- Performance characteristics and rate limits for bulk operations or large-scale searches.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — requests, urllib3, backoff, rich, argcomplete |
| Maintenance | actively maintained — 246 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 408,252/month — #6,883 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: censys-2.2.19-py3-none-any.whl
Keywords: censys, api, search, attack surface management
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
ipwhoisRetrieves and parses whois and RDAP data for…
permissive · top 15,000 on PyPI
shodanProvides Python access to Shodan's search…
permissive · top 15,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
archspecArchspec provides APIs to detect, query, and…
permissive · top 15,000 on PyPI
brave-searchWrapper for the Brave Search API that provides…
unclear · top 15,000 on PyPI
pyasnpyasn performs fast offline IP address to…
permissive · top 15,000 on PyPI
wincertstoreAccesses Windows system certificate stores (CA…
permissive · top 15,000 on PyPI
certbotCertbot is a command-line client that…
permissive · top 15,000 on PyPI
nslookupProvides high-level DNS lookups (A, AAAA, and…
copyleft · top 15,000 on PyPI
sslyzeSSLyze is a fast SSL/TLS scanning tool and…
agpl · top 15,000 on PyPI