How do I reverse-lookup IP information using the Shodan API in Python?

Use the `api.host(ip_address)` method to get details about a specific IP. The returned `host` object contains `ip_str`, `org`, `os`, and a list of `data` items each with `port` and `banner` fields. Wrap the call in a try-except to handle cases where no information is available. You can read IPs from a file and loop through them, as demonstrated in the [Penetration Tool Development article](/news/penetration-tool-development-command-line-implementation-of-xss-platform).

Related article:

Shodan API Usage Guide