{
  "openapi": "3.0.1",
  "info": {
    "title": "iHerb Scraper - Products, Prices, Supplement Facts & Q&A",
    "description": "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.",
    "version": "0.1",
    "x-build-id": "olxFMUMEKnMJ7nUwM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/topapi~iherb-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-topapi-iherb-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/topapi~iherb-scraper/runs": {
      "post": {
        "operationId": "runs-sync-topapi-iherb-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/topapi~iherb-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-topapi-iherb-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "searchQueries": {
            "title": "🔎 Search terms",
            "type": "array",
            "description": "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).",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "🔗 iHerb links",
            "type": "array",
            "description": "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.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "productIds": {
            "title": "🔢 Product IDs",
            "type": "array",
            "description": "iHerb product ids (the number at the end of a product link), one per line, e.g. 61864, 10421. Read 24 at a time.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "📂 Categories",
            "type": "array",
            "description": "Category names or their link names, e.g. \"vitamin-d\", \"Protein\", \"magnesium\" (the part after /c/ in a category link).",
            "items": {
              "type": "string"
            }
          },
          "brands": {
            "title": "🏷️ Brands",
            "type": "array",
            "description": "Brand names or link names, e.g. \"NOW Foods\", \"california-gold-nutrition\", \"Doctor's Best\". Each brand lists its whole iHerb range.",
            "items": {
              "type": "string"
            }
          },
          "countryCode": {
            "title": "Country",
            "enum": [
              "US",
              "CA",
              "GB",
              "AU",
              "NZ",
              "DE",
              "FR",
              "IT",
              "ES",
              "NL",
              "IE",
              "SE",
              "PL",
              "CH",
              "AT",
              "BE",
              "IL",
              "SA",
              "AE",
              "KW",
              "QA",
              "IN",
              "JP",
              "KR",
              "TW",
              "HK",
              "SG",
              "MY",
              "PH",
              "TH",
              "VN",
              "ID",
              "MX",
              "BR",
              "CL",
              "CO",
              "PE",
              "KZ",
              "UA",
              "TR",
              "ZA",
              "NG",
              "EG"
            ],
            "type": "string",
            "description": "The iHerb market: it sets prices, availability and promo codes for that country, like the country picker on iherb.com.",
            "default": "US"
          },
          "currencyCode": {
            "title": "Currency",
            "enum": [
              "USD",
              "EUR",
              "GBP",
              "CAD",
              "AUD",
              "NZD",
              "JPY",
              "KRW",
              "CNY",
              "HKD",
              "TWD",
              "SGD",
              "MYR",
              "PHP",
              "THB",
              "VND",
              "IDR",
              "INR",
              "ILS",
              "SAR",
              "AED",
              "KWD",
              "QAR",
              "CHF",
              "SEK",
              "PLN",
              "MXN",
              "BRL",
              "CLP",
              "COP",
              "PEN",
              "KZT",
              "UAH",
              "TRY",
              "ZAR",
              "NGN",
              "EGP",
              "RUB"
            ],
            "type": "string",
            "description": "Currency the prices come back in. It only changes the display currency; the country sets the actual prices. Keep USD to compare markets directly.",
            "default": "USD"
          },
          "language": {
            "title": "Language",
            "enum": [
              "en-US",
              "es-MX",
              "fr-FR",
              "de-DE",
              "it-IT",
              "pt-BR",
              "ru-RU",
              "ja-JP",
              "ko-KR",
              "zh-CN",
              "zh-TW",
              "ar-SA",
              "tr-TR",
              "pl-PL",
              "nl-NL",
              "sv-SE",
              "th-TH",
              "vi-VN",
              "id-ID",
              "uk-UA",
              "kk-KZ"
            ],
            "type": "string",
            "description": "Language of product texts, review summaries and questions where iHerb has a translation.",
            "default": "en-US"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "default",
              "relevance",
              "featured",
              "bestSellers",
              "topRated",
              "mostRated",
              "priceLowToHigh",
              "priceHighToLow",
              "newest",
              "highestDiscount",
              "heaviest",
              "lightest"
            ],
            "type": "string",
            "description": "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.",
            "default": "default"
          },
          "minPrice": {
            "title": "Min price",
            "minimum": 0,
            "type": "number",
            "description": "Keep only products at or above this price (in the chosen currency)."
          },
          "maxPrice": {
            "title": "Max price",
            "minimum": 0,
            "type": "number",
            "description": "Keep only products at or below this price (in the chosen currency)."
          },
          "minRating": {
            "title": "Min rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Keep only products rated at least this many stars (1-5), e.g. 4.5."
          },
          "inStockOnly": {
            "title": "In stock only",
            "type": "boolean",
            "description": "Skip out-of-stock, discontinued and not-shippable products (also asks iHerb for available products only).",
            "default": false
          },
          "onSaleOnly": {
            "title": "On sale only",
            "type": "boolean",
            "description": "Keep only products priced below their list price.",
            "default": false
          },
          "brandFilter": {
            "title": "Brand contains",
            "type": "string",
            "description": "Keep only products whose brand name contains this text (or equals this brand code), e.g. \"NOW\" or \"CGN\"."
          },
          "includeDetails": {
            "title": "Full product details",
            "type": "boolean",
            "description": "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.",
            "default": true
          },
          "includeReviewSummary": {
            "title": "Review summary",
            "type": "boolean",
            "description": "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.",
            "default": true
          },
          "includeQuestions": {
            "title": "Q&A (questions and answers)",
            "type": "boolean",
            "description": "Also return each product's customer questions as separate rows, with their answers. Charged per question row.",
            "default": false
          },
          "maxQuestionsPerProduct": {
            "title": "Questions per product",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many questions to return for each product (iHerb's order, see Q&A order).",
            "default": 20
          },
          "maxAnswersPerQuestion": {
            "title": "Answers per question",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many answers to keep in each question row.",
            "default": 3
          },
          "questionsSort": {
            "title": "Q&A order",
            "enum": [
              "relevant",
              "newest",
              "helpful",
              "newlyAnswered",
              "oldest"
            ],
            "type": "string",
            "description": "Which questions come first.",
            "default": "relevant"
          },
          "questionsSince": {
            "title": "Questions since",
            "type": "string",
            "description": "Only questions asked on or after this date (YYYY-MM-DD). Pairs well with a schedule."
          },
          "monitorMode": {
            "title": "Monitor price and stock",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "monitorChangesOnly": {
            "title": "Changed products only",
            "type": "boolean",
            "description": "In monitor mode, skip products whose price and stock did not change (not charged). Off = every product, each with its changeType.",
            "default": true
          },
          "monitorStoreName": {
            "title": "Monitor memory name",
            "type": "string",
            "description": "Named key-value store that remembers prices between runs. Use one name per task; each country and currency keeps its own baseline.",
            "default": "iherb-monitor"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "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": {
            "title": "Max products",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "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.",
            "default": 100
          },
          "maxResultsPerSearch": {
            "title": "Max products per search",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap for each search term, link, category or brand. 0 = up to Max products. In monitor mode this is the window checked each run.",
            "default": 0
          },
          "compact": {
            "title": "Compact output",
            "type": "boolean",
            "description": "Core fields only (no HTML, image lists, history or long texts) - trimmed for AI / MCP pipelines.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "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.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many iHerb requests run at the same time.",
            "default": 8
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}