MCPcopy Create free account
hub / github.com/achillean/shodan-python / host

Method host

shodan/client.py:372–390  ·  view source on GitHub ↗

Get all available information on an IP. :param ip: IP of the computer :type ip: str :param history: (optional) True if you want to grab the historical (non-current) banners for the host, False otherwise. :type history: bool :param minify: (optional) True to o

(self, ips, history=False, minify=False)

Source from the content-addressed store, hash-verified

370 return self._request('/shodan/host/count', query_args)
371
372 def host(self, ips, history=False, minify=False):
373 """Get all available information on an IP.
374
375 :param ip: IP of the computer
376 :type ip: str
377 :param history: (optional) True if you want to grab the historical (non-current) banners for the host, False otherwise.
378 :type history: bool
379 :param minify: (optional) True to only return the list of ports and the general host information, no banners, False otherwise.
380 :type minify: bool
381 """
382 if isinstance(ips, basestring):
383 ips = [ips]
384
385 params = {}
386 if history:
387 params['history'] = history
388 if minify:
389 params['minify'] = minify
390 return self._request('/shodan/host/{}'.format(','.join(ips)), params)
391
392 def info(self):
393 """Returns information about the current API key, such as a list of add-ons

Callers 5

domain_infoFunction · 0.95
hostFunction · 0.95
alert_downloadFunction · 0.95
test_host_detailsMethod · 0.80
test_invalid_host_ipMethod · 0.80

Calls 1

_requestMethod · 0.95

Tested by 2

test_host_detailsMethod · 0.64
test_invalid_host_ipMethod · 0.64