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

Method search

shodan/client.py:167–186  ·  view source on GitHub ↗

Search the entire Shodan Exploits archive using the same query syntax as the website. :param query: The exploit search query; same syntax as website. :type query: str :param facets: A list of strings or tuples to get summary information on.

(self, query, page=1, facets=None)

Source from the content-addressed store, hash-verified

165 self.parent = parent
166
167 def search(self, query, page=1, facets=None):
168 """Search the entire Shodan Exploits archive using the same query syntax
169 as the website.
170
171 :param query: The exploit search query; same syntax as website.
172 :type query: str
173 :param facets: A list of strings or tuples to get summary information on.
174 :type facets: str
175 :param page: The page number to access.
176 :type page: int
177 :returns: dict -- a dictionary containing the results of the search.
178 """
179 query_args = {
180 'query': query,
181 'page': page,
182 }
183 if facets:
184 query_args['facets'] = create_facet_string(facets)
185
186 return self.parent._request('/api/search', query_args, service='exploits')
187
188 def count(self, query, facets=None):
189 """Search the entire Shodan Exploits archive but only return the total # of results,

Callers

nothing calls this directly

Calls 2

create_facet_stringFunction · 0.85
_requestMethod · 0.80

Tested by

no test coverage detected