iHerb
iHerb Bulk Prices API
Current price, list price, discount, in-stock flag, rating and review count for up to 50 iHerb products in one call (US store, prices in USD). One row per requested id, in request order; unknown ids come back with found: false and are listed in not_found. The cheapest way to monitor iHerb prices and stock across a product list. Costs 2 credits per request, whether you send 1 id or 50.
POST/api/v1/iherb/prices
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_idsstring[]required1-50 iHerb product ids (1-9 digits each; numbers are accepted too): a search result's product_id or a variant option's product_id. Duplicates are answered once.
Example: ["70316", "77548", "10421"]
Request
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
res = client.iherb.prices(product_ids=["70316", "77548", "10421", "124745", "10056"])["data"]
for p in res["products"]:
if p["found"]:
print(p["product_id"], p["brand"], p["price"], "list", p["list_price"], "-%d%%" % p["discount_percent"], "in stock" if p["in_stock"] else "OUT")
print("not found:", res["not_found"])Response
"currency": "USD",
"count": 9,
"not_found": [],
},
"response_time": 1592
}