yoavaviram / python-amazon-simple-product-api

A simple Python wrapper for the Amazon.com Product Advertising API ⛺
Apache License 2.0
817 stars 212 forks source link

Is it possible to get product rating and number of reviews? #158

Open iranzo opened 5 years ago

iranzo commented 5 years ago

I would like to get product rating and number of reviews, how do I achieve that?

Thanks

norman-thomas commented 5 years ago

Sadly, this is somewhat awkward to access. The PA API provides a URL to an iframe, which contains the rating and reviews rendered as HTML. This is described in the documentation: https://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemLookup.html

The iframe URL can be accessed using the reviews property of a AmazonProduct instance. From there on, you'll have to parse the HTML returned to you. It's visually similar to the review section you can see on the Amazon product pages, but slightly different in its HTML structure.