> ## 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.

# Shodan

> Internet-wide scan data: services and banners seen on any IP, host search with facets, and DNS data for domains.

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

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

Needs&#x20;

`SHODAN_API_KEY`

Endpoints

12

Auth

Key in query

[Vendor docs](https://developer.shodan.io/api)

&#x20;·&#x20;

[Pricing](https://account.shodan.io/billing)

## Setup

| Variable | | What it is |
| - | - | - |
| `SHODAN_API_KEY` | required | A Shodan API key (account.shodan.io), sent as the key query parameter. |

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

## Notes

* Query credits come with the plan: filtered searches, pages past the first and DNS domain lookups spend them; api.info shows what is left.
* Search syntax is the website's: free text plus filter:value pairs (search.filters lists them).
* On-demand scans, network alerts, notifiers, bulk data and organization calls are not in this entry.

## Endpoints

GET

Get a host

Every service (banner) Shodan has seen on an IP, with ports, hostnames, org and location.

[Open](#shodan-host-get)

GET

Search hosts

Banners matching a Shodan query, 100 per page, with optional facet summaries.

[Open](#shodan-host-search)

GET

Count hosts for a query

The total matching a Shodan query plus facet summaries, without results.

[Open](#shodan-host-count)

GET

List search facets

Property names usable as facets.

[Open](#shodan-search-facets)

GET

List search filters

Filter names usable in a query.

[Open](#shodan-search-filters)

GET

Parse a query

Which filters a query string uses and with what values.

[Open](#shodan-search-tokens)

GET

List crawled ports

Port numbers Shodan's crawlers look at.

[Open](#shodan-ports-list)

GET

Get a domain's subdomains and DNS records

Subdomains and their A, AAAA, CNAME, NS, SOA, MX and TXT records with last-seen dates.

[Open](#shodan-dns-domain)

GET

Resolve hostnames

IP addresses for a list of hostnames.

[Open](#shodan-dns-resolve)

GET

Reverse-resolve IPs

Hostnames defined for a list of IP addresses.

[Open](#shodan-dns-reverse)

GET

Search saved queries

Search queries other users saved to Shodan's public directory.

[Open](#shodan-queries-search)

GET

Get API plan and credits

Plan, remaining query and scan credits and usage limits for the key.

[Open](#shodan-api-info)

### Get a host

GET

`/shodan/host/{ip}`

`shodan.host.get`

Every service (banner) Shodan has seen on an IP, with ports, hostnames, org and location.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`ip` required</td><td>string</td><td>path</td><td>Host IP address. Example `8.8.8.8`</td></tr>

    <tr>
      <td>
        `history`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Return all historical banners too; default false.
      </td>
    </tr>

    <tr>
      <td>
        `minify`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Only ports and general host info, no banners; default false.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developer.shodan.io/api#shodan-host-details) · Same job: [AlienVault OTX (LevelBlue Open Threat Exchange)](https://docs.webrouter.net/data-apis/alienvault-otx.md#alienvault-otx-indicators-ipv4), [VirusTotal](https://docs.webrouter.net/data-apis/virustotal.md#virustotal-ip-get)

```python Python theme={null}
router.call_data_api("shodan.host.get", {'ip': '8.8.8.8'})
```

```text MCP theme={null}
call_data_api(endpoint="shodan.host.get", params={"ip": "8.8.8.8"})
```

### Search hosts

GET

`/shodan/host/search`

`shodan.host.search`

Banners matching a Shodan query, 100 per page, with optional facet summaries.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`query` required</td><td>string</td><td>query</td><td>Shodan search query; filters go inline as filter:value. Example `apache country:DE`</td></tr>
    <tr><td>`facets`</td><td>string</td><td>query</td><td>Comma-separated facets, each optionally property:count (country:100). Example `org,os`</td></tr>

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

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page of 100 results, default 1.
      </td>
    </tr>

    <tr>
      <td>
        `minify`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Truncate large fields such as http.html; default true.
      </td>
    </tr>

    <tr><td>`fields`</td><td>string</td><td>query</td><td>Comma-separated fields to return. Example `ip_str,port,org,http.title`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developer.shodan.io/api#shodan-host-search)

```python Python theme={null}
router.call_data_api("shodan.host.search", {'query': 'apache country:DE', 'facets': 'org,os', 'fields': 'ip_str,port,org,http.title'})
```

```text MCP theme={null}
call_data_api(endpoint="shodan.host.search", params={"query": "apache country:DE", "facets": "org,os", "fields": "ip_str,port,org,http.title"})
```

> [!NOTE]
>
> * Costs 1 query credit when the query has a filter, and 1 more per 100 results past page 1. Use host.count first to size a query for free.

### Count hosts for a query

GET

`/shodan/host/count`

`shodan.host.count`

The total matching a Shodan query plus facet summaries, without results.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`query` required</td><td>string</td><td>query</td><td>Shodan search query; filters go inline as filter:value. Example `apache country:DE`</td></tr>
    <tr><td>`facets`</td><td>string</td><td>query</td><td>Comma-separated facets, each optionally property:count (country:100). Example `org,os`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developer.shodan.io/api#shodan-host-count)

```python Python theme={null}
router.call_data_api("shodan.host.count", {'query': 'apache country:DE', 'facets': 'org,os'})
```

```text MCP theme={null}
call_data_api(endpoint="shodan.host.count", params={"query": "apache country:DE", "facets": "org,os"})
```

> [!NOTE]
>
> * Uses no query credits.

### List search facets

GET

`/shodan/host/search/facets`

`shodan.search.facets`

Property names usable as facets.

Input

No inputs.

[Vendor docs](https://developer.shodan.io/api#shodan-facets) · Same job: [AlienVault OTX (LevelBlue Open Threat Exchange)](https://docs.webrouter.net/data-apis/alienvault-otx.md#alienvault-otx-indicator-types-list), [CIRCL hashlookup](https://docs.webrouter.net/data-apis/circl-hashlookup.md#circl-hashlookup-info), [ClinicalTrials.gov](https://docs.webrouter.net/data-apis/clinicaltrials-gov.md#clinicaltrials-gov-studies-enums), [crates.io](https://docs.webrouter.net/data-apis/crates-io.md#crates-io-categories-list), [Event Registry (NewsAPI.ai)](https://docs.webrouter.net/data-apis/event-registry.md#event-registry-suggest-concepts), [Have I Been Pwned](https://docs.webrouter.net/data-apis/haveibeenpwned.md#haveibeenpwned-data-classes-list)

```python Python theme={null}
router.call_data_api("shodan.search.facets")
```

```text MCP theme={null}
call_data_api(endpoint="shodan.search.facets")
```

### List search filters

GET

`/shodan/host/search/filters`

`shodan.search.filters`

Filter names usable in a query.

Input

No inputs.

[Vendor docs](https://developer.shodan.io/api#shodan-filters) · Same job: [AlienVault OTX (LevelBlue Open Threat Exchange)](https://docs.webrouter.net/data-apis/alienvault-otx.md#alienvault-otx-indicator-types-list), [CIRCL hashlookup](https://docs.webrouter.net/data-apis/circl-hashlookup.md#circl-hashlookup-info), [ClinicalTrials.gov](https://docs.webrouter.net/data-apis/clinicaltrials-gov.md#clinicaltrials-gov-studies-enums), [crates.io](https://docs.webrouter.net/data-apis/crates-io.md#crates-io-categories-list), [Event Registry (NewsAPI.ai)](https://docs.webrouter.net/data-apis/event-registry.md#event-registry-suggest-concepts), [Have I Been Pwned](https://docs.webrouter.net/data-apis/haveibeenpwned.md#haveibeenpwned-data-classes-list)

```python Python theme={null}
router.call_data_api("shodan.search.filters")
```

```text MCP theme={null}
call_data_api(endpoint="shodan.search.filters")
```

### Parse a query

GET

`/shodan/host/search/tokens`

`shodan.search.tokens`

Which filters a query string uses and with what values.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`query` required</td><td>string</td><td>query</td><td>Shodan search query; filters go inline as filter:value. Example `apache country:DE`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developer.shodan.io/api#shodan-host-search-tokens) · Same job: [AlienVault OTX (LevelBlue Open Threat Exchange)](https://docs.webrouter.net/data-apis/alienvault-otx.md#alienvault-otx-indicator-types-list), [CIRCL hashlookup](https://docs.webrouter.net/data-apis/circl-hashlookup.md#circl-hashlookup-info), [ClinicalTrials.gov](https://docs.webrouter.net/data-apis/clinicaltrials-gov.md#clinicaltrials-gov-studies-enums), [crates.io](https://docs.webrouter.net/data-apis/crates-io.md#crates-io-categories-list), [Event Registry (NewsAPI.ai)](https://docs.webrouter.net/data-apis/event-registry.md#event-registry-suggest-concepts), [Have I Been Pwned](https://docs.webrouter.net/data-apis/haveibeenpwned.md#haveibeenpwned-data-classes-list)

```python Python theme={null}
router.call_data_api("shodan.search.tokens", {'query': 'apache country:DE'})
```

```text MCP theme={null}
call_data_api(endpoint="shodan.search.tokens", params={"query": "apache country:DE"})
```

### List crawled ports

GET

`/shodan/ports`

`shodan.ports.list`

Port numbers Shodan's crawlers look at.

Input

No inputs.

[Vendor docs](https://developer.shodan.io/api#shodan-ports) · Same job: [AlienVault OTX (LevelBlue Open Threat Exchange)](https://docs.webrouter.net/data-apis/alienvault-otx.md#alienvault-otx-indicator-types-list), [CIRCL hashlookup](https://docs.webrouter.net/data-apis/circl-hashlookup.md#circl-hashlookup-info), [ClinicalTrials.gov](https://docs.webrouter.net/data-apis/clinicaltrials-gov.md#clinicaltrials-gov-studies-enums), [crates.io](https://docs.webrouter.net/data-apis/crates-io.md#crates-io-categories-list), [Event Registry (NewsAPI.ai)](https://docs.webrouter.net/data-apis/event-registry.md#event-registry-suggest-concepts), [Have I Been Pwned](https://docs.webrouter.net/data-apis/haveibeenpwned.md#haveibeenpwned-data-classes-list)

```python Python theme={null}
router.call_data_api("shodan.ports.list")
```

```text MCP theme={null}
call_data_api(endpoint="shodan.ports.list")
```

### Get a domain's subdomains and DNS records

GET

`/dns/domain/{domain}`

`shodan.dns.domain`

Subdomains and their A, AAAA, CNAME, NS, SOA, MX and TXT records with last-seen dates.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`domain` required</td><td>string</td><td>path</td><td>Domain name. Example `cnn.com`</td></tr>

    <tr>
      <td>
        `history`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Include historical DNS data; default false.
      </td>
    </tr>

    <tr><td>`type`</td><td>string</td><td>query</td><td>Only this record type. One of `A`, `AAAA`, `CNAME`, `NS`, `SOA`, `MX`, `TXT`</td></tr>

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

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page of 100 results, default 1; 'more' in the answer says another page exists.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developer.shodan.io/api#dns-domain) · 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), [SecurityTrails](https://docs.webrouter.net/data-apis/securitytrails.md#securitytrails-domain-get), [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("shodan.dns.domain", {'domain': 'cnn.com'})
```

```text MCP theme={null}
call_data_api(endpoint="shodan.dns.domain", params={"domain": "cnn.com"})
```

> [!NOTE]
>
> * 1 query credit per lookup.

### Resolve hostnames

GET

`/dns/resolve`

`shodan.dns.resolve`

IP addresses for a list of hostnames.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`hostnames` required</td><td>string</td><td>query</td><td>Comma-separated hostnames. Example `google.com,bing.com`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developer.shodan.io/api#dns-resolve) · 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), [SecurityTrails](https://docs.webrouter.net/data-apis/securitytrails.md#securitytrails-domain-get), [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("shodan.dns.resolve", {'hostnames': 'google.com,bing.com'})
```

```text MCP theme={null}
call_data_api(endpoint="shodan.dns.resolve", params={"hostnames": "google.com,bing.com"})
```

### Reverse-resolve IPs

GET

`/dns/reverse`

`shodan.dns.reverse`

Hostnames defined for a list of IP addresses.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`ips` required</td><td>string</td><td>query</td><td>Comma-separated IP addresses. Example `8.8.8.8,1.1.1.1`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developer.shodan.io/api#dns-reverse) · Same job: [Abstract API](https://docs.webrouter.net/data-apis/abstract-api.md#abstract-api-ip-lookup), [API Ninjas](https://docs.webrouter.net/data-apis/apininjas.md#apininjas-ip-lookup), [InternetData](https://docs.webrouter.net/data-apis/internetdata.md#internetdata-ip-lookup), [IP2Location.io](https://docs.webrouter.net/data-apis/ip2location-io.md#ip2location-io-ip-lookup), [ipapi.is](https://docs.webrouter.net/data-apis/ipapiis.md#ipapiis-ip-lookup), [ipdata](https://docs.webrouter.net/data-apis/ipdata.md#ipdata-ip-lookup)

```python Python theme={null}
router.call_data_api("shodan.dns.reverse", {'ips': '8.8.8.8,1.1.1.1'})
```

```text MCP theme={null}
call_data_api(endpoint="shodan.dns.reverse", params={"ips": "8.8.8.8,1.1.1.1"})
```

### Search saved queries

GET

`/shodan/query/search`

`shodan.queries.search`

Search queries other users saved to Shodan's public directory.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`query` required</td><td>string</td><td>query</td><td>What to look for in the saved queries. Example `webcam`</td></tr>

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

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developer.shodan.io/api#shodan-query-search)

```python Python theme={null}
router.call_data_api("shodan.queries.search", {'query': 'webcam'})
```

```text MCP theme={null}
call_data_api(endpoint="shodan.queries.search", params={"query": "webcam"})
```

### Get API plan and credits

GET

`/api-info`

`shodan.api.info`

Plan, remaining query and scan credits and usage limits for the key.

Input

No inputs.

[Vendor docs](https://developer.shodan.io/api#api-info)

```python Python theme={null}
router.call_data_api("shodan.api.info")
```

```text MCP theme={null}
call_data_api(endpoint="shodan.api.info")
```


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