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)
| 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. |