The command-line interface (CLI) for Shodan is provided alongside the Python library. This means that you need to have Python installed on your computer in order to use the Shodan CLI. Once you have Python configured then you can run the following command to install the Shodan CLI:
pip install -U --user shodan
To confirm that it was properly installed you can run the command:
It should return show you a list of possible sub-commands for the Shodan CLI.
Finally, initialize the Shodan CLI with your API key:
shodan init YOUR_API_KEY
Done! You are now ready to use the CLI and try out the examples.
shodan: command not found
If the installation succeeded without errors but you're unable to run the command then try closing and re-opening the terminal window.
pip: command not found
This means that you either don't have Python properly installed or that you're running an older version which doesn't include
pip. Try using one of these alternate commands to install the Shodan CLI:
easy_install -U --user shodan
Or if your system only has the
pip3 install -U --user shodan