serpapi / public-roadmap

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

[Google Play Product API] Scrape the Number of Reviews for Each Rating #1547

Closed schaferyan closed 1 month ago

schaferyan commented 2 months ago

For Google Play products, the number of reviews with each rating is displayed in the mouse tooltip when hovering over the graph. A customer requested we scrape this information. It appears to be available in the HTML.

Screenshot 2024-04-15 at 2 23 18 PM

Intercom | Google Play | Playground

ilyazub commented 2 months ago

Let's structure the output similarly to our other APIs.

{
  "reviews_results": {
    "rating": [
      {
        "stars": 1,
        "count": 87
      },
      {
        "stars": 2,
        "count": 90
      },
      {
        "stars": 3,
        "count": 432
      },
      {
        "stars": 4,
        "count": 1102
      },
      {
        "stars": 5,
        "count": 6677
      }
    ],
  }
}

Google Product (documentation)

image (ref: https://serpapi.com/playground?engine=google_product&product_id=4887235756540435899&gl=us&hl=en)

Walmart Product (documentation)

image

(ref: https://serpapi.com/playground?engine=walmart_product&product_id=1123329439)

ilyazub commented 2 months ago

Let's structure the output similarly to our other APIs.

{
  "reviews_results": {
    "rating": [
      {
        "stars": 1,
        "count": 87
      },
      {
        "stars": 2,
        "count": 90
      },
      {
        "stars": 3,
        "count": 432
      },
      {
        "stars": 4,
        "count": 1102
      },
      {
        "stars": 5,
        "count": 6677
      }
    ],
  }
}

My mistake, we already have top-level reviews in our Google Play Product API. We will keep reviews for backwards-compatibility and we'll add top-level ratings to the response. I'm sorry about the confusion.

image (ref: https://serpapi.com/google-play-product-api)

{
  # [...]
  "ratings": [
    # Hashes
  ],
  "reviews": [
    # Review hashes
  ]
  # [...]
}
ishiharaf commented 1 month ago

@schaferyan This feature is working on production 😺

image

Examples: