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

Method count

shodan/client.py:355–370  ·  view source on GitHub ↗

Returns the total number of search results for the query. :param query: Search query; identical syntax to the website :type query: str :param facets: (optional) A list of properties to get summary information on :type facets: str :returns: A dictionary with

(self, query, facets=None)

Source from the content-addressed store, hash-verified

353 return data
354
355 def count(self, query, facets=None):
356 """Returns the total number of search results for the query.
357
358 :param query: Search query; identical syntax to the website
359 :type query: str
360 :param facets: (optional) A list of properties to get summary information on
361 :type facets: str
362
363 :returns: A dictionary with 1 main property: total. If facets have been provided then another property called "facets" will be available at the top-level of the dictionary. Visit the website for more detailed information.
364 """
365 query_args = {
366 'query': query,
367 }
368 if facets:
369 query_args['facets'] = create_facet_string(facets)
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.

Callers 8

countFunction · 0.95
downloadFunction · 0.95
statsFunction · 0.95
aggregate_facetFunction · 0.45
test_count_simpleMethod · 0.45
test_count_facetsMethod · 0.45
test_exploits_countMethod · 0.45

Calls 2

_requestMethod · 0.95
create_facet_stringFunction · 0.85

Tested by 4

test_count_simpleMethod · 0.36
test_count_facetsMethod · 0.36
test_exploits_countMethod · 0.36