# iHerb Scraper: Search, Products, Reviews & Monitor (`vaunted/iherb-scraper`) Actor

The ultimate iHerb API. Supports 4 modes: Search, Product Details, Reviews, and Real-Time Price Monitoring. Extract ingredients, nutrition, and stock status for 24+ countries. No monthly fees—pay only for what you scrape.

- **URL**: https://apify.com/vaunted/iherb-scraper.md
- **Developed by:** [Sage](https://apify.com/vaunted) (community)
- **Categories:** E-commerce, Lead generation, Automation
- **Stats:** 160 total users, 23 monthly users, 98.7% runs succeeded, 6 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 items

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

## iHerb All-in-One Scraper

The **Ultimate All-in-One** iHerb solution. Search, Product Details, Reviews, and Real-Time Price Monitoring in a single Actor.

### ✨ Features

- **4 Operation Modes**: Search, Product Details, Reviews, and Price Monitoring
- **API-Based Speed**: Lightning-fast data extraction without slow browser rendering
- **Global Coverage**: Supports 24+ countries and currencies
- **Price Monitoring**: Get notified when prices drop or items come back in stock
- **Rich Data**: 50+ fields per product including ingredients, nutritional facts, and UPC codes
- **No Monthly Fees**: Pay only for what you use

### 🏆 Why Choose This Over Others?

Most iHerb scrapers are either slow (browser-based), expensive, or require monthly subscriptions.

| Feature | iHerb All-in-One | Others |
|---------|------------------|--------|
| **Speed** | API-Based (Lightning Fast) | Slow Browser Scraping |
| **Modes** | 4-in-1 (Search, Details, Reviews, Monitor) | Usually Single Purpose |
| **Monitoring** | Built-in Price & Stock Alerts | Not Available |
| **Bulk Extraction** | Sitemap Support (10k+ items) | Limited |
| **Pricing** | Pay Per Use | Monthly Subscriptions |

### 🧠 Smart Auto-Detection

Don't want to configure modes? Just paste **any** iHerb URL (Product, Category, or Search) into `startUrls`. The actor intelligently detects the page type and scrapes it automatically.

### 🚀 Quick Start

#### Search Products

Scrape products from categories or search results.

```json
{
    "mode": "search",
    "startUrls": [
        { "url": "https://www.iherb.com/c/vitamins" }
    ],
    "maxItems": 100
}
```

#### Get Product Details

Extract comprehensive data for specific products.

```json
{
    "mode": "details",
    "startUrls": [
        { "url": "https://www.iherb.com/pr/NOW-Foods-Vitamin-D-3/10421" }
    ]
}
```

#### Scrape Reviews

Get customer reviews for products.

```json
{
    "mode": "reviews",
    "startUrls": [
        { "url": "https://www.iherb.com/pr/NOW-Foods-Vitamin-D-3/10421" }
    ],
    "maxReviewsPerProduct": 100
}
```

#### Monitor Prices

Track price changes and get webhook notifications.

```json
{
    "mode": "monitor",
    "startUrls": [
        { "url": "https://www.iherb.com/pr/Product-Name/12345" }
    ],
    "webhookUrl": "https://your-webhook.com/alerts"
}
```

> 💡 **Pro Tip:** Monitor mode stores state automatically - no file uploads needed between runs. Just schedule it and forget it.

### 📥 Input Options

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `mode` | string | `auto` | Operation mode: `auto`, `search`, `details`, `reviews`, `monitor` |
| `startUrls` | array | required | Product, category, or search URLs to scrape |
| `searchKeywords` | string | - | Search keywords (alternative to URLs) |
| `countryCode` | string | `US` | Country code for localized pricing |
| `currencyCode` | string | `USD` | Currency for prices |
| `maxItems` | integer | 100 | Maximum items to scrape |
| `maxReviewsPerProduct` | integer | 100 | Maximum reviews per product |
| `webhookUrl` | string | - | Webhook URL for price monitoring alerts |
| `useSitemapForBulk` | boolean | false | Set to true for high-speed full category extraction (10k+ items) |
| `filters.minPrice` | number | - | Minimum price filter |
| `filters.maxPrice` | number | - | Maximum price filter |
| `filters.minRating` | number | - | Minimum rating filter (1-5) |
| `filters.inStockOnly` | boolean | false | Only show in-stock items |

### 📤 Output Examples

#### Product Details

```json
{
    "productId": "10421",
    "url": "https://www.iherb.com/pr/now-foods-vitamin-d-3/10421",
    "title": "Vitamin D-3, High Potency, 5,000 IU, 120 Softgels",
    "brand": "NOW Foods",
    "price": 8.99,
    "listPrice": 12.99,
    "discountPercentage": 31,
    "currency": "USD",
    "stockStatus": "in_stock",
    "rating": 4.8,
    "reviewCount": 15432,
    "upc": "733739003676",
    "categories": ["Vitamins", "Vitamin D"],
    "ingredients": ["Vitamin D-3 (as Cholecalciferol)", "..."],
    "suggestedUse": "Take 1 softgel daily with a fat-containing meal.",
    "images": ["https://..."],
    "scrapedAt": "2024-01-15T10:30:00.000Z"
}
```

#### Review Data

```json
{
    "reviewId": "abc123",
    "productId": "10421",
    "rating": 5,
    "title": "Great product!",
    "text": "I've been taking this for 6 months and my levels are perfect now.",
    "reviewerName": "John D.",
    "reviewerLocation": "United States",
    "isVerified": true,
    "date": "2024-01-10T00:00:00.000Z"
}
```

#### Price Alert (Monitor Mode)

```json
{
    "productId": "10421",
    "productName": "Vitamin D-3, High Potency",
    "changeType": "price_drop",
    "previousPrice": 12.99,
    "currentPrice": 8.99,
    "priceChangePercent": -31,
    "currency": "USD",
    "timestamp": "2024-01-15T10:30:00.000Z"
}
```

### 💡 Best Practices

- **For Speed:** Use `filters.inStockOnly` to avoid wasting credits on out-of-stock items.
- **For Bulk:** If you need >10,000 items, set `useSitemapForBulk: true`.
- **Proxies:** This actor is optimized for **Apify Residential Proxies**. Using datacenter proxies may yield fewer results.

### 🌍 Supported Countries

US, GB, CA, AU, DE, FR, ES, IT, JP, KR, CN, TW, HK, SG, MY, TH, PH, IN, AE, SA, IL, RU, BR, MX

### 💰 Supported Currencies

USD, GBP, CAD, AUD, EUR, JPY, KRW, CNY, TWD, HKD, SGD, MYR, THB, PHP, INR, AED, SAR, ILS, RUB, BRL, MXN

### 💡 Use Cases

- **Price Comparison**: Track iHerb prices against other retailers
- **Inventory Monitoring**: Get alerts when products come back in stock
- **Market Research**: Analyze product categories, pricing, and reviews
- **Dropshipping**: Get product data for your store
- **Review Analysis**: Aggregate customer feedback and sentiment

# Actor input Schema

## `mode` (type: `string`):

Select the operation mode. 'auto' will detect URL type automatically.

## `startUrls` (type: `array`):

Product URLs, Category URLs, or Search URLs to scrape. The actor will auto-detect the type if mode is 'auto'.

## `searchKeywords` (type: `string`):

Keywords to search for (alternative to providing search URLs). Leave empty if using startUrls.

## `countryCode` (type: `string`):

Target country for localized pricing and availability

## `currencyCode` (type: `string`):

Currency for prices

## `filters` (type: `object`):

Filter results by brand, price range, or rating (applies to Search mode). Example: {"brand": "California Gold", "minPrice": 10, "maxPrice": 50, "minRating": 4}

## `maxItems` (type: `integer`):

Maximum number of items to scrape (0 = unlimited)

## `maxReviewsPerProduct` (type: `integer`):

Maximum reviews to fetch per product in Reviews mode (0 = all)

## `webhookUrl` (type: `string`):

URL to POST changes when price/stock changes are detected. Receives full JSON payload.

## `monitorChangesOnly` (type: `boolean`):

In Monitor mode, only output items that changed since last run

## `useSitemapForBulk` (type: `boolean`):

Set to true for high-speed full category extraction (10k+ items)

## `maxConcurrency` (type: `integer`):

Maximum parallel requests (adaptive throttling will adjust automatically)

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

Proxy settings. Residential proxies strongly recommended.

## Actor input object example

```json
{
  "mode": "auto",
  "startUrls": [
    {
      "url": "https://www.iherb.com/c/vitamins"
    }
  ],
  "countryCode": "US",
  "currencyCode": "USD",
  "maxItems": 100,
  "maxReviewsPerProduct": 100,
  "monitorChangesOnly": true,
  "useSitemapForBulk": false,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.iherb.com/c/vitamins"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("vaunted/iherb-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 = {
    "startUrls": [{ "url": "https://www.iherb.com/c/vitamins" }],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("vaunted/iherb-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 '{
  "startUrls": [
    {
      "url": "https://www.iherb.com/c/vitamins"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call vaunted/iherb-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/77ucUPltttheQkuZl/builds/mBdtRoLM0MTwQSI7f/openapi.json
