# Domain Extractor

POST /tools/domain-extractor: Extracts every unique domain name from a block of text.

Source: https://docs.deepinfo.com/reference/utilities/domain-extractor/

Last updated: 2026-12-05

---
`POST https://api.deepinfo.com/v1/tools/domain-extractor`

Extracts every unique domain name from a block of text. Only names whose suffix is on the [public suffix list](https://publicsuffix.org/) are returned, so `bad..name` and `host.invalid` are skipped.

Host names come back as they are written (`www.example.com`, `shop.example.co.uk`, and a punycode label stays punycode), and the domain of an email address is extracted too: `user@example.org` yields `example.org`.

## Authentication

Send your API key in the `apikey` request header.

## Request Body

| Parameter | Type | Required | Description |
|---|---|---|---|
| `text` | string | Required | Text to scan. Limited to 1,000,000 characters and 10,000 lines. |

```json
{
  "text": "Indicators seen in the leak: 198.51.100.7, 203.0.113.10 and 198.51.100.7 again, plus 2001:db8::1.\nHosts: www.example.com, mail.example.org, shop.example.co.uk, xn--mteri-h9ac.example.com.\nNot hosts: bad..name, host.invalid, 10.0.0.1, user@example.org"
}
```

## Response Fields

| Field | Type | Description |
|---|---|---|
| `domains` | array of string | The unique domain names found. |

## Response Schema

| Field | Type |
|---|---|
| `domains` | array<string> |

## Examples

### 200 · OK

```bash
curl -X POST 'https://api.deepinfo.com/v1/tools/domain-extractor' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "Indicators seen in the leak: 198.51.100.7, 203.0.113.10 and 198.51.100.7 again, plus 2001:db8::1.\nHosts: www.example.com, mail.example.org, shop.example.co.uk, xn--mteri-h9ac.example.com.\nNot hosts: bad..name, host.invalid, 10.0.0.1, user@example.org"
}'
```

`Content-Type: application/json` · `deepinfo-request-id: 5f0c6a8e-1b2d-4c3e-9f4a-7b8c9d0e1f2a`

```json
{
  "domains": [
    "www.example.com",
    "mail.example.org"
  ]
}
```

### 400 · Validation Error (text over 1,000,000 characters)

```bash
curl -X POST 'https://api.deepinfo.com/v1/tools/domain-extractor' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "www.example.com www.example.com www.example.com www.example.com www.example.com www.example.com www.example.com …"
}'
```

Shortened for this page: the saved request sends a `text` of 941,184 characters on 1 line.

`Content-Type: application/json` · `deepinfo-request-id: 5f0c6a8e-1b2d-4c3e-9f4a-7b8c9d0e1f2a`

```json
{
  "code": 10400,
  "parameters": [
    {
      "details": [
        "Maximum text length is 1.000.000."
      ],
      "subcode": 19004
    }
  ],
  "solution": "https://docs.deepinfo.com/reference/"
}
```
