# Instacart Storefront Price Scraper (`vexaloom-labs/instacart-storefront-price-scraper`) Actor

Scrape real-time grocery prices from Instacart storefronts. Search products by keyword, look up items by ID, or pull a retailer's store overview - no login, no API key.

- **URL**: https://apify.com/vexaloom-labs/instacart-storefront-price-scraper.md
- **Developed by:** [vexaloom-labs](https://apify.com/vexaloom-labs) (community)
- **Categories:** E-commerce, Automation, Developer tools
- **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

## Instacart Storefront Price Scraper

Scrape **real-time grocery prices from Instacart storefronts** — Costco, Safeway, Publix, Kroger, Walgreens, ALDI, Wegmans, and 20+ other Instacart-partnered retailers. Search any storefront by keyword, browse a department/aisle, look up specific products by item ID, or pull a retailer's store overview with trending items. No login, no API key, no cookies required.

### What this actor does

- **Five modes:** `search` (keyword → priced results), `browseAisle` (department/category browse), `listAisles` (discover a retailer's department/aisle taxonomy), `productDetail` (lookup by item ID), `storeOverview` (retailer info + trending items)
- **30 retailers** available via dropdown, plus a free-text override for any other Instacart-partnered retailer
- **Real prices** — current price, price-per-unit, pack/unit size, regular (pre-discount) price, discount %, and sort by price (low-to-high / high-to-low)
- **Deals & ratings** — surfaces sale badges/promo labels and public star ratings/review counts wherever Instacart shows them
- **Filters:** min/max price, brand name, in-stock only, on-sale only, min rating
- **Empty fields are omitted** from every record

### Output per product

- `itemId` — full Instacart item ID (e.g. `items_74-17444603`), reusable in `productDetail` mode
- `productId`, `legacyId` — Instacart's internal product identifiers
- `name`, `brandName`, `size`, `category`
- `priceString` (e.g. `$17.40`), `price` (numeric, e.g. `17.4`)
- `pricePerUnitString` (e.g. `$0.09/oz`), `pricingUnitString` (e.g. `3 x 64 oz`)
- `regularPriceString` / `regularPrice` — pre-discount price when the item is on sale (e.g. `$19.67`)
- `discountPercentString` (e.g. `30%`), `promoLabel` (e.g. `$6 off; limit 5`), `onSale` (boolean)
- `rating` (0–5) and `reviewCount` — when Instacart publicly shows a star rating for the item
- `imageUrl` — product photo
- `available`, `stockLevel`
- `dietaryAttributes[]` — e.g. `organic`, `lactose_free`, `gluten_free`
- `tags[]` — e.g. `storeBrand`
- `aisleSlug` — the aisle/collection slug the item was found in (mode=browseAisle only)
- `retailerSlug`, `retailerName`
- `productUrl` / `sourceUrl`
- `recordType: "product"`, `scrapedAt`

### Output per retailer (mode = `storeOverview`)

- `retailerId`, `retailerSlug`, `retailerName`, `retailerType`
- `categories[]` — e.g. `grocery`, `club`, `wholesale`
- `sourceUrl`
- `recordType: "retailer"`, `scrapedAt`

### Output per aisle/department (mode = `listAisles`)

- `aisleId`, `aisleName`, `aisleSlug` — pass `aisleSlug` into `mode=browseAisle` to fetch its products
- `collectionType` — e.g. `department`, `retailer_collection_v2`, `dynamic`
- `parentAisleId` / `parentAisleName` — present for sub-aisles nested under a department
- `childAisleCount` — number of sub-aisles under a top-level department
- `retailerSlug`, `retailerName`
- `sourceUrl`
- `recordType: "aisle"`, `scrapedAt`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `search` | `search` / `browseAisle` / `listAisles` / `productDetail` / `storeOverview` |
| `retailerSlug` | string | `costco` | Retailer to scrape (dropdown of 30 popular retailers) |
| `customRetailerSlug` | string | – | Any Instacart retailer slug not in the dropdown; overrides `retailerSlug` |
| `postalCode` | string | – | Optional 5-digit US ZIP code. Prices the storefront at that ZIP's shop/zone; empty uses Instacart's default location. |
| `searchQuery` | string | `milk` | Keyword to search (mode=search) |
| `orderBy` | string | `bestMatch` | `bestMatch` / `priceAsc` / `priceDesc` (mode=search, browseAisle) |
| `aisleSlug` | string | – | Department/aisle (collection) slug to browse (mode=browseAisle); discover slugs via `mode=listAisles` |
| `itemIds` | array | – | Full item IDs to look up (mode=productDetail) |
| `minPrice` | int | – | Drop items priced below this (USD) |
| `maxPrice` | int | – | Drop items priced above this (USD) |
| `brandContains` | string | – | Keep only items whose brand contains this text |
| `inStockOnly` | boolean | `false` | Drop out-of-stock items |
| `onSaleOnly` | boolean | `false` | Keep only items currently discounted from their regular price |
| `minRating` | number | – | Drop items with an average rating below this (0–5); items without a public rating are kept |
| `maxItems` | int | `20` | Hard cap on emitted records (1–1000) |
| `proxyConfiguration` | object | auto | Optional. Leave empty and the actor chooses a working connection automatically; a proxy is never required. |

#### Compatibility with saved tasks

Older saved tasks that still send the pre-rename keys keep working: `query`/`searchQueries` map to `searchQuery`, `retailer` to `retailerSlug`, `category`/`collection` to `aisleSlug`, `ids`/`productIds` to `itemIds`, `sort`/`sortBy` to `orderBy`, `maxResults`/`limit` to `maxItems`, `zip`/`zipCode`/`postal` to `postalCode`, and `inStock`/`onSale`/`brand` to the matching filters. Legacy keys are accepted silently and never override a value supplied under the current field name.

#### Example: search a retailer by keyword

```json
{
  "mode": "search",
  "retailerSlug": "costco",
  "searchQuery": "organic eggs",
  "orderBy": "priceAsc",
  "maxItems": 30
}
```

#### Example: filter by price and brand

```json
{
  "mode": "search",
  "retailerSlug": "safeway",
  "searchQuery": "paper towels",
  "minPrice": 5,
  "maxPrice": 25,
  "brandContains": "bounty",
  "inStockOnly": true
}
```

#### Example: look up specific products by ID

```json
{
  "mode": "productDetail",
  "retailerSlug": "costco",
  "itemIds": ["items_74-17444603", "items_74-19871524"]
}
```

#### Example: store overview for a retailer not in the dropdown

```json
{
  "mode": "storeOverview",
  "retailerSlug": "costco",
  "customRetailerSlug": "sprouts-farmers-market"
}
```

#### Example: discover a retailer's departments/aisles

```json
{
  "mode": "listAisles",
  "retailerSlug": "costco",
  "maxItems": 200
}
```

#### Example: browse a department/aisle for on-sale items

```json
{
  "mode": "browseAisle",
  "retailerSlug": "costco",
  "aisleSlug": "dynamic_collection-sales",
  "onSaleOnly": true,
  "orderBy": "priceAsc",
  "maxItems": 50
}
```

#### Example: highly-rated products in a specific aisle

```json
{
  "mode": "browseAisle",
  "retailerSlug": "safeway",
  "aisleSlug": "produce",
  "minRating": 4.5,
  "maxItems": 30
}
```

### Use cases

- **Price monitoring** — track grocery price changes across retailers over time
- **Market research** — compare pricing and product assortment between chains
- **Deal-hunting tools** — feed a price-comparison app or browser extension with `onSaleOnly` results
- **Retail analytics** — monitor stock availability and pricing trends by department/aisle
- **Coupon / cashback apps** — identify current prices and discount % to calculate savings
- **Category audits** — use `listAisles` + `browseAisle` to pull a full department's catalog

### FAQ

**Is this affiliated with Instacart?**
No — this is an independent, third-party actor that reads Instacart's public storefront pages. It is not affiliated with, endorsed by, or supported by Instacart.

**Do I need an Instacart account or login?**
No. All data comes from Instacart's public, unauthenticated storefront pages, the same pages any visitor sees when browsing without signing in.

**Do I need to configure a proxy?**
No. Leave `proxyConfiguration` empty and the actor picks a working connection automatically. Instacart rejects requests from many datacenter addresses, so the actor falls back to its own working route when the direct connection is blocked. You never have to supply proxy credentials.

**Why do prices show a specific location's pricing?**
Instacart prices are location-based. Set `postalCode` to price a specific US ZIP; leave it empty and Instacart resolves the guest session to its default location (usually ZIP 94105, San Francisco). The actor resolves that ZIP's shop and zone before scraping, so every mode uses the selected market.

**Can I choose a ZIP code or country?**
Yes for US ZIPs: set `postalCode` to a five-digit ZIP such as `10001`. A ZIP the selected retailer does not serve fails the run with a status message rather than returning another market's prices. Non-US postal codes and Canadian storefronts on `instacart.ca` are out of scope.

**Why doesn't a retailer I searched for show up in results?**
Only retailers that partner with Instacart are available. Use `customRetailerSlug` with the retailer's exact Instacart storefront slug (found in the URL `instacart.com/store/<slug>/storefront`) if it's not in the dropdown.

**How many results does `search` mode return?**
Instacart's search response contains the full best-match set for the query (including carousels that are only hydrated lazily on the live site). The actor resolves those stubs, so a common query returns dozens to several hundred matches; `maxItems` caps the final output.

**How deep can `browseAisle` go?**
Instacart returns a department/aisle's full item set to a storefront session in one placements response (the actor follows cursors when the API paginates). Large sale collections can contain several hundred products; `maxItems` accepts up to 1000 so you can pull the whole set.

**How fresh is the pricing data?**
Prices are fetched live at run time directly from Instacart's storefront.

**What does `productId` vs `legacyId` mean?**
Both are Instacart's own internal identifiers for the same product; some downstream Instacart surfaces reference one or the other, so both are included for convenience.

**Why do some `productDetail` lookups return an item without price fields?**
Instacart resolves each guest session to a default region/store. If an `itemId` was originally captured from a `search`/`storeOverview` run in a different region than the current run resolves to, Instacart may return the item's catalog details without live pricing for that ID. For guaranteed pricing, use `itemIds` captured from a `search` or `storeOverview` result in the same run, or re-run `search`/`storeOverview` first to get current-session item IDs.

**Why does `productUrl` return a 403 with a bare `curl` (no headers)?**
Instacart blocks requests with no User-Agent header at all. Any normal HTTP client (browsers, `requests`, `curl -A "Mozilla/5.0 ..."`) works fine — this is standard bot-mitigation, not a broken link.

**How do I find a valid `aisleSlug` for `browseAisle`?**
Run `mode=listAisles` first for your chosen retailer — it returns every department and sub-aisle slug Instacart exposes for that storefront (they differ per retailer). You can also copy a slug directly from a collection page URL: `instacart.com/store/<retailer>/collections/<slug>`.

**Do `rating` and `reviewCount` appear on every product?**
No — Instacart only shows a public star rating for products that have received enough reviews. When it's not shown on the storefront, the actor omits the field rather than guessing a value.

**What counts as "on sale" (`onSale` / `onSaleOnly`)?**
An item is marked `onSale: true` when Instacart's storefront shows a crossed-out regular price (`regularPriceString`) alongside the current price. Retailer-wide deals can be browsed directly via `mode=browseAisle` with `aisleSlug: "dynamic_collection-sales"`.

**Are there aisles/collections this actor can't browse?**
`browseAisle` covers every department and sub-aisle slug returned by `mode=listAisles` for a given retailer. Deeper, personalized, or login-gated collections (e.g. order history-based recommendations) aren't included since they require an authenticated account.

# Actor input Schema

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

What to fetch.

## `retailerSlug` (type: `string`):

Which Instacart-partnered retailer's storefront to scrape. Pick from the list, or use "Custom retailer slug" below to supply any Instacart retailer slug not in this list.

## `customRetailerSlug` (type: `string`):

Any Instacart retailer slug, e.g. `whole-foods-market` or `sprouts-farmers-market`. Find a retailer's slug in its Instacart storefront URL: instacart.com/store/<slug>/storefront. Leave empty to use the Retailer dropdown instead.

## `postalCode` (type: `string`):

Five-digit US ZIP code to price this retailer's storefront at, e.g. `10001`. Leave empty to use Instacart's default location for the session. The actor resolves the matching shop and zone before scraping; a ZIP this retailer does not serve fails the run instead of silently returning another market's prices.

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

Keyword to search for within the selected retailer's storefront, e.g. `milk`, `organic eggs`, `paper towels`. Results are filtered so every returned item's name/brand/category contains each significant word of your query (generic words like "organic" are ignored for this check). Note: this is a substring check, not full product understanding, so on rare occasions an item that happens to contain all your query words in an unrelated context (e.g. a "milk chocolate"-flavored candy matching a search for "almond milk") can still slip through.

## `orderBy` (type: `string`):

How to order results.

## `aisleSlug` (type: `string`):

Which department/aisle (a.k.a. "collection") to browse within the selected retailer, e.g. `9797-crackers`, `produce`, or `dynamic_collection-sales` (retailer-wide deals). Run `mode=listAisles` first to get the exact slugs available for your chosen Retailer, or copy one from an Instacart collection URL: instacart.com/store/<retailer>/collections/<slug>.

## `itemIds` (type: `array`):

Full Instacart item IDs to look up, e.g. `items_74-17444603` (copy from a `search`, `browseAisle`, or `storeOverview` result's `itemId` field). Must all belong to the same Retailer selected above.

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

Drop items priced below this amount (whole dollars).

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

Drop items priced above this amount (whole dollars).

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

Keep only items whose brand name contains this text (case-insensitive).

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

Drop items that are marked out of stock.

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

Keep only items currently discounted from their regular price (has a `regularPrice` higher than `price`).

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

Drop items with an average customer rating below this (out of 5). Items without a public rating are kept (unknown, not zero).

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

Hard cap on emitted records.

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

Optional. Leave empty to let the actor choose a working connection automatically (a proxy is never required). Set this only if you want to use your own proxy configuration.

## Actor input object example

```json
{
  "mode": "search",
  "retailerSlug": "costco",
  "searchQuery": "milk",
  "orderBy": "bestMatch",
  "aisleSlug": "9797-crackers",
  "itemIds": [
    "items_74-17444603"
  ],
  "inStockOnly": false,
  "onSaleOnly": false,
  "maxItems": 20
}
```

# Actor output Schema

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

Dataset containing all scraped Instacart products / store records.

# 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",
    "retailerSlug": "costco",
    "searchQuery": "milk",
    "orderBy": "bestMatch",
    "aisleSlug": "9797-crackers",
    "itemIds": [
        "items_74-17444603"
    ],
    "inStockOnly": false,
    "onSaleOnly": false,
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("vexaloom-labs/instacart-storefront-price-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",
    "retailerSlug": "costco",
    "searchQuery": "milk",
    "orderBy": "bestMatch",
    "aisleSlug": "9797-crackers",
    "itemIds": ["items_74-17444603"],
    "inStockOnly": False,
    "onSaleOnly": False,
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("vexaloom-labs/instacart-storefront-price-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",
  "retailerSlug": "costco",
  "searchQuery": "milk",
  "orderBy": "bestMatch",
  "aisleSlug": "9797-crackers",
  "itemIds": [
    "items_74-17444603"
  ],
  "inStockOnly": false,
  "onSaleOnly": false,
  "maxItems": 20
}' |
apify call vexaloom-labs/instacart-storefront-price-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vexaloom-labs/instacart-storefront-price-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/vXLIc64dhz3MO6Z2l/builds/PAkt2NHLxYZPkoCRa/openapi.json
