> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# SecurityTrails

> Current and historical DNS and WHOIS for domains, subdomains, associated domains, TLS certificates, IP WHOIS and neighbours, and domain search by record values.

![](https://mintcdn.com/webrouter/T_A5Quwg50s_JK2y/logo/data-apis/securitytrails.webp?fit=max\&auto=format\&n=T_A5Quwg50s_JK2y\&q=85\&s=6fd47a197715d4e2ac9eac2118dcba7a)

[Web Catalog · Security](https://docs.webrouter.net/data-apis.md?category=security)

Needs&#x20;

`SECURITYTRAILS_API_KEY`

Endpoints

12

Auth

Key in header

[Vendor docs](https://docs.securitytrails.com/docs/overview)

&#x20;·&#x20;

[Pricing](https://securitytrails.com/corp/pricing)

## Setup

| Variable | | What it is |
| - | - | - |
| `SECURITYTRAILS_API_KEY` | required | A SecurityTrails API key (SecurityTrails control panel > API), sent in the APIKEY header. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Every call counts against the plan's monthly query allowance: account.usage shows what is left.
* The API is read-only, per SecurityTrails; search is a POST with a JSON body.
* Feeds, the DSL search, scrolling and the Attack Surface Intelligence API are not in this entry.

## Endpoints

GET

Get a domain's current DNS

Current A, AAAA, MX, NS, SOA and TXT records, each with first-seen date and how many other domains share the value.

[Open](#securitytrails-domain-get)

GET

List a domain's subdomains

Every subdomain label SecurityTrails knows for a domain.

[Open](#securitytrails-domain-subdomains)

GET

List a domain's tags

Category tags assigned to a domain.

[Open](#securitytrails-domain-tags)

GET

Get a domain's current WHOIS

Current WHOIS contacts, registrar and dates, with counts of other domains sharing each value.

[Open](#securitytrails-domain-whois)

GET

Find associated domains

Domains related to the given one, each with registrar dates, hosting and mail providers and the computed company name.

[Open](#securitytrails-domain-associated)

GET

Get a domain's certificates

Current and historical TLS certificates seen for a domain or subdomain.

[Open](#securitytrails-domain-ssl)

GET

Get DNS history by record type

Past values of one record type for a hostname, with first and last seen dates and the organizations behind them.

[Open](#securitytrails-history-dns)

GET

Get WHOIS history

Historical WHOIS records for a domain.

[Open](#securitytrails-history-whois)

POST

Search domains by DNS or WHOIS filter

Domains whose current records match a filter: IP or CIDR, apex domain, keyword, MX, NS, CNAME, SOA email, TLD or WHOIS fields.

[Open](#securitytrails-domains-search)

GET

Get IP WHOIS

Current WHOIS for one IPv4 address.

[Open](#securitytrails-ips-whois)

GET

Explore neighbouring IPs

Neighbouring IP blocks around an address (or CIDR block), each with an ip\_count.

[Open](#securitytrails-ips-nearby)

GET

Get API usage

Queries used this month and the monthly allowance.

[Open](#securitytrails-account-usage)

### Get a domain's current DNS

GET

`/domain/{hostname}`

`securitytrails.domain.get`

Current A, AAAA, MX, NS, SOA and TXT records, each with first-seen date and how many other domains share the value.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`hostname` required</td><td>string</td><td>path</td><td>Domain or hostname. Example `oracle.com`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.securitytrails.com/reference/get-domain-old-1) · Same job: [API Ninjas](https://docs.webrouter.net/data-apis/apininjas.md#apininjas-dns), [InternetData](https://docs.webrouter.net/data-apis/internetdata.md#internetdata-domain-lookup), [Public Interest Registry RDAP (.org)](https://docs.webrouter.net/data-apis/pir-rdap.md#pir-rdap-nameserver-get), [Shodan](https://docs.webrouter.net/data-apis/shodan.md#shodan-dns-domain), [Verisign RDAP (.com, .net)](https://docs.webrouter.net/data-apis/verisign-rdap.md#verisign-rdap-nameserver-get), [WhoisXML API](https://docs.webrouter.net/data-apis/whoisxml-api.md#whoisxml-api-dns-lookup)

```python Python theme={null}
router.call_data_api("securitytrails.domain.get", {'hostname': 'oracle.com'})
```

```text MCP theme={null}
call_data_api(endpoint="securitytrails.domain.get", params={"hostname": "oracle.com"})
```

### List a domain's subdomains

GET

`/domain/{hostname}/subdomains`

`securitytrails.domain.subdomains`

Every subdomain label SecurityTrails knows for a domain.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`hostname` required</td><td>string</td><td>path</td><td>Domain or hostname. Example `oracle.com`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.securitytrails.com/reference/list-subdomains-old-1) · Same job: [Wappalyzer](https://docs.webrouter.net/data-apis/wappalyzer.md#wappalyzer-subdomains), [WhoisXML API](https://docs.webrouter.net/data-apis/whoisxml-api.md#whoisxml-api-subdomains-list)

```python Python theme={null}
router.call_data_api("securitytrails.domain.subdomains", {'hostname': 'oracle.com'})
```

```text MCP theme={null}
call_data_api(endpoint="securitytrails.domain.subdomains", params={"hostname": "oracle.com"})
```

> [!NOTE]
>
> * Labels come back without the parent domain: append it yourself.

### List a domain's tags

GET

`/domain/{hostname}/tags`

`securitytrails.domain.tags`

Category tags assigned to a domain.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`hostname` required</td><td>string</td><td>path</td><td>Domain or hostname. Example `oracle.com`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.securitytrails.com/reference/list-tags-old-1) · Same job: [Adyntel](https://docs.webrouter.net/data-apis/adyntel.md#adyntel-domain-keywords), [Ahrefs](https://docs.webrouter.net/data-apis/ahrefs.md#ahrefs-metrics), [akta.pro](https://docs.webrouter.net/data-apis/akta.md#akta-company-traffic), [Aviato](https://docs.webrouter.net/data-apis/aviato.md#aviato-company-web-traffic), [Keywords Everywhere](https://docs.webrouter.net/data-apis/keywordseverywhere.md#keywordseverywhere-domain-traffic), [Majestic](https://docs.webrouter.net/data-apis/majestic.md#majestic-index-item-info)

```python Python theme={null}
router.call_data_api("securitytrails.domain.tags", {'hostname': 'oracle.com'})
```

```text MCP theme={null}
call_data_api(endpoint="securitytrails.domain.tags", params={"hostname": "oracle.com"})
```

### Get a domain's current WHOIS

GET

`/domain/{hostname}/whois`

`securitytrails.domain.whois`

Current WHOIS contacts, registrar and dates, with counts of other domains sharing each value.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`hostname` required</td><td>string</td><td>path</td><td>Domain or hostname. Example `securitytrails.com`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.securitytrails.com/reference/get-whois-old-1) · Same job: [API Ninjas](https://docs.webrouter.net/data-apis/apininjas.md#apininjas-whois), [IP2Location.io](https://docs.webrouter.net/data-apis/ip2location-io.md#ip2location-io-domain-whois), [Public Interest Registry RDAP (.org)](https://docs.webrouter.net/data-apis/pir-rdap.md#pir-rdap-domain-get), [Verisign RDAP (.com, .net)](https://docs.webrouter.net/data-apis/verisign-rdap.md#verisign-rdap-domain-get), [WhoisXML API](https://docs.webrouter.net/data-apis/whoisxml-api.md#whoisxml-api-whois-get)

```python Python theme={null}
router.call_data_api("securitytrails.domain.whois", {'hostname': 'securitytrails.com'})
```

```text MCP theme={null}
call_data_api(endpoint="securitytrails.domain.whois", params={"hostname": "securitytrails.com"})
```

### Find associated domains

GET

`/domain/{hostname}/associated`

`securitytrails.domain.associated`

Domains related to the given one, each with registrar dates, hosting and mail providers and the computed company name.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`hostname` required</td><td>string</td><td>path</td><td>Domain or hostname. Example `google.com`</td></tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page of results, from 1.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.securitytrails.com/reference/find-associated-domains-old-1)

```python Python theme={null}
router.call_data_api("securitytrails.domain.associated", {'hostname': 'google.com'})
```

```text MCP theme={null}
call_data_api(endpoint="securitytrails.domain.associated", params={"hostname": "google.com"})
```

### Get a domain's certificates

GET

`/domain/{hostname}/ssl`

`securitytrails.domain.ssl`

Current and historical TLS certificates seen for a domain or subdomain.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`hostname` required</td><td>string</td><td>path</td><td>Domain or hostname. Example `stackoverflow.com`</td></tr>

    <tr>
      <td>
        `include_subdomains`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Also return certificates of subdomains; default false.
      </td>
    </tr>

    <tr><td>`status`</td><td>string</td><td>query</td><td>Which certificates: valid (default), all or expired. One of `valid`, `all`, `expired`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.securitytrails.com/reference/get-domain-ssl-data-old-1)

```python Python theme={null}
router.call_data_api("securitytrails.domain.ssl", {'hostname': 'stackoverflow.com'})
```

```text MCP theme={null}
call_data_api(endpoint="securitytrails.domain.ssl", params={"hostname": "stackoverflow.com"})
```

### Get DNS history by record type

GET

`/history/{hostname}/dns/{type}`

`securitytrails.history.dns`

Past values of one record type for a hostname, with first and last seen dates and the organizations behind them.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`hostname` required</td><td>string</td><td>path</td><td>Domain or hostname. Example `oracle.com`</td></tr>
    <tr><td>`type` required</td><td>string</td><td>path</td><td>Record type. One of `a`, `aaaa`, `mx`, `ns`, `soa`, `txt`</td></tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page of results, from 1.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.securitytrails.com/reference/dns-history-by-record-type-old-1) · Same job: [urlscan.io](https://docs.webrouter.net/data-apis/urlscan.md#urlscan-hostname-history)

### Get WHOIS history

GET

`/history/{hostname}/whois`

`securitytrails.history.whois`

Historical WHOIS records for a domain.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`hostname` required</td><td>string</td><td>path</td><td>Domain or hostname. Example `securitytrails.com`</td></tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page of results, from 1.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.securitytrails.com/reference/whois-history-by-domain-old-1) · Same job: [WhoisXML API](https://docs.webrouter.net/data-apis/whoisxml-api.md#whoisxml-api-whois-history)

```python Python theme={null}
router.call_data_api("securitytrails.history.whois", {'hostname': 'securitytrails.com'})
```

```text MCP theme={null}
call_data_api(endpoint="securitytrails.history.whois", params={"hostname": "securitytrails.com"})
```

### Search domains by DNS or WHOIS filter

POST

`/domains/list`

`securitytrails.domains.search`

Domains whose current records match a filter: IP or CIDR, apex domain, keyword, MX, NS, CNAME, SOA email, TLD or WHOIS fields.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`filter` required</td><td>object</td><td>body</td><td>Filter fields: ipv4 (CIDR allowed), ipv6, apex\_domain, keyword, mx, ns, cname, subdomain, soa\_email, tld, whois\_email, whois\_organization, whois\_name, whois\_telephone, whois\_city, whois\_postalCode, whois\_street1..4, whois\_fax. Example `{"ipv4": "8.8.8.0/24"}`</td></tr>

    <tr>
      <td>
        `include_ips`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Also resolve A records and return their IPs.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page of results, from 1.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.securitytrails.com/reference/search-old-1)

```python Python theme={null}
router.call_data_api("securitytrails.domains.search", {'filter': {'ipv4': '8.8.8.0/24'}})
```

```text MCP theme={null}
call_data_api(endpoint="securitytrails.domains.search", params={"filter": {"ipv4": "8.8.8.0/24"}})
```

> [!NOTE]
>
> * A read over POST: the filter goes in the JSON body. The API itself is read-only.

### Get IP WHOIS

GET

`/ips/{ipaddress}/whois`

`securitytrails.ips.whois`

Current WHOIS for one IPv4 address.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`ipaddress` required</td><td>string</td><td>path</td><td>IPv4 address. Example `1.1.1.1`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.securitytrails.com/reference/get-ip-whois-old-1)

```python Python theme={null}
router.call_data_api("securitytrails.ips.whois", {'ipaddress': '1.1.1.1'})
```

```text MCP theme={null}
call_data_api(endpoint="securitytrails.ips.whois", params={"ipaddress": "1.1.1.1"})
```

### Explore neighbouring IPs

GET

`/ips/nearby/{ipaddress}`

`securitytrails.ips.nearby`

Neighbouring IP blocks around an address (or CIDR block), each with an ip\_count.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`ipaddress` required</td><td>string</td><td>path</td><td>Starting IP address, optionally with a CIDR mask. Example `8.8.8.8`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.securitytrails.com/reference/explore-ips-old-1)

```python Python theme={null}
router.call_data_api("securitytrails.ips.nearby", {'ipaddress': '8.8.8.8'})
```

```text MCP theme={null}
call_data_api(endpoint="securitytrails.ips.nearby", params={"ipaddress": "8.8.8.8"})
```

### Get API usage

GET

`/account/usage`

`securitytrails.account.usage`

Queries used this month and the monthly allowance.

Input

No inputs.

[Vendor docs](https://docs.securitytrails.com/reference/usage-old-1)

```python Python theme={null}
router.call_data_api("securitytrails.account.usage")
```

```text MCP theme={null}
call_data_api(endpoint="securitytrails.account.usage")
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.