{"id":24211,"library":"passivetotal","title":"PassiveTotal","description":"Python client library for the RiskIQ PassiveTotal and Illuminate API (version 2.5.9). Provides access to passive DNS, WHOIS, SSL certificates, trackers, articles, malware, attack surface intelligence, vulnerability intelligence, and more. Release cadence is irregular with minor bugfix and feature releases.","status":"active","version":"2.5.9","language":"python","source_language":"en","source_url":"https://github.com/passivetotal/python_api","tags":["passivetotal","riskiq","threat-intelligence","api-client","passive-dns","whois"],"install":[{"cmd":"pip install passivetotal","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"HTTP library used for API calls","package":"requests","optional":false},{"reason":"Used for WHOIS lookups in certain modules","package":"ipwhois","optional":true}],"imports":[{"note":"Client is not a top-level module; must be imported explicitly.","wrong":"import passivetotal","symbol":"Client","correct":"from passivetotal import Client"},{"note":"Avoid star imports; import the module and use analyzer.Hostname, etc.","wrong":"from passivetotal.analyzer import *","symbol":"analyzer","correct":"from passivetotal import analyzer"},{"note":"Hostname is inside the analyzer submodule, not top-level.","wrong":"from passivetotal import Hostname","symbol":"Hostname","correct":"from passivetotal.analyzer import Hostname"}],"quickstart":{"code":"from passivetotal import Client\nfrom passivetotal.analyzer import Hostname\n\n# Credentials: use environment variables or config file\nclient = Client(username=os.environ.get('PT_USERNAME', ''), api_key=os.environ.get('PT_API_KEY', ''))\n\n# Resolve a hostname query\nhostname = Hostname('passivetotal.org', client=client)\nprint(hostname.resolutions)\n","lang":"python","description":"Initialize client with credentials, then query a hostname for passive DNS resolutions."},"warnings":[{"fix":"Use the lower-level `Client` methods (e.g., `client.get_enrichment(...)`) for stable access.","message":"The `analyzer` module is experimental and may change in future releases. Avoid relying on internal details.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Always pass username and api_key explicitly, or set PT_USERNAME and PT_API_KEY environment variables.","message":"Client credentials are read from `~/.passivetotal/config` by default if not provided. If the file is present but malformed, import may fail silently.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Catch `passivetotal.exception.AnalyzerError` when accessing analyzer objects.","message":"Hostname resolution may throw `AnalyzerError` if the hostname cannot be resolved to an IP. This error is not documented in all versions.","severity":"gotcha","affected_versions":">=2.4.2"},{"fix":"Filter results further or use the `certificates_search` method with more specific parameters.","message":"The `certificates` property on `Hostname` uses a substring search across both subjectAlternativeNames and subjectCommonName. Results may include certificates not exactly matching the hostname.","severity":"gotcha","affected_versions":">=2.5.8"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install passivetotal`.","cause":"The package is named 'passivetotal' but some tutorials mistakenly use 'passivetotal2' or 'pt-client'.","error":"ModuleNotFoundError: No module named 'passivetotal'"},{"fix":"Use `from passivetotal import Client`.","cause":"Trying to import Client from the top-level module incorrectly.","error":"AttributeError: module 'passivetotal' has no attribute 'Client'"},{"fix":"Check the hostname or handle the exception with try/except.","cause":"The hostname provided does not resolve to any IP address.","error":"passivetotal.exception.AnalyzerError: Hostname could not be resolved"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}