# iHerb Scraper - Products, Prices, Supplement Facts & Q\&A (`topapi/iherb-scraper`) Actor

Scrape iHerb products by search, category, brand or link: price, promo code, stock and units left, rating, UPC, supplement facts, ingredients, warnings, expiry date, best-seller rank, review summary. Q\&A add-on, price and stock monitor. No login. $0.45 per 1,000 products.

- **URL**: https://apify.com/topapi/iherb-scraper.md
- **Developed by:** [Top Api](https://apify.com/topapi) (community)
- **Categories:** E-commerce, Lead generation, Developer tools
- **Features:** Limited permissions
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.45 / 1,000 products

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does iHerb Scraper do?

**iHerb Scraper** extracts product data from [iHerb](https://www.iherb.com), the supplement, vitamin, beauty and grocery store that ships to 180+ countries. Give it search terms, category or brand names, any iHerb link or product ids, and each product comes back as one row: price, list price, promo code, stock and units left, rating, UPC, supplement facts, ingredients, warnings, expiry date and best-seller ranks. Built for e-commerce sellers, price trackers, brands and nutrition researchers.

Also known as: iHerb product scraper · iHerb price scraper · iHerb API · iHerb supplement facts scraper · iHerb data extractor

- **Full product rows**: 92 fields, from price and promo code to the supplement-facts table, other ingredients, suggested use, warnings, diet tags, dimensions and shipping weight.
- **Every way into the catalog**: keyword search, categories, brands, brand + category, specials, new products, clearance, health topics, product links and ids.
- **Any iHerb market**: pick the country and currency; prices, stock and promo codes follow that market.
- **Review summary in every row**: star histogram, reviews per language, the top positive and top critical review, and iHerb's AI review summary.
- **Q\&A add-on**: customer questions with their answers, as separate rows.
- **Price and stock monitor**: scheduled runs report price drops, increases, out-of-stock and back-in-stock changes with a price history.
- **No login, no cookies, no API key**: no iHerb account is used.

### What data can you get from iHerb?

<table>
<tr><td>🏷️ Title, brand, part number (`title`, `brand`, `partNumber`)</td><td>🔢 UPC barcode (`upc`)</td><td>💲 Price, list price, discount (`price`, `listPrice`, `discountPercentage`)</td></tr>
<tr><td>🎟️ Promo code and its % (`promoCode`)</td><td>⚖️ Price per serving (`pricePerUnit`)</td><td>📦 Stock status, units left (`stockStatus`, `stockQuantity`)</td></tr>
<tr><td>⭐ Rating, review count (`rating`, `reviewCount`)</td><td>🔥 30-day sales (`recentActivity`)</td><td>🧪 Supplement facts (`supplementFacts`)</td></tr>
<tr><td>🥄 Serving size, servings per container</td><td>🧾 Ingredients, other ingredients</td><td>📋 Suggested use (`suggestedUse`)</td></tr>
<tr><td>⚠️ Warnings, allergen statements</td><td>🌱 Diet tags (`dietTags`)</td><td>🏅 Certifications, test documents</td></tr>
<tr><td>📅 Expiry / best-by date (`expiryDate`)</td><td>📐 Dimensions, shipping weight</td><td>🗂️ Category path (`categories`)</td></tr>
<tr><td>🏆 Best-seller ranks (`categoryRanks`)</td><td>🖼️ All images (`images`)</td><td>📊 Review summary (`reviewSummary`)</td></tr>
<tr><td>💬 Q&A with answers</td><td>📉 Price changes and history</td><td>🌍 Country, currency, language</td></tr>
</table>

Measured on a 100-product run (search "magnesium", 2026-10-28): title, brand, part number, UPC, price, list price, price per serving, stock status, units in stock, rating, review count, images, supplement facts, ingredients, suggested use, warnings, dimensions, shipping weight, expiry date and the review histogram were filled on 100 of 100 rows. 98 had the 30-day sales line, 96 diet tags, 95 iHerb's AI review summary, 46 certifications, 27 a potency and 5 a published best-seller rank.

### How to scrape iHerb with iHerb Scraper

1. [Create a free Apify account](https://console.apify.com/sign-up). It comes with $5 of monthly credit and no card is needed.
2. Open **iHerb Scraper** and click **Try for free**.
3. Type search terms into **Search terms** (e.g. `vitamin c`), or paste iHerb links, category names, brand names or product ids.
4. Pick the **Country**, set **Max products**, and turn on **Q\&A** if you want the questions.
5. Click **Start**. Products appear in the dataset as they are read.
6. Open the **Storage** tab and **Export** as JSON, CSV or Excel, or connect a schedule.

### ⬇️ Input

| Parameter | Type | Description |
|---|---|---|
| **🔍 What to scrape** | | Use any mix. Empty = a 10-product sample search. |
| `searchQueries` | List | Search terms, e.g. `vitamin c`, `magnesium glycinate`. |
| `startUrls` | List | Any iHerb link: product (`/pr/.../61864`), search (`/search?kw=...`), category or brand (`/c/vitamins`, `/c/now-foods`), brand + category (`/c/now-foods/vitamins`), `/specials`, `/new-products`, `/clearance`, `/hs/vegan/store`, `/ht/sleep`. Filters in the link (`sr`, `bids`, `ratings`, `pmin`, `pmax`, `soa`) are kept. |
| `productIds` | List | Product ids, e.g. `61864`. |
| `categories` | List | Category names or link names, e.g. `vitamin-d`, `Protein`. |
| `brands` | List | Brand names or link names, e.g. `NOW Foods`, `california-gold-nutrition`. |
| **🎯 Filters** | | |
| `countryCode` | Select | iHerb market. Default `US`. |
| `currencyCode` | Select | Display currency. Default `USD`. |
| `language` | Select | Language of texts. Default `en-US`. |
| `sortBy` | Select | iHerb's sorts: relevance, featured, best sellers, top rated, most rated, price, newest, highest discount, weight. |
| **✂️ Refine results** | | Filtered products are not charged. |
| `minPrice`, `maxPrice` | Number | Price range. |
| `minRating` | Number | e.g. `4.5`. |
| `inStockOnly` | Boolean | Skip out-of-stock and discontinued products. Default `false`. |
| `onSaleOnly` | Boolean | Only products below their list price. Default `false`. |
| `brandFilter` | Text | Keep brands containing this text, e.g. `NOW`. |
| **➕ Extra data** | | |
| `includeDetails` | Boolean | Facts panel, ingredients, warnings, UPC, dimensions, expiry, ranks, images. Default `true`, same price. |
| `includeReviewSummary` | Boolean | Histogram, languages, top reviews, AI summary. Default `true`, free. |
| `includeQuestions` | Boolean | Q\&A rows, charged per question. Default `false`. |
| `maxQuestionsPerProduct` | Integer | Default `20`. |
| `maxAnswersPerQuestion` | Integer | Default `3`. |
| `questionsSort`, `questionsSince` | Select, date | Q\&A order; only questions asked on or after a date. |
| **🔁 Monitoring** | | |
| `monitorMode` | Boolean | Compare with the last run and say what changed. Default `false`. |
| `monitorChangesOnly` | Boolean | Skip unchanged products (not charged). Default `true`. |
| `monitorStoreName` | Text | Memory between runs. Default `iherb-monitor`. |
| `webhookUrl` | Text | POST the changes as JSON at the end of a monitor run. |
| **📦 Output** | | |
| `maxItems` | Integer | Product rows in total. Default `100`; `0` = no limit. |
| `maxResultsPerSearch` | Integer | Per search, link, category or brand. `0` = up to `maxItems`. |
| `compact` | Boolean | Core fields only, for AI agents and MCP. |
| **⚙️ Advanced** | | |
| `proxyConfiguration` | Proxy | Not needed. The actor moves to the Apify proxy only if iHerb refuses a request. |
| `maxConcurrency` | Integer | Parallel requests. Default `8`. |

#### Input JSON

```json
{
  "searchQueries": ["vitamin c"],
  "categories": ["vitamin-d"],
  "countryCode": "US",
  "sortBy": "bestSellers",
  "maxItems": 100,
  "includeQuestions": false
}
```

#### Use the link when you want iHerb's own filters

Filter a search on iherb.com (brand, rating, price, in stock), then paste the address into **iHerb links**: the filters in it are applied by iHerb. **Do:** `https://www.iherb.com/search?kw=collagen&bids=CGN` · **Don't:** type `collagen CGN` as a search term (that searches for the words).

#### Best-seller rank of every product in a category

Set **Sort by** to **Best sellers** and list a category: each row's `categoryRank` is its best-seller position there (1 = top seller). `categoryRanks` carries the ranks iHerb publishes on the product itself (5 of 100 products in a search run).

#### One country per run

Prices, stock and promo codes depend on the iHerb market. Run once per country; with monitor mode each country and currency keeps its own price memory.

### ⬆️ Output

Each product becomes one item. Real row from a run (search "magnesium", trimmed):

```json
{
  "productId": "48803",
  "title": "Life Extension, Magnesium Caps, 500 mg, 100 Vegetarian Capsules",
  "brand": "Life Extension",
  "partNumber": "LEX-14591",
  "upc": "737870145912",
  "price": 9,
  "listPrice": 9,
  "currency": "USD",
  "pricePerUnit": "$0.09/serving",
  "promoCode": "OCT26DAILY",
  "promoCodeDiscountPercentage": 20,
  "stockStatus": "in_stock",
  "stockQuantity": 7025,
  "rating": 4.8,
  "reviewCount": 63064,
  "recentActivity": "10K+ sold in 30 days",
  "servingSize": "1 Vegetarian Capsule",
  "servingsPerContainer": "100",
  "supplementFacts": [{ "name": "Magnesium (as magnesium oxide, citrate, succinate)", "amount": "500 mg", "dailyValue": "119%" }],
  "dietTags": ["Gluten-free"],
  "expiryDate": "2028-06-01",
  "reviewSummary": { "ratingHistogram": { "1": 399, "2": 519, "3": 2099, "4": 6162, "5": 53885 }, "aiSummary": "Customers highly praise Life Extension Magnesium Capsules for their quality, effectiveness, and packaging..." },
  "url": "https://www.iherb.com/pr/life-extension-magnesium-caps-500-mg-100-vegetarian-capsules/48803"
}
```

A Q\&A row (Q\&A on) is a question with its answers:

```json
{
  "type": "question",
  "productId": "62118",
  "question": "Does the tests on the source of omega 3 certify an absence of heavy metals or is it extracted from deep ocean?",
  "askedAt": "2021-11-22",
  "answerCount": 29,
  "answers": [{ "text": "California Gold Nutrition has confirmed that Omega-3 Premium Fish Oil is a molecularly distilled...", "author": "Customer Service", "authorType": "CustomerService", "isBest": true, "helpfulYes": 76 }]
}
```

In monitor mode each product row also has `changeType` (`new_item`, `price_drop`, `price_increase`, `out_of_stock`, `back_in_stock`, `no_change`, `details` = delivered before without the product details and now with them), `previousPrice`, `currentPrice`, `priceChangePercent`, `previousStockStatus`, `lowestPrice`, `highestPrice`, `firstSeenAt` and `history` (the last 30 observations). A product id iHerb no longer serves comes back once as a free `removed` row.

#### Fields

| Field | What it is | Fill (100-row run) |
|---|---|---|
| `productId`, `title`, `brand`, `partNumber`, `url` | Identity | 100% |
| `upc` | UPC barcode | 100% |
| `price`, `listPrice`, `discountPercentage`, `pricePerUnit` | Prices in the chosen currency | 100% |
| `promoCode`, `promoCodeDiscountPercentage`, `promoMessage` | Public promo code on the product | 90% |
| `stockStatus`, `stockQuantity`, `isAvailableToPurchase` | Availability and units in stock | 100% |
| `rating`, `reviewCount` | Customer rating | 100% |
| `recentActivity` | "10K+ sold in 30 days" (search and category rows) | 98% |
| `servingSize`, `servingsPerContainer`, `supplementFacts` | Facts panel | 100% |
| `ingredients`, `otherIngredients`, `suggestedUse`, `warnings` | Label texts | 100% |
| `allergenInfo` | Allergen sentences from the label | 27% |
| `dietTags`, `certifications` | Diet tags, test documents | 96%, 46% |
| `dimensions`, `shippingWeightLb`, `weightLb` | Package | 100% |
| `expiryDate` | Best-by date | 100% |
| `categories` | Category path (top-level only when iHerb publishes no rank) | 100% |
| `categoryRanks`, `bestSellerRank` | Ranks iHerb publishes | 5% |
| `images` | All image links | 100% |
| `reviewSummary` | Histogram, languages, top reviews, AI summary | 100% (AI summary 95%) |

### How can I use iHerb data?

- 💲 **Price comparison and repricing**: track iHerb prices, promo codes and price per serving against your own store.
- 📉 **Price and stock alerts**: a daily monitor run tells you what dropped, rose, sold out or came back.
- 🛒 **Catalog building**: UPC, part number, images, facts panel and label texts for listings.
- 🧪 **Formulation research**: compare doses, ingredients and diet tags across a category.
- 🏆 **Brand and market share**: best-seller order, 30-day sales signals and review counts per brand.
- 💬 **Customer insight**: Q\&A, the top critical review and the AI review summary show what buyers ask and dislike.

### How much does it cost to scrape iHerb?

Pay per result, no start fee:

| Row | Price per row | per 1,000 |
|---|---:|---:|
| Product (with details and review summary) | $0.00045 | $0.45 |
| Question with answers (Q\&A on) | $0.00045 | $0.45 |

Examples: 100 products = $0.045. A whole 1,000-product category = $0.45. 100 products with 20 questions each = $0.945. There is nothing else to pay: Apify platform usage is included in these prices. Nothing is charged for filtered products, duplicates, unchanged products in monitor mode or product ids iHerb does not serve. Set a spending limit on the run and the actor stops before it.

### Integrations, API, scheduling & MCP

Run it from the [Apify API](https://docs.apify.com/api/v2), the [JavaScript](https://docs.apify.com/api/client/js) or [Python](https://docs.apify.com/api/client/python) client, connect it to Make, Zapier, n8n or Google Sheets, or call it from an AI agent through the [Apify MCP server](https://mcp.apify.com).

#### Run it on a schedule

Create an [Apify schedule](https://docs.apify.com/platform/schedules) (for example daily) with `monitorMode: true`: each run returns only the products whose price or stock changed, and an unchanged product costs nothing. Add `webhookUrl` to get the changes posted to your app, or use an [Apify webhook](https://docs.apify.com/platform/integrations/webhooks).

```bash
curl -X POST "https://api.apify.com/v2/acts/TopApi~iherb-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"categories":["vitamin-d"],"maxResultsPerSearch":200,"maxItems":0,"monitorMode":true,"monitorStoreName":"vitamin-d-us"}'
```

### Limits & empty runs

- **Speed**: 100 products with details and review summaries took 30 seconds and a 1,000-product category 455 seconds (256 MB, 2026-10-28). Give the run more memory to go faster.
- **Whole categories**: iHerb lists 48 products a page and every page can be read (vitamins alone is about 4,500 products).
- **Full review lists are not offered**: iHerb blocks its review data from scripts. Each row carries the review summary instead (histogram, reviews per language, top positive and top critical review, AI summary).
- **Best-seller ranks** on the product itself are published for a few products (5 of 100 in a search run); sort a category by Best sellers for a rank on every row.
- Product ids iHerb does not serve in the chosen country, and inputs that match no iHerb page, are named in the status line and not charged. If iHerb refuses every request of a run, it ends FAILED with nothing charged.

### FAQ

#### How many products can iHerb Scraper collect in one run?

As many as you set: a 1,000-product category came back in one run of 455 seconds. Set `maxItems` to `0` for whole categories.

#### Can iHerb Scraper get iHerb reviews?

It returns the review summary in every product row: the star histogram, reviews per language, the top positive and top critical review and iHerb's AI review summary. Full review lists are not offered.

#### Can I monitor iHerb prices with iHerb Scraper?

Yes: turn on monitor mode and schedule the run. Each row says what changed, with the previous price and a 30-observation history.

#### Which countries does iHerb Scraper support?

The iHerb markets in the Country list. Prices, stock and promo codes are those of the chosen market; the currency only changes how prices are shown.

#### Can I use iHerb Scraper with the Apify API or an MCP server?

Yes. Every input above works in the API body, and the actor is available to AI agents through the Apify MCP server.

#### Do I need an iHerb account, cookies or an API key?

No. No iHerb account is used.

#### Why did my iHerb Scraper run return no results?

The status line says why: the search has no results, the category or brand name is not an iHerb page, every product was filtered out, nothing changed since the last monitor run, or iHerb refused the run (then nothing is charged).

#### How is iHerb Scraper different from other iHerb scrapers?

Details, the review summary and Q\&A in one actor, per-row pricing with no start fee, units in stock, expiry dates, diet tags, certifications, the AI review summary, and a monitor that says exactly what changed.

#### Your feedback

Found a bug or need a field? Open an issue on the actor's Issues tab.

# Actor input Schema

## `searchQueries` (type: `array`):

Words to search iHerb for, one per line, e.g. "vitamin c", "magnesium glycinate", "collagen". Each term is one search, read page by page (48 products a page).

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

Any iHerb link: a product (/pr/.../61864), a search (/search?kw=...), a category or brand (/c/vitamins, /c/now-foods), brand + category, /specials, /new-products, /hs/..., /ht/... Link filters are kept.

## `productIds` (type: `array`):

iHerb product ids (the number at the end of a product link), one per line, e.g. 61864, 10421. Read 24 at a time.

## `categories` (type: `array`):

Category names or their link names, e.g. "vitamin-d", "Protein", "magnesium" (the part after /c/ in a category link).

## `brands` (type: `array`):

Brand names or link names, e.g. "NOW Foods", "california-gold-nutrition", "Doctor's Best". Each brand lists its whole iHerb range.

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

The iHerb market: it sets prices, availability and promo codes for that country, like the country picker on iherb.com.

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

Currency the prices come back in. It only changes the display currency; the country sets the actual prices. Keep USD to compare markets directly.

## `language` (type: `string`):

Language of product texts, review summaries and questions where iHerb has a translation.

## `sortBy` (type: `string`):

Order of search and category results (iHerb's own sorts). With "Best sellers" on a category, each row's categoryRank is its best-seller rank there.

## `minPrice` (type: `number`):

Keep only products at or above this price (in the chosen currency).

## `maxPrice` (type: `number`):

Keep only products at or below this price (in the chosen currency).

## `minRating` (type: `number`):

Keep only products rated at least this many stars (1-5), e.g. 4.5.

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

Skip out-of-stock, discontinued and not-shippable products (also asks iHerb for available products only).

## `onSaleOnly` (type: `boolean`):

Keep only products priced below their list price.

## `brandFilter` (type: `string`):

Keep only products whose brand name contains this text (or equals this brand code), e.g. "NOW" or "CGN".

## `includeDetails` (type: `boolean`):

Add description, suggested use, ingredients, warnings, supplement facts, UPC, dimensions, shipping weight, units in stock, expiry date, diet tags, ranks and all images. Same price per product.

## `includeReviewSummary` (type: `boolean`):

Add the star histogram, review counts per language, the top positive and top critical review and iHerb's AI review summary to each product. Free.

## `includeQuestions` (type: `boolean`):

Also return each product's customer questions as separate rows, with their answers. Charged per question row.

## `maxQuestionsPerProduct` (type: `integer`):

How many questions to return for each product (iHerb's order, see Q\&A order).

## `maxAnswersPerQuestion` (type: `integer`):

How many answers to keep in each question row.

## `questionsSort` (type: `string`):

Which questions come first.

## `questionsSince` (type: `string`):

Only questions asked on or after this date (YYYY-MM-DD). Pairs well with a schedule.

## `monitorMode` (type: `boolean`):

Compare every product with the last run: rows say price_drop, price_increase, out_of_stock, back_in_stock or new_item, with a price history. With product details on, a product an earlier run delivered without them comes back once with them, as details. Pairs with a daily schedule.

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

In monitor mode, skip products whose price and stock did not change (not charged). Off = every product, each with its changeType.

## `monitorStoreName` (type: `string`):

Named key-value store that remembers prices between runs. Use one name per task; each country and currency keeps its own baseline.

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

In monitor mode, POST the changed products as JSON to this URL at the end of the run, e.g. https://hooks.example.com/iherb.

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

Stop after this many product rows in total. 0 = no limit (whole categories: vitamins alone is ~4,500 products). Question rows have their own limit.

## `maxResultsPerSearch` (type: `integer`):

Cap for each search term, link, category or brand. 0 = up to Max products. In monitor mode this is the window checked each run.

## `compact` (type: `boolean`):

Core fields only (no HTML, image lists, history or long texts) - trimmed for AI / MCP pipelines.

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

Not needed: the actor reads iHerb's own data directly and moves to the Apify proxy (datacenter, then residential) only if iHerb refuses a request. Your own proxy URLs replace that route.

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

How many iHerb requests run at the same time.

## Actor input object example

```json
{
  "searchQueries": [
    "vitamin c"
  ],
  "countryCode": "US",
  "currencyCode": "USD",
  "language": "en-US",
  "sortBy": "default",
  "inStockOnly": false,
  "onSaleOnly": false,
  "includeDetails": true,
  "includeReviewSummary": true,
  "includeQuestions": false,
  "maxQuestionsPerProduct": 20,
  "maxAnswersPerQuestion": 3,
  "questionsSort": "relevant",
  "monitorMode": false,
  "monitorChangesOnly": true,
  "monitorStoreName": "iherb-monitor",
  "maxItems": 20,
  "maxResultsPerSearch": 0,
  "compact": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 8
}
```

# Actor output Schema

## `results` (type: `string`):

One item per iHerb product (type "product") or customer question (type "question").

# 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 = {
    "searchQueries": [
        "vitamin c"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("topapi/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 = {
    "searchQueries": ["vitamin c"],
    "maxItems": 20,
}

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

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

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

```

## CLI example

```bash
echo '{
  "searchQueries": [
    "vitamin c"
  ],
  "maxItems": 20
}' |
apify call topapi/iherb-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,topapi/iherb-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

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