API query : How to find average rating of a product using review API?


I was going through Reviews API docs and did not find how to find average rating of a product. Is there a workaround for this or is this still under dev?


1 person has this question

To get the average rating for all your products you can make a request to the following endpoint https://judge.me/api/reviews/aggregate_feed


Our API doesn't have an endpoint which will return the average rating for a specific product. But you could make a request to our cache server for the preview badge which will return the average rating within the html. Instructions can be found here. I've also attached an example request to the cache server you may use as a reference.


The params you need to include in the request are included in the api documentation https://judge.me/api/docs/v1, the required params are typically api_token (can be found https://judge.me/settings?jump_to=judge.me+api) & shop_domain.

Hi, thank you for your hard work!


Is there any development regarding getting average product rating ?


Could you possibly add an endpoint to fetch product average rating since your solution is not very clean and requires fetching 9.5KB of redundant data ?

Hi there,


If you need to display a product's average rating and its total number of reviews in a specific location on your store, you can use Judge.me metafields:

{{ product.metafields.reviews.rating.value }}  lets you display the average rating (e.g. "value": "3.5")

{{ product.metafields.reviews.rating_count }} lets you display the number of reviews (e.g. 125)


Check this article for more details: https://support.judge.me/support/solutions/articles/44002295100-how-to-get-product-ratings-and-total-number-of-reviews-via-judge-me-metafields-reviews-rating-and-reviews-rating-count-


Best,

Login or Signup to post a comment