code
Python Integration
Use the Zondex API from Python scripts for automated reconnaissance, data collection, and security research.
Prerequisites
pip install requests
search Basic Search
Search the Zondex index and process results.
import requests
API_BASE = "https://zondex.io"
def search(query, page=1):
"""Search Zondex and return results."""
resp = requests.get(
f"{API_BASE}/api/search/",
params={"q": query, "page": page},
headers={"X-API-Key": "YOUR_API_KEY"},
)
resp.raise_for_status()
return resp.json()
# Search for exposed SSH servers
data = search("service:ssh port:22")
print(f"Total results: {data['total']}")
for host in data["results"]:
print(f" {host['ip']}:{host['port']} — {host.get('product', 'unknown')}")
bar_chart Get Faceted Statistics
Retrieve aggregated statistics (top ports, countries, services) for any query.
def get_facets(query):
"""Get faceted statistics for a search query."""
resp = requests.get(
f"{API_BASE}/api/facets/",
params={"q": query},
headers={"X-API-Key": "YOUR_API_KEY"},
)
resp.raise_for_status()
return resp.json()
facets = get_facets("product:nginx")
print("Top countries running nginx:")
for item in facets.get("countries", [])[:5]:
print(f" {item['value']}: {item['count']:,} hosts")
view_list Paginated Collection
Iterate through all results across multiple pages.
import time
def search_all(query, max_pages=10):
"""Collect results across multiple pages."""
all_results = []
for page in range(1, max_pages + 1):
data = search(query, page=page)
results = data.get("results", [])
if not results:
break
all_results.extend(results)
print(f"Page {page}: {len(results)} results")
time.sleep(1) # respect rate limits
return all_results
hosts = search_all("port:8080 country:US", max_pages=5)
print(f"Collected {len(hosts)} hosts total")