iHerb
iHerb Reviews API
The review summary for one iHerb product: average rating, total review count, star histogram (count and percent per star), review counts per language, and the full text of the top positive and the top critical review with rating, title, author, country, date, verified-purchase flag, helpful votes and images. It is a summary, not a full review list. Costs 2 credits per request; a failed attempt is not charged.
Authorizations
AuthorizationstringheaderrequiredBearer authentication header of the form Bearer <token>, where <token> is your Scavio API key (e.g. Bearer sk_live_your_key).
Body
application/jsonproduct_idstringiHerb product id: the number at the end of an iherb.com/pr/ URL, or a search result's product_id. A number is accepted too. Pass this or url.
Example: 70316
urlstringAn iherb.com product URL, as an alternative to product_id.
Example: https://www.iherb.com/pr/california-gold-nutrition-vitamin-d3-125-mcg-5-000-iu-90-fish-gelatin-softgels/70316
Request
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
r = client.iherb.reviews(product_id="70316")["data"]
print(r["average_rating"], "from", r["review_count"], "reviews")
for star, h in r["rating_histogram"].items():
print(star, h["count"], "%d%%" % h["percent"])
top = r["top_positive_review"]
if top:
print(top["rating"], top["title"], "-", top["text"])Response