# Vitacost Scraper (`crawlerbros/vitacost-scraper`) Actor

Scrape vitamins, supplements, and health foods from vitacost.com. Browse by category, search by keyword, or look up specific products. Get price, sale price, brand, size, and stock status. No login, no proxy required.

- **URL**: https://apify.com/crawlerbros/vitacost-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** E-commerce, Automation, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Vitacost Scraper

Scrape **Vitacost** — the online retailer for vitamins, supplements, and health foods. Browse any category, search by keyword, or look up specific products by handle/URL. Get price, sale price, discount percentage, brand, size/variant options, stock status, and images. No login, no age-gate, no proxy required.

### What this actor does

- **Four modes:** `byCategory` (paginated category browse), `search` (keyword search), `byHandles` (direct product lookup), `relatedProducts` (Vitacost's own "customers also viewed" recommendations for a seed product)
- **60+ built-in categories:** vitamins, minerals, herbs, sports supplements, personal care, beauty, health food/grocery, home, baby & kids, pet health — plus a free-text override for any other category
- **Price tracking:** current price, original (compare-at) price, computed discount percentage, on-sale flag
- **14 filter dimensions:** price range, brand, product type, title keyword, tags, SKU, stock status, discount %, promotional/private-label badges
- **Sorting:** best-selling, price, title, or newest/oldest (applied client-side for accuracy)
- **Empty fields are omitted** — every field present in a record has real data

### Output per product

- `productId`, `handle`, `productUrl` — canonical Vitacost product page
- `title`, `brand`, `productType`, `category`, `tags[]`
- `badges[]` — promotional/private-label badges Vitacost attaches to the listing, e.g. `Vitacost Brands` (store brand) or `SuperDeal` (deep-discount promo)
- `description` — plain text (HTML stripped)
- `price`, `maxPrice` — lowest / highest variant price
- `comparePrice`, `onSale`, `discountPercent` — sale tracking
- `currency` — always `USD`
- `variantCount`, `availableVariantCount`, `available`
- `skus[]` — up to 20
- `variants[]` — up to 30, each with `size`, `sku`, `price`, `comparePrice`, `available`, `barcode` (UPC), `weightLb` (shipping weight in pounds) — `barcode` is only available for `byHandles`/`relatedProducts` lookups (Vitacost's product-detail feed), not the paginated category/search feeds
- `imageUrl`, `images[]` — up to 15
- `options[]` — variant option names/values (e.g. size, count)
- `createdAt`, `updatedAt`, `publishedAt`
- `relatedToHandle`, `relatedToUrl` — the seed product a result was recommended for (mode = `relatedProducts` only)
- `recordType: "product"`, `scrapedAt`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `byCategory` | `byCategory` / `search` / `byHandles` / `relatedProducts` |
| `category` | string | `vitamins` | Category dropdown (mode=byCategory) |
| `categoryHandle` | string | – | Custom category handle override |
| `searchQuery` | string | – | Keyword search (mode=search), top 10 results |
| `productHandles` | array | – | Product handles or URLs — individual lookups (mode=byHandles) or recommendation seeds (mode=relatedProducts) |
| `sortBy` | string | `best-selling` | Sort order for category browse |
| `maxItems` | int | `100` | Hard cap (1–10000) |
| `imageQuality` | string | `master` | Shopify CDN image size |
| `minPrice` / `maxPrice` | number | – | Price range filter (USD) |
| `onSaleOnly` | bool | `false` | Only discounted products |
| `minDiscountPercent` | int | – | Minimum discount % |
| `brandContains` | string | – | Brand name substring filter |
| `productTypeContains` | string | – | Product type substring filter |
| `titleContains` | string | – | Title substring filter |
| `tagAnyOf` / `tagNoneOf` | array | – | Tag allow/block list |
| `badgesAnyOf` | array | – | Promotional/store-badge allowlist, e.g. `SuperDeal`, `Vitacost Brands` |
| `skuContains` | string | – | SKU substring filter |
| `includeUnavailable` | bool | `false` | Include out-of-stock products |
| `useApifyProxy` | bool | `false` | Force Apify proxy from the start |
| `requestDelaySecs` | int | `1` | Delay between page fetches |

#### Example: browse a category

```json
{
  "mode": "byCategory",
  "category": "vitamins",
  "maxItems": 100,
  "sortBy": "best-selling"
}
```

#### Example: on-sale sports supplements

```json
{
  "mode": "byCategory",
  "category": "sports-supplements",
  "onSaleOnly": true,
  "minDiscountPercent": 20,
  "maxItems": 200
}
```

#### Example: search by keyword

```json
{
  "mode": "search",
  "searchQuery": "turmeric curcumin"
}
```

#### Example: look up specific products

```json
{
  "mode": "byHandles",
  "productHandles": [
    "https://www.vitacost.com/vitacost-vitamin-c-500-mg-rose-hips-100-tablets"
  ]
}
```

#### Example: find related/recommended products

```json
{
  "mode": "relatedProducts",
  "productHandles": [
    "https://www.vitacost.com/vitacost-vitamin-c-500-mg-rose-hips-100-tablets"
  ]
}
```

#### Example: private-label deep-discount products only

```json
{
  "mode": "byCategory",
  "category": "vitamins",
  "badgesAnyOf": ["SuperDeal"],
  "maxItems": 200
}
```

### Use cases

- **Price tracking** — monitor a category or brand for sale prices and discount depth
- **Market research** — analyze supplement pricing and brand assortment
- **Affiliate content** — pull current pricing/availability for comparison pages
- **Inventory monitoring** — track stock status for specific SKUs
- **Competitive intelligence** — compare Vitacost pricing against other health retailers

### FAQ

**Is this affiliated with Vitacost?**
No. This is a third-party actor that reads Vitacost's public storefront data — no login required.

**Why does `search` only return up to 10 results?**
Vitacost's in-store search runs on Shopify's predictive-search API, which caps relevance results at 10 by platform design. For larger result sets, use `byCategory` browse with `titleContains` to filter by keyword within a category.

**Why does `relatedProducts` only return up to 10 results per seed?**
Vitacost's own recommendations feed is capped at 10 related items per product by platform design — the same limit Vitacost's own storefront shows under "customers also viewed". Pass multiple `productHandles` to gather related products for several seeds in one run.

**What are `badges`?**
Vitacost tags some listings with a small set of promotional/store labels — `Vitacost Brands` for its private-label products and `SuperDeal` for deep-discount promotions. The `badges` output field and `badgesAnyOf` input filter surface these directly instead of leaving them buried in the raw `productType` field.

**Why are some fields missing from a product?**
Fields are only included when Vitacost's storefront actually returns that data. For example, `comparePrice`/`discountPercent` only appear on discounted products, and `maxPrice` only appears when variants have different prices.

**Are customer ratings/reviews included?**
No. Vitacost does not render review data in its public storefront markup, so rating/review counts aren't reliably extractable without an authenticated app-specific API.

**How fresh is the data?**
Every run fetches live data directly from vitacost.com at request time.

**Does this actor require a proxy?**
No. Vitacost's storefront JSON endpoints are publicly accessible from standard datacenter IPs. The actor automatically retries via Apify proxy if a request is ever blocked.

# Actor input Schema

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

`byCategory` browses a category with full pagination. `search` runs Vitacost's in-store search (top 10 most relevant matches). `byHandles` looks up specific products by handle or URL. `relatedProducts` returns Vitacost's own "customers also viewed" recommendations for each seed product (top 10 per seed).

## `category` (type: `string`):

A Vitacost category to browse. Covers vitamins, supplements, sports nutrition, personal care, beauty, grocery/health food, home, baby & kids, and pet health.

## `categoryHandle` (type: `string`):

Advanced: any Vitacost collection handle not in the dropdown above (the last segment of `vitacost.com/collections/<handle>`). Overrides `category` when set.

## `searchQuery` (type: `string`):

Free-text keyword search, e.g. `vitamin c`, `turmeric`, `probiotics`. Returns Vitacost's top 10 most relevant matches (a platform limit on predictive search).

## `productHandles` (type: `array`):

Exact product handles (e.g. `vitacost-vitamin-c-500-mg-rose-hips-100-tablets-1234`) or full product URLs. For `byHandles`, each is looked up individually. For `relatedProducts`, each is used as a seed to fetch Vitacost's own recommended/related products (up to 10 per seed).

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

Sort order applied to category browse results.

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

Hard cap on the number of products returned (1-10000).

## `imageQuality` (type: `string`):

Shopify CDN serves multiple image sizes. `master` returns the original.

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

Drop products whose lowest price is below this threshold.

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

Drop products whose lowest price is above this threshold.

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

Only emit products with an active discount (compare-at price higher than the current price).

## `minDiscountPercent` (type: `integer`):

Only emit products discounted by at least this percentage.

## `brandContains` (type: `string`):

Only emit products whose brand name contains this substring (case-insensitive).

## `productTypeContains` (type: `string`):

Only emit products whose Shopify product type contains this substring.

## `titleContains` (type: `string`):

Only emit products whose title contains this substring (case-insensitive).

## `tagAnyOf` (type: `array`):

Only emit products whose tags contain at least one of these (case-insensitive substring match).

## `tagNoneOf` (type: `array`):

Drop products whose tags contain any of these substrings.

## `badgesAnyOf` (type: `array`):

Only emit products carrying at least one of these promotional/store badges, e.g. `Vitacost Brands` (private label) or `SuperDeal` (deep-discount promo). Case-insensitive substring match.

## `skuContains` (type: `string`):

Only emit products with a SKU containing this substring.

## `includeUnavailable` (type: `boolean`):

When false (default), drop products that are entirely out of stock.

## `useApifyProxy` (type: `boolean`):

Route requests through Apify proxy from the start. Vitacost usually works from datacenter IPs without proxy — the actor automatically falls back to Apify proxy on the first failure regardless of this setting.

## `requestDelaySecs` (type: `integer`):

Pause between successive page fetches. Lower = faster, higher = more polite.

## Actor input object example

```json
{
  "mode": "byCategory",
  "category": "vitamins",
  "productHandles": [],
  "sortBy": "best-selling",
  "maxItems": 20,
  "imageQuality": "master",
  "onSaleOnly": false,
  "tagAnyOf": [],
  "tagNoneOf": [],
  "badgesAnyOf": [],
  "includeUnavailable": false,
  "useApifyProxy": false,
  "requestDelaySecs": 1
}
```

# 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 = {
    "mode": "byCategory",
    "category": "vitamins",
    "productHandles": [],
    "sortBy": "best-selling",
    "maxItems": 20,
    "imageQuality": "master",
    "onSaleOnly": false,
    "tagAnyOf": [],
    "tagNoneOf": [],
    "badgesAnyOf": [],
    "includeUnavailable": false,
    "useApifyProxy": false,
    "requestDelaySecs": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/vitacost-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 = {
    "mode": "byCategory",
    "category": "vitamins",
    "productHandles": [],
    "sortBy": "best-selling",
    "maxItems": 20,
    "imageQuality": "master",
    "onSaleOnly": False,
    "tagAnyOf": [],
    "tagNoneOf": [],
    "badgesAnyOf": [],
    "includeUnavailable": False,
    "useApifyProxy": False,
    "requestDelaySecs": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/vitacost-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 '{
  "mode": "byCategory",
  "category": "vitamins",
  "productHandles": [],
  "sortBy": "best-selling",
  "maxItems": 20,
  "imageQuality": "master",
  "onSaleOnly": false,
  "tagAnyOf": [],
  "tagNoneOf": [],
  "badgesAnyOf": [],
  "includeUnavailable": false,
  "useApifyProxy": false,
  "requestDelaySecs": 1
}' |
apify call crawlerbros/vitacost-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/epkwaaJYQS6hq5o7V/builds/2BXSMUdZNRSfncsP5/openapi.json
