# iHerb Product Scraper 🌿 (`shahidirfan/iherb-product-scraper`) Actor

Extract detailed product data from iHerb with blazing speed! Instantly gather pricing, images, reviews, and descriptions for supplements, beauty, and health items. Built for high-performance data extraction and market analysis. Get accurate results in seconds without complex configurations.

- **URL**: https://apify.com/shahidirfan/iherb-product-scraper.md
- **Developed by:** [Shahid Irfan](https://apify.com/shahidirfan) (community)
- **Categories:** E-commerce, Automation, Developer tools
- **Stats:** 44 total users, 6 monthly users, 100.0% runs succeeded, 4 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### What does iHerb Product Scraper do?

iHerb Product Scraper collects structured product data from iHerb, one of the largest online retailers for supplements, vitamins, health foods, beauty products, and natural wellness items. Enter a category URL or keyword to get detailed product records with prices, ratings, reviews, stock status, brand details, and product links. Export results as JSON, CSV, or Excel for market research, price monitoring, competitor analysis, and catalog building.

### Why use iHerb Product Scraper?

- **Structured product dataset** - Collect product information at scale without manual copy-paste from category pages.
- **Automation-ready output** - Export results in JSON, CSV, Excel, or XML. Connect datasets to dashboards, BI tools, and data pipelines.
- **Flexible collection scope** - Set a product limit, filter by stock availability, and switch between keyword-based or URL-driven runs.
- **Reliable repeat runs** - Schedule recurring collections for price tracking, catalog updates, and trend analysis.

### What data can you extract from iHerb?

| Field | Description |
|-------|-------------|
| `title` | Product name and variant details |
| `price` | Current listed price |
| `originalPrice` | Reference price when available |
| `rating` | Average user rating |
| `reviews` | Total review count |
| `inStock` | Stock availability status |
| `brand` | Brand name or code |
| `discount` | Discount message or percentage |
| `url` | Direct product page link |
| `imageUrl` | Product image URL |

### How to use iHerb Product Scraper

1. Open the Actor on Apify Store.
2. Enter a category keyword such as `supplements`, `beauty`, or `sports-nutrition`, or paste a direct iHerb category URL.
3. Set the maximum number of products and choose whether to collect only in-stock items.
4. Run the Actor.
5. Download the dataset or connect it to your workflow through integrations.

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `categoryUrl` | String | No | `""` | Direct iHerb category URL to scrape. Takes priority over keyword when provided. |
| `keyword` | String | No | `"supplements"` | Category keyword or slug used when `categoryUrl` is empty. |
| `maxProducts` | Integer | No | `20` | Maximum number of products to collect. Use `0` for no limit. |
| `inStockOnly` | Boolean | No | `true` | Collect only products currently in stock. |
| `proxyConfiguration` | Object | No | `{ "useApifyProxy": false }` | Proxy settings for your run environment. |

### Output Data

| Field | Type | Description |
|-------|------|-------------|
| `title` | String | Product name |
| `productId` | String | iHerb product identifier |
| `partNumber` | String | Product part number |
| `brand` | String | Brand name or code |
| `price` | String | Current listed price with currency |
| `originalPrice` | String | Reference price when available |
| `discount` | String | Discount message or percentage |
| `rating` | Number | Average user rating (0-5) |
| `reviews` | Number | Total number of ratings |
| `inStock` | Boolean | Stock availability indicator |
| `imageUrl` | String | Product image URL |
| `url` | String | Product detail page URL |
| `category` | String | Category slug used for collection |
| `currencySymbol` | String | Currency symbol such as $ |
| `isSponsored` | Boolean | Sponsored listing flag |
| `page` | Number | Pagination page number |
| `scrapedAt` | String | ISO timestamp of when data was collected |

Additional product attributes from the source are included as `api_*` fields when available. Run summary metrics are saved under `statistics` in the default key-value store.

### Usage Examples

#### Basic Run

Collect products from a category using a keyword:

```json
{
  "keyword": "supplements",
  "maxProducts": 20
}
```

#### URL-Driven Collection

Scrape a specific category page directly:

```json
{
  "categoryUrl": "https://www.iherb.com/c/beauty",
  "maxProducts": 120,
  "inStockOnly": true
}
```

#### Broad Catalog Collection

Collect a large sample from a category with all stock statuses included:

```json
{
  "keyword": "sports-nutrition",
  "maxProducts": 500,
  "inStockOnly": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

### Sample Output

```json
{
  "title": "California Gold Nutrition, Omega-3 Premium Fish Oil, 100 Fish Gelatin Softgels (1,100 mg per Softgel)",
  "productId": "62118",
  "partNumber": "MLI-00952",
  "brand": "California Gold Nutrition",
  "price": "$12.20",
  "originalPrice": "$12.20",
  "discount": "15% off code: MAY26HH",
  "rating": 4.8,
  "reviews": 484819,
  "inStock": true,
  "imageUrl": "https://s3.images-iherb.com/mli/mli00952/v/392.jpg",
  "url": "https://www.iherb.com/pr/california-gold-nutrition-omega-3-premium-fish-oil-100-fish-gelatin-softgels-1-100-mg-per-softgel/62118",
  "category": "supplements",
  "currencySymbol": "$",
  "isSponsored": false,
  "page": 1,
  "scrapedAt": "2026-05-30T07:31:13.792Z",
  "api_discountpricevalue": "12.20",
  "api_promocode": "MAY26HH",
  "api_packagequantity": "100 count",
  "api_productform": "Softgel"
}
```

### Tips for Best Results

- Start with a small `maxProducts` value to verify your input before scaling up.
- Use `categoryUrl` when you need exact control over which category page is scraped. Use `keyword` for simpler reusable runs.
- Enable proxy settings for larger collections or scheduled recurring runs.
- Keep `inStockOnly` set to `true` when you only need purchasable products.
- Schedule periodic runs to track pricing changes, new product additions, and stock shifts.

### Integrations

- **Google Sheets** - Send product data to spreadsheets for analysis and reporting.
- **Webhooks** - Trigger downstream workflows after each run completes.
- **Make or Zapier** - Connect results to no-code automations and business apps.
- **API** - Access datasets programmatically from your own systems.
- **CSV, Excel, JSON, XML** - Download in the format that fits your workflow.

### Frequently Asked Questions

#### How many products can I collect in one run?

Set `maxProducts` up to 10,000, or use `0` to collect without an explicit limit. The actual count depends on products available in the category.

#### Should I use categoryUrl or keyword?

Use `categoryUrl` when you want strict control over a specific page. Use `keyword` for simpler category-based runs where you only need the slug.

#### Why are some fields missing on certain products?

Not every product exposes the same metadata on iHerb. Optional attributes such as discount details and extended product specs vary across items.

#### Can I collect out-of-stock products?

Yes. Set `inStockOnly` to `false` to include products regardless of stock status.

#### Where are run-level statistics stored?

Summary metrics including total products scraped, pages fetched, and run duration are saved under `statistics` in the default key-value store.

#### Can I export the data to CSV or Excel?

Yes. Apify datasets can be downloaded in CSV, Excel, JSON, XML, and other supported formats.

#### Can I run this Actor on a schedule?

Yes. You can schedule the Actor in Apify Console to refresh data hourly, daily, or weekly.

#### Is this Actor suitable for non-technical users?

Yes. Inputs are form-based, and output can be downloaded without any coding.

#### Is it legal to scrape iHerb?

Scraping public web data can be legal, but you are responsible for complying with applicable laws, website terms, and privacy rules.

### Related Actors

- [Shein Product Scraper](https://apify.com/shahidirfan/shein-product-scraper) - Extract product data from Shein including prices, images, sizes, and ratings.
- [Namshi Product Scraper](https://apify.com/shahidirfan/namshi-product-scraper) - Collect product listings pricing, discounts, and ratings from Namshi.
- [Sephora Scraper](https://apify.com/shahidirfan/sephora-scraper) - Extract beauty product details, prices, and reviews from Sephora.

### Support

For issues, feature requests, or custom Actor work, use the Issues tab on the Actor page or contact the developer through Apify.

### Legal Notice

This Actor is designed for legitimate data collection from publicly available sources. Users are responsible for using the data responsibly and complying with applicable laws and website terms.

# Actor input Schema

## `categoryUrl` (type: `string`):

Direct iHerb category URL to scrape from. If provided, it takes priority over keyword.

## `keyword` (type: `string`):

Category keyword or slug (e.g., supplements, beauty, sports nutrition). Used when categoryUrl is empty.

## `maxProducts` (type: `integer`):

Maximum number of products to scrape (0 = unlimited).

## `inStockOnly` (type: `boolean`):

Show only products that are currently in stock

## `proxyConfiguration` (type: `object`):

Proxy settings for bypassing anti-bot protection. Recommended for reliable scraping.

## Actor input object example

```json
{
  "categoryUrl": "",
  "keyword": "supplements",
  "maxProducts": 20,
  "inStockOnly": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `products` (type: `string`):

Complete product listings with all details

## `productsCSV` (type: `string`):

Export products in CSV format

## `productsJSON` (type: `string`):

Export products in JSON format

## `statistics` (type: `string`):

Scraping statistics and summary

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "categoryUrl": "",
    "keyword": "supplements",
    "maxProducts": 20,
    "inStockOnly": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahidirfan/iherb-product-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "categoryUrl": "",
    "keyword": "supplements",
    "maxProducts": 20,
    "inStockOnly": True,
}

# Run the Actor and wait for it to finish
run = client.actor("shahidirfan/iherb-product-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "categoryUrl": "",
  "keyword": "supplements",
  "maxProducts": 20,
  "inStockOnly": true
}' |
apify call shahidirfan/iherb-product-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=shahidirfan/iherb-product-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/VvC3SAtWVyFJYvkYG/builds/cQLGutuf84oB70BKG/openapi.json
