# iHerb Product Advisor (`dadhalfdev/iherb-product-advisor`) Actor

Recommend iHerb products from a wellness shopping context using OpenRouter + live iHerb listings. Returns ranked products with reasons. Not medical advice.

- **URL**: https://apify.com/dadhalfdev/iherb-product-advisor.md
- **Developed by:** [Marco Rodrigues](https://apify.com/dadhalfdev) (community)
- **Categories:** Integrations, Agents, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$80.00 / 1,000 product recommendations

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 Product Advisor

Want iHerb picks that match a real shopping context — not just another product dump? This actor turns a short wellness brief into **ranked live iHerb recommendations** with reasons.

Describe what you need (budget, form, preferences). The actor finds matching products on iHerb and returns a shortlist. **Not medical advice.**

### 💡 Perfect for...

- **Shoppers:** Turn “sinus season, vegan capsules under $30” into concrete product links.
- **Health-tech / apps:** Offer grounded iHerb suggestions from user context.
- **🤖 AI Agents:** One structured input → ranked products with reasons.
- **🔗 Workflows:** Pipe recommendations into n8n, Make, LangChain, CrewAI, etc.

### ✨ Why you'll love this scraper

- 🧠 **Context → recommendations:** Plain-language need in, ranked products out.
- 🛒 **Live iHerb data:** Suggestions come from real search / Health Topic listings (not invented SKUs).
- 🎯 **Preferences-aware:** Budget, capsules vs gummies, brand likes/dislikes, avoid-lists.
- ⚠️ **Safety framing:** Built-in disclaimer; wellness shopping aid only.

### 📦 What's inside the data?

Each run pushes:

1. **`run_meta`** — planned queries/topics, counts, disclaimer
2. **`recommendation` rows** — ranked products with reasons

Recommendation fields:

- **Rank / fit:** `rank`, `match_score`, `reason`, `cautions`
- **Product:** `product_id`, `part_number`, `name`, `brand`, `price_usd`, `url`, `in_stock`
- **Provenance:** `source_query`, `type`

### 🚀 Quick start

1. Write a **context** (what you need).
2. Optionally add **preferences** and set `max_items`.
3. Click **Start** — export CSV/JSON when done.

***

#### Tech details for developers 🧑‍💻

**How it works**

1. Interprets your context into iHerb search queries + Health Topic categories
2. Scrapes live listings
3. Ranks a shortlist from those candidates only (so product IDs stay real)

**Inputs**

| Field | Description |
|--------|-------------|
| `context` | Wellness shopping need (required) |
| `preferences` | Optional constraints |
| `max_items` | How many recommendations to return (default 5, max 30) |

**Input Example:**

```json
{
  "context": "Seasonal allergy sinus pressure; prefer vegan capsules under $30",
  "preferences": "Avoid melatonin; like California Gold Nutrition if possible",
  "max_items": 5
}
```

**Output Example (recommendation row):**

```json
{
  "type": "recommendation",
  "rank": 1,
  "match_score": 88,
  "reason": "Sinus-oriented herbal capsule formula that fits a vegan capsule preference and typical allergy-season shopping intent.",
  "cautions": "Not a substitute for medical care if symptoms are severe or persistent.",
  "product_id": "49438",
  "name": "Redd Remedies, Adult Sinus Support™, 72 Vegan Capsules",
  "brand": "Redd Remedies",
  "price_usd": 37.97,
  "url": "https://www.iherb.com/pr/redd-remedies-adult-sinus-support-72-vegan-capsules/49438",
  "in_stock": true
}
```

**Disclaimer:** Supplements are not medicines. This actor does not diagnose, treat, or prescribe. Check labels, allergens, and interactions yourself or with a clinician.

# Actor input Schema

## `context` (type: `string`):

What you want help shopping for (goals, preferences, lifestyle). Example: 'sinus pressure in allergy season, prefer vegan capsules under $30'.

## `preferences` (type: `string`):

Optional constraints: budget, form (capsules/gummies/powder), brand likes/dislikes, avoid ingredients, etc.

## `max_items` (type: `integer`):

How many product recommendations to return (1–30).

## Actor input object example

```json
{
  "context": "Seasonal allergy sinus pressure; prefer vegan capsules under $30",
  "max_items": 5
}
```

# Actor output Schema

## `overview` (type: `string`):

Table view of recommendations using the dataset 'overview' view.

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

All items from the default dataset without view transformation.

# 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 = {
    "context": "Seasonal allergy sinus pressure; prefer vegan capsules under $30",
    "max_items": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("dadhalfdev/iherb-product-advisor").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 = {
    "context": "Seasonal allergy sinus pressure; prefer vegan capsules under $30",
    "max_items": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("dadhalfdev/iherb-product-advisor").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 '{
  "context": "Seasonal allergy sinus pressure; prefer vegan capsules under $30",
  "max_items": 5
}' |
apify call dadhalfdev/iherb-product-advisor --silent --output-dataset

```

## MCP server setup

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

```

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/jheGx90HS6UbtrOxt/builds/d3lMmGEdbGmYSp9iS/openapi.json
