def METHOD_NAME(self, request: Request, organization) -> Response:
    stats_period = request.GET.METHOD_NAME("groupStatsPeriod")
    try:
        start, end = get_date_range_from_params(request.GET)
    except InvalidParams as e:
        raise ParseError(detail=str(e))
    if stats_period not in (None, "", "24h", "14d", "auto"):
        return Response({"detail": ERR_INVALID_STATS_PERIOD}, status=400)
    environments = self.get_environments(request, organization)
    projects = self.get_projects(request, organization)
    if not projects:
        return Response([])
    is_fetching_replay_data = request.headers.METHOD_NAME("X-Sentry-Replay-Request") == "1"
    if (
        len(projects) > 1
        and not features.has("organizations:global-views", organization, actor=request.user)
        and not is_fetching_replay_data
    ):
        return Response(
            {"detail": "You do not have the multi project stream feature enabled"}, status=400
        )
    queries = request.GET.getlist("query")
    response = {}
    for query in queries:
        try:
            count = self._count(
                request,
                query,
                organization,
                projects,
                environments,
                {"count_hits": True, "date_to": end, "date_from": start},
            )
            response[query] = count
        except (ValidationError, discover.InvalidSearchQuery) as exc:
            return Response({"detail": str(exc)}, status=400)
    return Response(response)