The Foundational Intelligence Layer for the Internet
The Whisper API provides comprehensive, real-time intelligence on any internet asset. By connecting billions of data points across live internet routing, historical registration records, and deep resolution data, our API moves beyond simple enrichment to deliver predictive, context-rich insights.
This Python SDK provides a fully-typed client for the Whisper API v1, designed for security experts, developers, and automated systems.
pip install whisper_api_sdkSign up at dash.whisper.security to get your API key.
import whisper_api_sdk
from whisper_api_sdk.rest import ApiException
from pprint import pprint
# Configure Bearer token authentication
configuration = whisper_api_sdk.Configuration(
host = "https://api.whisper.security",
access_token = "YOUR_API_KEY" # Replace with your actual API key
)
# Create API client
with whisper_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the Indicators API
api_instance = whisper_api_sdk.IndicatorsApi(api_client)
try:
# Enrich an IP address
response = api_instance.get_indicator("ip", "8.8.8.8")
print(f"Organization: {response.summary.organization}")
print(f"Location: {response.summary.location}")
print(f"Risk Score: {response.reputation.risk_score}")
except ApiException as e:
print(f"API Error: {e}")- Unified & Simple: Small set of powerful, resource-oriented endpoints
- Performant by Design: Asynchronous-first with strategic caching (<500ms typical response)
- Workflow-Oriented: Built for real-world security operations, not just data dumps
- Comprehensive: IP, Domain, DNS, WHOIS, Routing, Geolocation, Screenshots, Monitoring
- Fully Typed: Complete type hints for IDE autocomplete and type checking
- Async Support: Built-in support for async/await patterns
| Endpoint Type | Response Time | Use Case |
|---|---|---|
| Geolocation | <150ms | Real-time fraud detection |
| Single Indicator | <500ms | Incident response enrichment |
| With Routing Data | <2s (cached: 200ms) | Deep network analysis |
| Bulk Operations | 5-30s | Batch log enrichment |
| Search/Discovery | 10-60s | Threat hunting |
# Get comprehensive IP intelligence
ip_data = api_instance.get_indicator("ip", "8.8.8.8", include="routing,rpki")# Analyze a domain with WHOIS and DNS data
domain_data = api_instance.get_indicator("domain", "example.com", include="whois,dns_details")# Process multiple indicators
bulk_request = whisper_api_sdk.BulkRequest(
indicators=["8.8.8.8", "example.com"],
include=["basic", "reputation"]
)
job_response = api_instance.bulk_enrichment(bulk_request)
# Poll for results
job_id = job_response.job_id
# Use the Operations API to check job statuslocation_api = whisper_api_sdk.LocationApi(api_client)
location = location_api.get_ip_location("8.8.8.8")
print(f"Country: {location.country}")
print(f"City: {location.city}")All API endpoints require Bearer token authentication. Set your API key when configuring the client:
configuration = whisper_api_sdk.Configuration(
host = "https://api.whisper.security",
access_token = "YOUR_API_KEY"
)You can also use environment variables:
import os
configuration = whisper_api_sdk.Configuration(
host = "https://api.whisper.security",
access_token = os.getenv("WHISPER_API_KEY")
)whisper_api_sdk/
βββ api/
β βββ indicators_api.py # Indicator enrichment endpoints
β βββ location_api.py # Geolocation endpoints
β βββ operations_api.py # Async job management
βββ models/ # Data models and types
βββ configuration.py # SDK configuration
βββ api_client.py # Core API client
βββ exceptions.py # Exception classes
The SDK provides three main API classes:
Comprehensive indicator enrichment for IPs and domains.
Methods:
get_indicator(type, value, include=None)- Enrich a single indicatorget_indicator_history(type, value, limit=None)- Get historical dataget_indicator_graph(type, value)- Get relationship graphget_subdomains(domain, limit=None)- Get domain subdomainsgenerate_similar_domains_get(domain, type=None, limit=None)- Generate similar domains (GET)generate_similar_domains_post(domain, similar_domains_request)- Generate similar domains (POST)bulk_enrichment(bulk_request)- Bulk enrichment (async job)search_indicators(search_request)- Search indicators (async job)
Example:
from whisper_api_sdk.api import IndicatorsApi
api = IndicatorsApi(api_client)
response = api.get_indicator("ip", "8.8.8.8", include="routing,rpki")View Full IndicatorsApi Documentation
Geolocation lookups and searches.
Methods:
get_ip_location(ip)- Get IP geolocationsearch_location(field, value, limit=None)- Search by location attributes
Example:
from whisper_api_sdk.api import LocationApi
api = LocationApi(api_client)
location = api.get_ip_location("8.8.8.8")
print(f"Country: {location.country}, City: {location.city}")View Full LocationApi Documentation
Manage asynchronous jobs and operations.
Methods:
get_job(job_id)- Get job status and resultslist_jobs(status=None, limit=None)- List user jobscreate_screenshot(screenshot_request)- Capture screenshot (async job)create_scan(infra_scan_request)- Infrastructure scan (async job)
Example:
from whisper_api_sdk.api import OperationsApi
api = OperationsApi(api_client)
job = api.get_job("job-uuid-here")
print(f"Status: {job.status}, Progress: {job.progress}")View Full OperationsApi Documentation
The SDK includes comprehensive type definitions for all API responses and requests. All models support:
- Type hints for IDE autocomplete
- JSON serialization/deserialization
- Validation
- Dictionary conversion
Comprehensive intelligence for an IP or domain.
Properties:
query(QueryInfo) - Query metadatasummary(SummaryInfo) - Quick summarygeolocation(dict) - Geographic datanetwork(dict) - Network informationisp(dict) - ISP detailsregistration(dict) - WHOIS registrationdns(DnsInfo) - DNS recordsrelationships(RelationshipInfo) - Related infrastructurereputation(ReputationInfo) - Risk and reputation scoressecurity(dict) - Security contextmetadata(MetadataInfo) - Response metadata
Geolocation data for an IP address.
Properties:
ip(str) - IP addresscountry(str) - Country namecountry_code(str) - ISO country codecity(str) - City namelatitude(float) - Latitudelongitude(float) - Longitudetimezone(str) - Timezoneisp(str) - ISP nameasn(int) - Autonomous System Number
Asynchronous job status and results.
Properties:
job_id(str) - Unique job identifierstatus(str) - Job status (pending, in_progress, completed, failed)progress(JobProgress) - Progress informationresult(dict) - Job results (when completed)error(JobError) - Error details (when failed)created_at(datetime) - Creation timestampupdated_at(datetime) - Last update timestamp
Request for bulk indicator enrichment.
Properties:
indicators(List[str]) - List of IPs/domains (max 100)include(List[str]) - Data modules to includeoptions(BulkOptions) - Processing options
Request for indicator search.
Properties:
query(str) - Search queryfield(str) - Field to search (registrantName, registrarName, etc.)limit(int) - Maximum results (default: 100)
Request for website screenshot.
Properties:
url(str) - Target URLoptions(ScreenshotOptions) - Capture options (fullPage, format, etc.)
Request for infrastructure scanning.
Properties:
domain(str) - Target domaintype(str) - Scan type (subdomains, ports, dns)config(dict) - Type-specific configuration
For a complete list of all data models and their properties, see:
Core Models:
- IndicatorResponse - Main enrichment response
- LocationResponse - Geolocation data
- JobResponse - Async job status
- HistoryResponse - Historical data
Request Models:
- BulkRequest - Bulk enrichment
- SearchRequest - Search parameters
- ScreenshotRequest - Screenshot options
- InfraScanRequest - Scan configuration
- SimilarDomainsRequest - Similar domain generation
Nested Models:
- QueryInfo - Query metadata
- SummaryInfo - Quick summary
- DnsInfo - DNS records
- RelationshipInfo - Infrastructure relationships
- ReputationInfo - Reputation scores
- MetadataInfo - Response metadata
- JobProgress - Job progress details
- JobError - Job error information
Configuration Models:
- BulkOptions - Bulk processing options
- ScreenshotOptions - Screenshot settings
- DnsEnumConfig - DNS enumeration config
- PortScanConfig - Port scanning config
- SubdomainEnumConfig - Subdomain enumeration config
Security Models:
- BlacklistScores - Blacklist check results
- DomainReputationScores - Domain reputation
- DomainReputationDetails - Detailed reputation data
View All Models: See the docs/ directory for complete model documentation.
The SDK provides structured exception handling:
from whisper_api_sdk.rest import ApiException
try:
response = api_instance.get_indicator("ip", "8.8.8.8")
except ApiException as e:
print(f"Status: {e.status}")
print(f"Reason: {e.reason}")
print(f"Body: {e.body}")from whisper_api_sdk import Configuration, ApiClient
config = Configuration(
host="https://api.whisper.security",
access_token=os.getenv("WHISPER_API_KEY")
)
# Custom timeout
config.timeout = 60
# Custom user agent
config.user_agent = "MyApp/1.0"
# Enable debugging
config.debug = True
# Disable SSL verification (not recommended for production)
config.verify_ssl = Falseimport time
from whisper_api_sdk.api import IndicatorsApi, OperationsApi
from whisper_api_sdk.models import BulkRequest
indicators_api = IndicatorsApi(api_client)
ops_api = OperationsApi(api_client)
# Submit bulk job
bulk_request = BulkRequest(
indicators=["8.8.8.8", "1.1.1.1", "example.com"],
include=["basic", "reputation"]
)
job_response = indicators_api.bulk_enrichment(bulk_request)
# Poll for completion
while True:
job = ops_api.get_job(job_response.job_id)
print(f"Status: {job.status}, Progress: {job.progress.percentage}%")
if job.status in ["completed", "failed"]:
break
time.sleep(2)
# Get results
if job.status == "completed":
results = job.result
print(f"Processed {len(results)} indicators")The SDK is fully typed for excellent IDE support:
from whisper_api_sdk.api import IndicatorsApi
from whisper_api_sdk.models import IndicatorResponse, LocationResponse
def enrich_ip(api: IndicatorsApi, ip: str) -> IndicatorResponse:
"""Enrich an IP address with full type hints."""
response: IndicatorResponse = api.get_indicator("ip", ip)
# IDE autocomplete works perfectly
if response.reputation and response.reputation.risk_score:
risk = response.reputation.risk_score
print(f"Risk score: {risk}")
return responseFor detailed API documentation, visit:
- Full Documentation: docs.whisper.security
- API Reference: docs.whisper.security/api
- Quick Start Guide: docs.whisper.security/quickstart
| Category | Limit |
|---|---|
| Standard Enrichment | 100 req/min |
| Bulk Operations | 10 req/min |
| Search/Discovery | 5 req/min |
| Screenshots | 10 req/min |
Rate limits return HTTP 429. Retry after the time specified in the Retry-After header.
- Email: api-support@whisper.security
- Documentation: https://docs.whisper.security
- Issues: https://github.com/whisper-sec/sdk-python/issues
Generated with β€οΈ by Whisper Security