iHerb
iHerb Search API
Search iHerb (US store, prices in USD) by keyword, 48 products per page: product id, part number, name, brand and brand code, price, list price, discount, rating, review count, stock, badges, recent sales and a sponsored flag for each result, plus the total result count and the top brands to filter by. Eight sorts and a brand filter. Costs 2 credits per request.
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/jsonquerystringrequiredSearch keywords, up to 200 characters.
Example: vitamin d
pageintegerResults page, 1-based, up to 500. Defaults to 1. 48 results per page.
Example: 1
sortstringrelevance, best_selling, rating, price_asc, price_desc, newest, percent_off (highest discount first) or review_count. Omit for iHerb's featured order.
Example: best_selling
brand_codestringOnly this brand, by iHerb brand code: a result's brand_code or a brand_filters entry (CGN is California Gold Nutrition, NOW is NOW Foods).
Example: CGN
Request
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
res = client.iherb.search(query="vitamin d")["data"]
print(res["total_results"], "results,", res["total_pages"], "pages")
for p in res["products"]:
print(p["position"], p["product_id"], p["brand"], p["price"], p["rating"], p["review_count"], p["recent_sales"])Response