GreyNoise-Intelligence / pygreynoise

Python3 library and command line for GreyNoise

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support count parameter in stats function

dhvanilshah-crest opened this issue · comments

As per GreyNoise API, experimental/gnql/stats endpoint supports count parameter.

However, currently, stats function only accepts query parameter:
def stats(self, query)

Support count parameter as an additional optional argument to stats function:
def stats(self, query, count=None)

The following changes can been done in api/__ init __.py:

def stats(self, query, count=None):
        """Run GNQL stats query."""
        LOGGER.debug("Running GNQL stats query: %s...", query, query=query)
        params={"query": query}
        if count is not None:
            params["count"] = count
        response = self._request(self.EP_GNQL_STATS, params=params)
        return response

Fixed in #215