def hits(self) -> int:
        """Returns the number of hits the current query will return.

        This is done by making a lightweight query to CMR and inspecting the returned
        headers.

        Returns:
            The number of results reported by the CMR.

        Raises:
            RuntimeError: The CMR query failed.
        """
        url = self._build_url()

        response = self.session.get(url, headers=self.headers, params={"page_size": 0})

        try:
            response.raise_for_status()
        except requests.exceptions.HTTPError as ex:
            if ex.response is not None:
                raise RuntimeError(ex.response.text) from ex
            else:
                raise RuntimeError(str(ex)) from ex

        return int(response.headers["CMR-Hits"])
Returns the number of hits the current query will return.

        This is done by making a lightweight query to CMR and inspecting the returned
        headers.

        Returns:
            The number of results reported by the CMR.

        Raises:
            RuntimeError: The CMR query failed.
        
earthaccess/search.py