The DomainTools Python API Wrapper provides a unified interface to interact with DomainTools' cybersecurity and threat intelligence products, including Iris Investigate, Iris Enrich, Iris Detect, Lookups, Monitors, and Threat Feeds. It is actively maintained, currently at version 2.7.3, with frequent minor releases addressing bugs and ensuring API parity.
pip install domaintools-api --upgradeVerified import paths — ran on the pinned version, not inferred.
Initialize the API client with your DomainTools username and API key. The library supports various DomainTools API endpoints, including Domain Profile lookups, Iris Enrich, and Real-Time Threat Feeds. Credentials should ideally be stored as environment variables (DOMAINTOOLS_USERNAME, DOMAINTOOLS_API_KEY) for security.
Ensure you are initializing the API client with your `username` and `api_key`. The SDK manages the correct authentication method internally for different endpoints. If manually configuring, consult documentation for specific endpoint requirements.
For most use cases, append `.response()` to your API call to get the core data. Example: `results = api.iris_enrich('domaintools.com').response()`.Implement exponential backoff and retry logic when receiving `503 Service Unavailable` errors. Review your DomainTools subscription limits if this occurs frequently.
Upgrade to `domaintools-api` version 2.6.1 or newer: `pip install domaintools-api --upgrade`.
Upgrade to `domaintools-api` version 2.7.3 or newer to ensure correct `risk_score` retrieval: `pip install domaintools-api --upgrade`.