# Install shodan on Windows, macOS and Linux

Search Shodan for internet-connected devices, open ports and banners.

The official command-line client for Shodan, the search engine for internet-connected devices. It shows a host's open ports, banners and known vulnerabilities from Shodan's own scans, so you send the host no traffic yourself. It needs a Shodan API key.

## How to install shodan

```
ot install shodan
```

ot installs shodan 1.31.0 with uv into a Python environment of its own under `~/.ot`, so it cannot conflict with your system Python or with any other tool.

Before first use: Run "ot run shodan init <your key>" once before use.

If you do not have ot yet:

macOS and Linux:

```
curl -fsSL https://otinstaller.com/install.sh | sh
```

Windows (PowerShell):

```
irm https://otinstaller.com/install.ps1 | iex
```

Current version: 0.3.0. Both scripts verify the download against its [SHA-256 checksum](https://otinstaller.com/releases/v0.3.0/checksums.txt) before installing.

## How to use shodan

Arguments after the tool's name go straight to shodan.

Save your API key, once.

```
ot run shodan init YOUR_API_KEY
```

Show what Shodan has recorded for an address.

```
ot run shodan host 8.8.8.8
```

List the DNS records and subdomains Shodan knows.

```
ot run shodan domain example.com
```

Search with a Shodan query.

```
ot run shodan search --fields ip_str,port,org "product:nginx country:DE"
```

`ot run shodan --help` lists every option.

An AI agent can run shodan too: `ot mcp` serves it over the Model Context Protocol. See [OSINT with AI agents](https://otinstaller.com/mcp/).

## shodan licence, platforms and versions

- Project: https://github.com/achillean/shodan-python
- Licence: MIT
- Runs on: Windows, macOS and Linux
- Takes: ip, query
- Categories: search, hosts, network
- Sends traffic to the target: no
- Python package: shodan 1.31.0, in its own isolated environment

## Questions about shodan

### How do I install shodan on Windows?

Open PowerShell and install ot with `irm https://otinstaller.com/install.ps1 | iex`. Then run `ot install shodan`. ot fetches a pinned version of shodan and keeps it under `~/.ot`, apart from the rest of your system.

### Is shodan free?

Yes. shodan is open source, released under the MIT licence. ot, which installs it, is free under the Apache 2.0 licence.

### Do I need to set up Python to use shodan?

No. ot installs shodan with uv into a virtual environment of its own, separate from your system Python. If uv is not installed, ot fetches its own copy first.

### How do I update or remove shodan?

`ot update shodan` moves it to the version pinned in ot's registry, and `ot update shodan --latest` to the newest upstream release. `ot remove shodan` uninstalls it.

## Tools related to shodan

- [censys](https://otinstaller.com/tools/censys/): Search Censys for hosts, certificates and subdomains.
- [uncover](https://otinstaller.com/tools/uncover/): Query Shodan, Censys, FOFA and other search engines for exposed hosts.
- [asnmap](https://otinstaller.com/tools/asnmap/): Map an organisation, domain or IP to its ASNs and network ranges.
- [cdncheck](https://otinstaller.com/tools/cdncheck/): Identify the CDN, cloud provider or WAF in front of an IP or domain.
- [ipinfo](https://otinstaller.com/tools/ipinfo/): Look up geolocation, ASN, carrier and privacy details for IP addresses.
- [mapcidr](https://otinstaller.com/tools/mapcidr/): Expand, slice and aggregate CIDR ranges and IP lists.

More: [Networks and hosts](https://otinstaller.com/osint-tools/networks/).
