Skip to content

Commit

Permalink
Add new API methods to get list of search filters/ facets
Browse files Browse the repository at this point in the history
  • Loading branch information
achillean committed Dec 14, 2019
1 parent 1f101ca commit da0e2ae
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions shodan/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,20 @@ def search_cursor(self, query, minify=True, retries=5, skip=0):
tries += 1
time.sleep(1.0) # wait 1 second if the search errored out for some reason

def search_facets(self):
"""Returns a list of search facets that can be used to get aggregate information about a search query.
:returns: A list of strings where each is a facet name
"""
return self._request('/shodan/host/search/facets', {})

def search_filters(self):
"""Returns a list of search filters that are available.
:returns: A list of strings where each is a filter name
"""
return self._request('/shodan/host/search/filters', {})

def search_tokens(self, query):
"""Returns information about the search query itself (filters used etc.)
Expand Down

0 comments on commit da0e2ae

Please sign in to comment.