# Walgreens Product Price & Stock Lookup Scraper (`crawlyth-forge/walgreens-product-price-and-stock-lookup-scraper`) Actor

Search Walgreens.com by keyword, browse a category page, or look up exact product IDs for regular and member pricing, stock and shipping status, brand, ingredients, promotions and ratings, filterable by price, brand and rating.

- **URL**: https://apify.com/crawlyth-forge/walgreens-product-price-and-stock-lookup-scraper.md
- **Developed by:** [crawlyth forge](https://apify.com/crawlyth-forge) (community)
- **Categories:** E-commerce, Automation, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 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/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

## Walgreens Product Price & Stock Lookup Scraper

Walgreens.com sells pharmacy, health, beauty, grocery and household items through one large catalog. This actor searches that catalog by keyword, browses a category page, or fetches exact products by ID or URL — returning regular and myWalgreens member pricing, brand, UPC/GTIN, stock and shipping status, images, description and category breadcrumb. No login or cookies required.

### What this actor does

- **Three modes:** `search` (keyword), `byCategoryUrl` (browse any department/category page), `byProductIds` (exact lookup)
- **Rich product data:** price, member price, unit price, UPC, GTIN, brand, images, description, category breadcrumb, FSA/EBT eligibility, stock & shipping availability
- **Filters:** price range, in-stock only, exact brand, minimum customer rating, on-sale/clearance only
- **Store-aware:** pass a `storeId` to get that store's local pricing/availability (defaults to a representative US store)
- **Empty fields are omitted** — no null/placeholder values in the output

### Output per product

- `productId`, `title`, `brand`, `url` — canonical Walgreens product page
- `imageUrl`, `imageUrls` — full photo gallery
- `regularPrice`, `memberPrice` (myWalgreens member price, when it differs from regular), `unitPrice`, `unitPriceSize`
- `rebateText` — sitewide promo/rebate banner copy
- `promotions` — BOGO / mix-and-match style offers, e.g. "Buy 1, Get 1 FREE"
- `rating` (0-5, Bazaarvoice-sourced), `reviewCount`
- `sizeCount`, `availableOptions` — other sizes/variants of this product
- `upc`, `gtin` — barcode identifiers
- `inStock`, `shipAvailable`, `pickupAvailable` — authoritative availability flags
- `shipAvailableMessage` — a Walgreens API status label; note it is frequently `"Out of stock online"` even when `shipAvailable`/`addToCartEnable` are `true` — treat `inStock`/`shipAvailable` as authoritative, not this message string
- `ageRestricted`, `isAlcohol`, `isGiftCard` — purchase-restriction flags
- `tier1Category`, `tier2Category`, `tier3Category`, `brandUrl`
- `isFsaEligible`, `isEbtEligible` — payment-eligibility flags
- `webExclusive`, `isWalgreensBrand`
- `onClearance`, `isNewLowerPrice`, `isNewItem` — merchandising badges
- `retailUnitQty`, `couponAvailable`
- `productAttributes` — certifications/features like "Gluten Free", "Vegan"
- `productType` — fine-grained product type, more granular than `tier3Category`
- `hasIngredients`, `ingredients` — flat list of ingredient names (supplement/OTC-drug products that publish an ingredients panel)
- `nutritionFacts` — list of `{name, amountPerServing}` from the Supplement/Nutrition Facts panel (e.g. Calories, Vitamin C, Sodium), on the same products that publish `ingredients`
- `servingSize`, `servingsPerContainer`
- `warningText` — product warning/caution copy
- `shippingWeightLbs`, `shippingRestrictedStates` — US state codes this item cannot ship to
- `description`
- `recordType`, `scrapedAt`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `search` | `search` / `byCategoryUrl` / `byProductIds` |
| `searchQuery` | string | `vitamin c` | Keyword search (mode=search) |
| `categoryUrl` | string | – | Category/department page URL (mode=byCategoryUrl) |
| `productIds` | array | – | Product IDs or product page URLs (mode=byProductIds) |
| `storeId` | integer | `15196` | Walgreens store ID for local pricing (default: a representative US store) |
| `minPrice` / `maxPrice` | integer | – | Regular-price bounds in USD |
| `inStockOnly` | boolean | `false` | Only in-stock (online) products |
| `brand` | string | – | Exact brand match, case-insensitive |
| `minRating` | number | – | Only products with an average customer rating at or above this (0-5); unreviewed products are kept |
| `onSaleOnly` | boolean | `false` | Only products currently on clearance or at a new lower price |
| `maxItems` | integer | `30` | Cap on emitted records (1-200) |

#### Example: keyword search at a specific store

```json
{
  "mode": "search",
  "searchQuery": "vitamin c",
  "storeId": 15196,
  "maxItems": 30
}
```

#### Example: browse a category page

```json
{
  "mode": "byCategoryUrl",
  "categoryUrl": "https://www.walgreens.com/store/c/vitamin-c/ID=361635-tier3",
  "maxItems": 50
}
```

Use a leaf category page (one that lists individual products, e.g. `.../ID=xxxxx-tier3`) rather than a top-level department landing page (`.../ID=xxxxx-tier1`), which lists subcategories instead of products — click through to the specific product-listing page on walgreens.com and copy that URL.

#### Example: exact product lookup by ID/URL

```json
{
  "mode": "byProductIds",
  "productIds": ["300405068", "prod3511"]
}
```

#### Example: on-sale, highly-rated products in a price range

```json
{
  "mode": "search",
  "searchQuery": "sunscreen",
  "minPrice": 5,
  "maxPrice": 25,
  "minRating": 4,
  "onSaleOnly": true,
  "maxItems": 40
}
```

### Use cases

- **Price monitoring** — track regular price, member price, and clearance status for pharmacy/health/beauty SKUs over time
- **Assortment & catalog research** — browse category pages to see everything Walgreens stocks in a department
- **Competitive retail analysis** — compare pricing and promotions against other drugstore/grocery chains
- **Ingredient & nutrition auditing** — pull `ingredients`/`nutritionFacts` for supplement and OTC products
- **Local availability checks** — pass `storeId` to check in-stock/pickup status for a specific store
- **Deal & coupon feeds** — filter `onSaleOnly` to build a live clearance/markdown feed

### FAQ

**Do I need a Walgreens account or cookies?**
No. Prices and product data are read from Walgreens' own public product API anonymously, exactly like a signed-out visitor's browser does.

**Why does `search` sometimes take longer than the other modes?**
Walgreens gates its keyword search-results and category-listing pages behind a short verification step that `search` and `byCategoryUrl` have to clear first. `byProductIds` skips that step entirely since it looks up known products directly, so it's consistently the fastest mode.

**What's `memberPrice`?**
Walgreens shows a lower "myWalgreens member" price alongside the regular price on many products; it's included when it differs from `regularPrice`.

**Does the output include ratings/reviews?**
Yes — `rating` (0-5) and `reviewCount` come straight from Walgreens' own product-page review widget when the product has published reviews; new/low-traffic products without reviews simply omit both fields rather than showing `0`.

**What's the difference between `rebateText` and `promotions`?**
`rebateText` is Walgreens' sitewide promo banner (e.g. a percent-off promo code). `promotions` lists product-specific mix-and-match/BOGO offers (e.g. "Buy 1, Get 1 FREE") that apply to that item specifically.

**Can I get products from a specific store's inventory?**
Yes — set `storeId` to your target Walgreens store's numeric ID. Pricing and stock messages reflect that store; the default value is a representative store used when you don't need store-specific data.

**What happens if my `searchQuery` doesn't match any product?**
For most unmatched keywords, Walgreens' search returns zero products and the actor reports 0 records with a clear status message. For some nonsense or partial-word keywords, Walgreens' own search engine does fuzzy/substring matching and can surface loosely related products (e.g. a query containing "zzz" matching a brand named "Always ZZZ") instead of returning zero results — this is upstream search behavior, not something the actor filters or fabricates; every record returned is a real, live Walgreens product.

**Will `search` always return exactly `maxItems` results?**
Not necessarily. For broad or popular keywords, Walgreens' own deeper result pages increasingly re-surface products already seen on earlier pages, so the actor may return fewer unique records than `maxItems` once it has exhausted what the search genuinely offers as distinct results — narrow `searchQuery`, or add `brand`/`minPrice`/`maxPrice`, to reach a larger unique count.

**Does `byCategoryUrl` cover an entire large category in one run?**
It reads whatever product tiles Walgreens renders on that category page, including recommendation carousels; very large categories may not be fully covered in a single run. Use a narrower subcategory URL, or switch to `byProductIds` for exact coverage of a known product list.

**Does `couponAvailable` give me the actual coupon code?**
No — `couponAvailable` only tells you whether a coupon exists for that product, and `rebateText` reflects Walgreens' publicly shown savings banner. The coupon code and terms themselves require a signed-in Walgreens session and are out of scope.

**Is pharmacy/prescription or in-store aisle data included?**
No — those aren't part of Walgreens' public product data and are out of scope for this actor.

**Why does `curl`-ing the `url` field give me nothing useful?**
The `url` on each record is a correct, live walgreens.com product page that opens normally in any browser. Walgreens blocks plain non-browser requests to that page independent of this actor, which reaches the same product data a different way.

# Actor input Schema

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

What to fetch.

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

Free-text keyword search, e.g. `vitamin c`, `ibuprofen`, `sunscreen`.

## `categoryUrl` (type: `string`):

Full or relative Walgreens *product-listing* category URL (ends `-tier2...`/`-tier3`), e.g. `https://www.walgreens.com/store/c/vitamin-c/ID=361635-tier3`. Copy this from a specific category page on walgreens.com — not a top-level department page (`-tier1`), which lists subcategories rather than products.

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

Walgreens product IDs (e.g. `300405068`, `prod3511`) or full product page URLs.

## `storeId` (type: `integer`):

Walgreens store ID used for local price/availability lookups. Leave as default for a representative US store; change if you need a specific store's pricing.

## `minPrice` (type: `integer`):

Drop products priced below this.

## `maxPrice` (type: `integer`):

Drop products priced above this.

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

Only emit products currently in stock (online).

## `brand` (type: `string`):

Exact brand name to keep, e.g. `Nature Made`, `Walgreens`. Case-insensitive.

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

Only emit products with at least this average customer rating (0-5). Products without any reviews yet are kept.

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

Only emit products Walgreens is currently marking as on clearance or at a new lower price.

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

Hard cap on emitted records.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "vitamin c",
  "productIds": [],
  "storeId": 15196,
  "inStockOnly": false,
  "onSaleOnly": false,
  "maxItems": 30
}
```

# Actor output Schema

## `products` (type: `string`):

Dataset containing all scraped Walgreens products.

# 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": "search",
    "searchQuery": "vitamin c",
    "productIds": [],
    "storeId": 15196,
    "inStockOnly": false,
    "onSaleOnly": false,
    "maxItems": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlyth-forge/walgreens-product-price-and-stock-lookup-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": "search",
    "searchQuery": "vitamin c",
    "productIds": [],
    "storeId": 15196,
    "inStockOnly": False,
    "onSaleOnly": False,
    "maxItems": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlyth-forge/walgreens-product-price-and-stock-lookup-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 '{
  "mode": "search",
  "searchQuery": "vitamin c",
  "productIds": [],
  "storeId": 15196,
  "inStockOnly": false,
  "onSaleOnly": false,
  "maxItems": 30
}' |
apify call crawlyth-forge/walgreens-product-price-and-stock-lookup-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlyth-forge/walgreens-product-price-and-stock-lookup-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/RRAdbPCTvHO633fem/builds/AfTmscoEWy7ffeOIT/openapi.json
