serpapi / public-roadmap

Public Roadmap for SerpApi, LLC (https://serpapi.com)
51 stars 4 forks source link

[Google Maps Reviews API] Valid Searches Return Empty Results Most of the Time #1515

Closed schaferyan closed 6 months ago

schaferyan commented 6 months ago

A high volume customer reported the Google Maps Reviews API is sometimes returning empty results for searches that should return reviews.

I've been able to replicate this in the Playground. When retrying the same valid search with no_cache=true, it seems to return the expected result about 2/10 times. The other 8/10 times it returns the "reviews_results_state": "Fully empty" response.

I replicated this behavior with our Playground example, and two examples the customer shared.

This may or may not be related to https://github.com/serpapi/public-roadmap/issues/970, as in the instance reported there the no_reviews response was returned rather than fully_empty.

Screenshot 2024-03-28 at 10 46 00 AM

Inspector | Inspector | Inspector | Playground | Intercom

schaferyan commented 6 months ago

Another customer reported this:

Intercom

schaferyan commented 6 months ago

Another customer reported this:

Intercom

wilsonowilson commented 6 months ago

We're experiencing this issue right now and our customers are very unhappy :(

kagermanov27 commented 6 months ago

The empty results rate decreased sometime after https://github.com/serpapi/SerpApi/pull/4697 was merged.

matthewsewell commented 6 months ago

Thanks. I'm still seeing empty results. Is this due to a propagation lag, caching, or some such thing?

hilmanski commented 6 months ago

Another customer reported this issue.

Intrcom | Intercom2

aakashbohara commented 6 months ago

i am facing the same issue, no reviews: {"error":"An error occurred: 'reviews'"}

tanys123 commented 6 months ago

We've deployed a fix to the issue. It is now returning results as usual.

Screenshot 2024-03-29 at 2 39 38 PM

We have to use a different endpoint, it should work as before except the place info is no longer in the result. Is that something you will want in the result?

aakashbohara commented 6 months ago

I am still having the problem [image: Screenshot (264).png]

On Fri, Mar 29, 2024 at 12:29 PM Terry Tan @.***> wrote:

We've deployed a fix to the issue. It is now returning results as usual. Screenshot.2024-03-29.at.2.39.38.PM.png (view on web) https://github.com/serpapi/public-roadmap/assets/10222402/3b7d6170-a99d-4e39-9bee-20d78d7d56cb

We have to use a different endpoint, it should work as before except the place info is no longer in the result. Is that something you will want in the result?

— Reply to this email directly, view it on GitHub https://github.com/serpapi/public-roadmap/issues/1515#issuecomment-2026760609, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK2MNHBVXEJZKGMMJDUVF7LY2UETTAVCNFSM6AAAAABFNHTACGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRWG43DANRQHE . You are receiving this because you commented.Message ID: @.***>

tanys123 commented 6 months ago

Hi @aakashbohara, can you share the Search ID or your search query for us to check?

aakashbohara commented 6 months ago

Hi @aakashbohara, can you share the Search ID or your search query for us to check?

extended_reviews = [] params = { "engine": "google_maps_reviews", "place_id": place_id, "api_key": api, "sort_by": "ratingHigh", "num": 10 }

        search = GoogleSearch(params)
        results = search.get_dict()
        serpreviews = results["reviews"]
        # total_reviews = results['place_info']['reviews']
        average_google_rating = results['place_info']['rating']
        next_page_token = results['serpapi_pagination']['next_page_token'] if 'serpapi_pagination' in results and 'next_page_token' in results['serpapi_pagination'] else ''
        print(next_page_token)

        user_reviews = {}
        for review_data in serpreviews:
            if "images" in review_data:
                user_name = review_data["user"]["name"]
                if user_name not in user_reviews:
                    user_reviews[user_name] = []
                review = {
                    "review_link": review_data["link"],
                    "snippet": review_data["snippet"],
                    "rating": review_data["rating"],
                    "images": review_data["images"],
                    "date": review_data["date"],
                    "name": review_data["user"]["name"],
                    "link": review_data["user"]["link"],
                    "thumbnail": review_data["user"]["thumbnail"]
                }
                user_reviews[user_name].append(review)
                extended_reviews.append(review)
tanys123 commented 6 months ago

@aakashbohara Thanks for the info. Can you try adding "no_cache": True to the params, it might be serving the cache result. In addition, It would be great if you could provide the place_id so that I can try to replicate it.

aakashbohara commented 6 months ago

params

Got my solution thank you, seems like there is no "place_info" now.

marm123 commented 6 months ago

Thanks for fixing that @tanys123 ! Do you think we'll be able to get the place_info somehow in the future (with a different endpoint for example)? One of our customers asked about it.

Intercom