# Domain Intelligence Suite (`weeknds/domain-intelligence-suite`) Actor

WHOIS, DNS, SSL, and subdomain intelligence for any domain in one run. Registration data, DNS records, SSL chain, subdomain discovery from CT logs. Essential for OSINT, security research, penetration testing, and domain due diligence.

- **URL**: https://apify.com/weeknds/domain-intelligence-suite.md
- **Developed by:** [C R](https://apify.com/weeknds) (community)
- **Categories:** Developer tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 domain intelligence results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Domain Intelligence Suite

> Apify Actor for comprehensive domain intelligence gathering.

Runs four independent intelligence modules against any domain name — WHOIS records, DNS resolution, SSL/TLS certificate inspection, and subdomain discovery via Certificate Transparency logs. Each module handles errors gracefully; if one fails, the others still deliver results.

***

### Modules

| Module | Source | Key Data |
|--------|--------|----------|
| **WHOIS** | `python-whois` | Registrar, dates, nameservers, status, contacts |
| **DNS** | `dnspython` | A, AAAA, MX, NS, TXT, CNAME, SOA records |
| **SSL** | `ssl` + `socket` | Issuer, expiry, days remaining, SANs, serial |
| **Subdomains** | [crt.sh](https://crt.sh) | Unique subdomains from CT logs, deduplicated |

***

### Quick Start

#### Run on Apify

1. Go to the Actor page on [Apify Console](https://console.apify.com)
2. Click **Try for free**
3. Enter a domain name (e.g. `apify.com`)
4. Click **Run**

#### Run Locally

```bash
## Install Apify CLI
npm install -g apify-cli

## Clone and run
git clone <this-repo>
cd domain-intelligence-suite

## Install dependencies
pip install -r requirements.txt

## Run
apify run
```

#### Run via API

```bash
curl "https://api.apify.com/v2/acts/<username>/domain-intelligence-suite/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domain": "example.com"}'
```

***

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `domain` **(required)** | `string` | — | Domain to investigate (e.g. `example.com`). Strips protocol/path automatically. |
| `modules` | `string[]` | All four | Which modules to run: `whois`, `dns`, `ssl`, `subdomains` |
| `sslPort` | `integer` | `443` | Port for SSL certificate inspection |
| `maxSubdomains` | `integer` | `500` | Max subdomains returned from crt.sh (10–2000) |
| `dnsRecordTypes` | `string[]` | All seven | DNS record types: `A`, `AAAA`, `MX`, `NS`, `TXT`, `CNAME`, `SOA` |
| `includeWildcardSubdomains` | `boolean` | `true` | Include `*.example.com` wildcards in subdomain results |

#### Example Input

```json
{
  "domain": "github.com",
  "modules": ["whois", "ssl"],
  "sslPort": 443,
  "maxSubdomains": 200
}
```

***

### Output

Results are pushed to the default dataset as JSON. Each run produces one item:

```json
{
  "domain": "example.com",
  "timestamp": "2026-07-07T12:00:00+00:00",
  "whois": {
    "domain": "example.com",
    "queried_at": "2026-07-07T12:00:00.123456",
    "data": {
      "domain_name": "EXAMPLE.COM",
      "registrar": "RESERVED-Internet Assigned Numbers Authority",
      "creation_date": "1995-08-14T04:00:00+00:00",
      "expiration_date": "2027-08-13T04:00:00+00:00",
      "name_servers": ["A.IANA-SERVERS.NET", "B.IANA-SERVERS.NET"],
      "status": ["serverDeleteProhibited", "serverTransferProhibited"]
    }
  },
  "dns": {
    "domain": "example.com",
    "queried_at": "2026-07-07T12:00:00.456789",
    "records": {
      "A": ["93.184.216.34"],
      "AAAA": ["2606:2800:220:1:248:1893:25c8:1946"],
      "MX": [
        {"preference": 0, "exchange": ""}
      ],
      "NS": ["a.iana-servers.net", "b.iana-servers.net"],
      "TXT": ["v=spf1 -all", "wgyf8z8cgvm2qmxpnbnldrcltvk4xqfn"],
      "SOA": [
        {
          "mname": "a.iana-servers.net",
          "rname": "nstld.verisign-grs.com",
          "serial": 2026070444,
          "refresh": 1800,
          "retry": 900,
          "expire": 604800,
          "minimum": 86400
        }
      ]
    }
  },
  "ssl": {
    "domain": "example.com",
    "port": 443,
    "queried_at": "2026-07-07T12:00:01.123456",
    "certificate": {
      "issuer": "C=US, O=DigiCert Inc, CN=DigiCert TLS RSA SHA256 2020 CA1",
      "subject": "C=US, ST=California, L=Los Angeles, O=Internet Corporation for Assigned Names and Numbers, CN=www.example.org",
      "valid_from": "2026-01-30T00:00:00+00:00",
      "valid_to": "2027-03-01T23:59:59+00:00",
      "days_remaining": 237,
      "expired": false,
      "subject_alt_names": ["www.example.org", "example.org", "example.com"],
      "serial_number": "0FBE...",
      "version": 3
    }
  },
  "subdomains": {
    "domain": "example.com",
    "source": "crt.sh",
    "queried_at": "2026-07-07T12:00:02.789012",
    "subdomains": [
      "dev.example.com",
      "mail.example.com",
      "staging.example.com",
      "www.example.com"
    ],
    "total_found": 4,
    "returned": 4
  }
}
```

#### Error Handling

When a module encounters an error, it returns an `"error"` field instead of data — **the Actor never crashes**:

```json
{
  "whois": {
    "domain": "nonexistent-xyz123.com",
    "queried_at": "2026-07-07T12:00:00",
    "error": "WHOIS lookup failed (domain may not exist): No match for domain..."
  }
}
```

***

### Error Resilience

The Actor is designed to handle failures at every level:

| Scenario | Behaviour |
|----------|-----------|
| Invalid/non-existent domain | Module returns `error` field with description |
| DNS resolution failure | `NXDOMAIN` / `NoNameservers` / `Timeout` per record type |
| SSL connection refused | `error` on ssl module; other modules unaffected |
| SSL timeout | Clear timeout message |
| crt.sh rate limit (HTTP 429) | Captured as error |
| crt.sh unavailable | Timeout + error message |
| Module crash (unhandled) | Top-level try/catch in main.py catches it |

***

### Docker

```bash
## Build
docker build -t domain-intelligence-suite .

## Run locally
docker run --rm -e APIFY_TOKEN=dummy \
  -e APIFY_INPUT='{"domain": "example.com"}' \
  domain-intelligence-suite
```

For production, the Actor runs on Apify's managed infrastructure — no Docker setup needed.

***

### Development

#### Project Structure

```
domain-intelligence-suite/
├── .actor/
│   └── actor.json          # Apify actor spec
├── src/
│   ├── __init__.py
│   ├── main.py             # Entry point — Actor.run()
│   └── modules/
│       ├── __init__.py
│       ├── whois.py         # WHOIS lookup (python-whois)
│       ├── dns.py           # DNS resolver (dnspython)
│       ├── ssl_check.py     # SSL inspection (ssl + socket)
│       └── subdomains.py    # Subdomain enum (crt.sh API)
├── INPUT_SCHEMA.json        # Input definition for Apify Console
├── dataset_schema.json      # Output schema
├── Dockerfile
├── requirements.txt
└── README.md
```

#### Adding a New Module

1. Create `src/modules/<name>.py` with an `async def lookup_*(domain)` function
2. Return `{"data": ..., "error": ...}` pattern
3. Register in `src/main.py` → `MODULE_NAMES` + task creation
4. Add to `INPUT_SCHEMA.json` modules enum

#### Local Testing

```bash
## Set mock input and run
APIFY_INPUT='{"domain": "example.com", "modules": ["dns"]}' python -m src.main
```

***

### Pricing

- **Pay-per-event** model — you're only charged for Actor compute time
- Typical run: 3–10 seconds depending on DNS propagation and crt.sh response
- Free tier: 10,000+ free runs/month on Apify

***

### License

MIT

# Actor input Schema

## `domain` (type: `string`):

The domain name to investigate (e.g. 'example.com'). Do NOT include protocol (https://) or path.

## `modules` (type: `array`):

Which intelligence modules to execute. Leave empty to run all.

## `sslPort` (type: `integer`):

Port for SSL certificate inspection (default: 443).

## `maxSubdomains` (type: `integer`):

Maximum number of subdomains to return from crt.sh (default: 500).

## `dnsRecordTypes` (type: `array`):

DNS record types to query. Leave empty for all types (A, AAAA, MX, NS, TXT, CNAME, SOA).

## `includeWildcardSubdomains` (type: `boolean`):

Include wildcard entries like '\*.example.com' in subdomain results.

## Actor input object example

```json
{
  "domain": "example.com",
  "modules": [
    "whois",
    "dns",
    "ssl",
    "subdomains"
  ],
  "sslPort": 443,
  "maxSubdomains": 500,
  "dnsRecordTypes": [
    "A",
    "AAAA",
    "MX",
    "NS",
    "TXT",
    "CNAME",
    "SOA"
  ],
  "includeWildcardSubdomains": true
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "domain": "example.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("weeknds/domain-intelligence-suite").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "domain": "example.com" }

# Run the Actor and wait for it to finish
run = client.actor("weeknds/domain-intelligence-suite").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "domain": "example.com"
}' |
apify call weeknds/domain-intelligence-suite --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=weeknds/domain-intelligence-suite",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/NOgHTo2wRLYDk1h6K/builds/wPEYtgGh8U7wEUPEJ/openapi.json
