# 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

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Domain Intelligence Suite",
        "description": "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.",
        "version": "1.0",
        "x-build-id": "wPEYtgGh8U7wEUPEJ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/weeknds~domain-intelligence-suite/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-weeknds-domain-intelligence-suite",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/weeknds~domain-intelligence-suite/runs": {
            "post": {
                "operationId": "runs-sync-weeknds-domain-intelligence-suite",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/weeknds~domain-intelligence-suite/run-sync": {
            "post": {
                "operationId": "run-sync-weeknds-domain-intelligence-suite",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "domain"
                ],
                "properties": {
                    "domain": {
                        "title": "Domain",
                        "type": "string",
                        "description": "The domain name to investigate (e.g. 'example.com'). Do NOT include protocol (https://) or path."
                    },
                    "modules": {
                        "title": "Modules to run",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Which intelligence modules to execute. Leave empty to run all.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "whois",
                                "dns",
                                "ssl",
                                "subdomains"
                            ]
                        },
                        "default": [
                            "whois",
                            "dns",
                            "ssl",
                            "subdomains"
                        ]
                    },
                    "sslPort": {
                        "title": "SSL Port",
                        "minimum": 1,
                        "maximum": 65535,
                        "type": "integer",
                        "description": "Port for SSL certificate inspection (default: 443).",
                        "default": 443
                    },
                    "maxSubdomains": {
                        "title": "Max Subdomains",
                        "minimum": 10,
                        "maximum": 2000,
                        "type": "integer",
                        "description": "Maximum number of subdomains to return from crt.sh (default: 500).",
                        "default": 500
                    },
                    "dnsRecordTypes": {
                        "title": "DNS Record Types",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "DNS record types to query. Leave empty for all types (A, AAAA, MX, NS, TXT, CNAME, SOA).",
                        "items": {
                            "type": "string",
                            "enum": [
                                "A",
                                "AAAA",
                                "MX",
                                "NS",
                                "TXT",
                                "CNAME",
                                "SOA"
                            ]
                        },
                        "default": [
                            "A",
                            "AAAA",
                            "MX",
                            "NS",
                            "TXT",
                            "CNAME",
                            "SOA"
                        ]
                    },
                    "includeWildcardSubdomains": {
                        "title": "Include Wildcard Subdomains",
                        "type": "boolean",
                        "description": "Include wildcard entries like '*.example.com' in subdomain results.",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
