Get stats for the provided request.

        :param request dict: A search request that also contains the 'interval'
                             property.
        :returns: :py:class:`planet.api.models.JSON`
        :raises planet.api.exceptions.APIException: On API error.

def stats(self, request):
        '''Get stats for the provided request.

        :param request dict: A search request that also contains the 'interval'
                             property.
        :returns: :py:class:`planet.api.models.JSON`
        :raises planet.api.exceptions.APIException: On API error.
        '''
        # work-around for API bug
        request = _patch_stats_request(request)
        body = json.dumps(request)
        return self.dispatcher.response(models.Request(
            self._url('data/v1/stats'), self.auth,
            body_type=models.JSON, data=body, method='POST')).get_body()