# Compare US Grocery Prices: Kroger, Costco, Safeway, ALDI by ZIP (`zaiq/grocery-price-compare`) Actor

US grocery prices by ZIP across 33 chains: Kroger, Ralphs, Fred Meyer, Costco, Safeway, ALDI, Meijer, CVS and more. One run takes many searches, chains and ZIPs: price, regular and card price, unit price, stock and link per product, plus a free comparison and price changes.

- **URL**: https://apify.com/zaiq/grocery-price-compare.md
- **Developed by:** [Zaiq](https://apify.com/zaiq) (community)
- **Categories:** E-commerce, Marketing
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 product prices

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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

## Compare US grocery prices by ZIP: Kroger, Costco, Safeway, ALDI and 29 more chains

Compare **US grocery prices across 33 chains by ZIP code**: **Kroger, Ralphs, Fred Meyer, King Soopers, Harris Teeter, Costco, Safeway, Albertsons, ALDI, Meijer, Food Lion, CVS, Walgreens** and more. Send arrays of search terms, ZIP codes and chains in one call and get every product price in one consistent schema, plus a free comparison record per search.

**Tested in Apify's cloud:** all 12 Kroger-family banners returned store prices at their home ZIP codes, and the six default chains returned 120 prices in 37 seconds. The 21 Instacart banners each returned real priced rows at their test ZIPs.

**Try the default input:** it checks six chains serving Chicago ZIP 60601 (Costco, ALDI, Jewel-Osco, Meijer, CVS, Walgreens). A cloud run returned **120 product rows and one free comparison** in **37 seconds**, costing **$0.18** in product events. Products found vary by ZIP and search.

**This compares search results, not a matched shopping basket.** The cheapest result for milk may be evaporated milk, a half-gallon, or a bulk pack. Products, sizes, brands, stock and price bases can differ. Only matching valid UPC/GTIN codes are treated as the same product. The comparison includes both chain-wide statistics across requested ZIPs and a breakdown per ZIP.

**Two price sources:** Kroger-family rows use the regular price for the selected store, with a conditional card offer in `loyaltyPrice`. Other banners use their Instacart shop prices, which may exceed in-store prices. Delivery fees, tips, taxes, memberships and basket discounts are excluded.

**Ready-to-run input:**

```json
{
  "searches": [
    "milk"
  ],
  "zipCodes": [
    "60601"
  ],
  "chains": [
    "costco",
    "aldi",
    "jewel-osco",
    "meijer",
    "cvs",
    "walgreens"
  ],
  "maxProductsPerChain": 20
}
```

### What you get

| Field | What it holds |
|---|---|
| Record type | `kind=product` is a paid product row. `kind=comparison` is a free record for one search term. Filter by kind before importing rows into a product table. |
| Chain and store | `chainId`, `chain`, `banner`, `source`, `storeId`, `storeName`, `storeCity`, `zipCode`, `fulfillment`. Physical name and city are null when the source does not publish them; they are never inferred from the ZIP. |
| Product | `productId`, `productName`, `brand`, `size`, `searchTerm`, `rank`, `image`, `productUrl`, `scrapedAt`, `resultId`. Rank follows the source response and can have gaps after unpriced rows are removed. |
| Prices | `price`, `regularPrice`, `onSale`, `loyaltyPrice`, `priceBasis`, `currency`, `unitPrice`, `unit`. All prices are numeric USD values. Source unit denominators are preserved, not converted into a common unit. |
| Availability and identity | `availability`, `inStock`, `upc`. Null means the source did not give a value. Instacart did not publish UPCs in these tests. Product IDs are never relabelled as UPCs. |
| Free price tracking | `previousPrice`, `priceChange`, `priceChangePercent`, `priceStatus`, `firstSeenAt`, `priceDropped`, `priceRose`, `newProduct`. These fields stay present and become null if tracking is off. |
| Free comparison | `productsCompared`, `byChain` with product count, cheapest and median prices, `byZip`, `cheapestProduct`, `upcMatches`, `partial`, `scope`, `comparisonNote`, `generatedAt`. Zero-count chains stay visible with their coverage status. |

### What people use it for

- **Price comparison apps:** collect multiple retailers in one call and display source, size, unit and availability beside each price. Keep UPC matches separate from broad search comparisons.
- **Brands checking shelf prices across retailers:** monitor published product, regular and sale prices across chains and ZIPs. Treat Instacart prices as that channel, and the source brand field as supplied rather than independently verified.
- **Analysts:** compare delivered search-result price distributions and retailer coverage, with explicit counts and per-ZIP statistics. This is a sample of search results, not a complete catalog or a market average.
- **AI agents that need grocery prices:** send arrays once, then read a consistent product schema and a free comparison record. Check status and partial before answering a price question.
- **Recurring price monitoring:** schedule the same inputs and inspect priceDropped, priceRose and newProduct against the previous completed history. The first run establishes a baseline.

### How to use it

1. Enter search terms and five-digit US ZIP codes as arrays. Use a brand and size, such as whole milk 1 gallon, for a tighter result set.
2. Select chains or keep the six defaults. Each selected chain is checked at every requested ZIP. Regional banners may have no shop there; the Actor records that and continues.
3. Set the cap per chain, search and ZIP and your maximum run cost. Run once, then filter kind=product for products or kind=comparison for the free summaries.
4. For monitoring, reuse the same tracking name and run one job at a time per history. Read SUMMARY for failed chains, unavailable ZIPs, requests and charges.

### Input

| Field | Example | Notes |
|---|---|---|
| searches | \["milk", "eggs"] | Required array; 1–20 terms, up to 120 characters each. No required field has a default. |
| zipCodes | \["60601", "94103"] | Required array; 1–10 five-digit US ZIP strings. Invalid ZIP formats cause no requests; unknown ZIPs return no products. |
| chains | \["costco", "aldi", "jewel-osco", "meijer", "cvs", "walgreens"] | Array of selected banner IDs. Each is checked against every ZIP and search. The six defaults are available at the example ZIP. |
| maxProductsPerChain | 20 | 1–500 products for each chain × search × ZIP. Kroger is limited by its public page to at most 24. This is a cap, not a promised row count. |
| trackPrices | true | Free tracking, enabled by default. A newProduct flag means new to this history, not a newly launched retail product. |
| trackingName | weekly-milk | Optional history name. Blank uses grocery-price-compare-price-history. Separate names keep independent baselines. |
| Selectable banners | Kroger, Ralphs, Fred Meyer, King Soopers, Harris Teeter, Fry's, Smith's, Dillons, QFC, Food 4 Less, Mariano's, Pick 'n Save, Costco, ALDI US, Safeway, Albertsons, Vons, Jewel-Osco, ACME Markets, Tom Thumb, Randalls, Pavilions, Haggen, Food Lion, Meijer, Sprouts, BJ's Wholesale, CVS, Walgreens, Dollar General, Dollar Tree, Family Dollar, Total Wine | 33 options: 12 Kroger-family banners and 21 chains on Instacart. |

### Output

Each result is one row in the run's dataset (download it as JSON, CSV, Excel, XML or HTML, or read it through the API). An example row (values shortened):

```json
[
  {
    "kind": "product",
    "chainId": "costco",
    "chain": "Costco",
    "banner": "Costco",
    "source": "instacart",
    "storeId": "111",
    "storeName": null,
    "storeCity": null,
    "zipCode": "60601",
    "searchTerm": "milk",
    "rank": 1,
    "productId": "16902650",
    "productName": "Kirkland Signature Whole Milk, 1 gal",
    "brand": "Kirkland Signature",
    "size": "each",
    "price": 3.21,
    "regularPrice": null,
    "onSale": false,
    "loyaltyPrice": null,
    "currency": "USD",
    "priceBasis": "instacart",
    "unitPrice": null,
    "unit": null,
    "availability": "Many in stock",
    "inStock": true,
    "upc": null,
    "image": "https://d2lnr5mha7bycj.cloudfront.net/product-image/file/large_82659b6f-4662-4758-97d0-e040a219357d.jpg",
    "productUrl": "https://www.instacart.com/store/costco/products/16902650-kirkland-signature-homogenized-milk-1-gal-4-qt",
    "fulfillment": "delivery",
    "scrapedAt": "2026-11-11T21:47:15Z",
    "previousPrice": null,
    "priceChange": null,
    "priceChangePercent": null,
    "priceStatus": "first-seen",
    "firstSeenAt": "2026-11-11T21:47:15Z",
    "priceDropped": false,
    "priceRose": false,
    "newProduct": true,
    "resultId": "d959e540847ee2aa407404a3cd5ec039e353d9096b83ff261fbc6928bc938abb"
  },
  {
    "kind": "product",
    "chainId": "aldi",
    "chain": "ALDI US",
    "banner": "ALDI US",
    "source": "instacart",
    "storeId": "570515",
    "storeName": null,
    "storeCity": null,
    "zipCode": "60601",
    "searchTerm": "milk",
    "rank": 1,
    "productId": "16902710",
    "productName": "Friendly Farms Whole Milk",
    "brand": "Friendly Farms",
    "size": "1 gal",
    "price": 2.68,
    "regularPrice": null,
    "onSale": false,
    "loyaltyPrice": null,
    "currency": "USD",
    "priceBasis": "instacart",
    "unitPrice": 0.02,
    "unit": "fl oz",
    "availability": "Many in stock",
    "inStock": true,
    "upc": null,
    "image": "https://d2lnr5mha7bycj.cloudfront.net/product-image/file/large_b4aaab37-66cf-46e3-9638-f37987fca803.jpg",
    "productUrl": "https://www.instacart.com/store/aldi/products/16902710-friendly-farms-vitamin-d-milk-1-gal",
    "fulfillment": "delivery",
    "scrapedAt": "2026-11-11T21:47:18Z",
    "previousPrice": null,
    "priceChange": null,
    "priceChangePercent": null,
    "priceStatus": "first-seen",
    "firstSeenAt": "2026-11-11T21:47:18Z",
    "priceDropped": false,
    "priceRose": false,
    "newProduct": true,
    "resultId": "1f7eab43e3c7536369ba74a80225d5cd6dbc34be8e2a1ab498e2de974c76d8e0"
  },
  {
    "kind": "product",
    "chainId": "meijer",
    "chain": "Meijer",
    "banner": "Meijer",
    "source": "instacart",
    "storeId": "92438",
    "storeName": null,
    "storeCity": null,
    "zipCode": "60601",
    "searchTerm": "milk",
    "rank": 1,
    "productId": "1343109",
    "productName": "fairlife Whole Ultra-Filtered Milk, Lactose Free",
    "brand": "Fairlife",
    "size": "52 fl oz",
    "price": 5.99,
    "regularPrice": null,
    "onSale": false,
    "loyaltyPrice": null,
    "currency": "USD",
    "priceBasis": "instacart",
    "unitPrice": 0.12,
    "unit": "fl oz",
    "availability": "Many in stock",
    "inStock": true,
    "upc": null,
    "image": "https://d2lnr5mha7bycj.cloudfront.net/product-image/file/large_0f23dfec-e1c6-44bc-b11f-2573074f938e.jpg",
    "productUrl": "https://www.instacart.com/store/meijer/products/1343109-fairlife-whole-ultrafiltered-milk-lactose-free-52-fl-oz",
    "fulfillment": "delivery",
    "scrapedAt": "2026-11-11T21:47:28Z",
    "previousPrice": null,
    "priceChange": null,
    "priceChangePercent": null,
    "priceStatus": "first-seen",
    "firstSeenAt": "2026-11-11T21:47:28Z",
    "priceDropped": false,
    "priceRose": false,
    "newProduct": true,
    "resultId": "6c7f4da57a197753d522683f087e3bf5a49600fc81130536ff2f9ea8492da3e6"
  }
]
```

The product examples above are unchanged real rows from a real default run; null values are intentional. The dataset also contains the following real, free comparison record. `SUMMARY` reports each chain and ZIP, failure reasons, request counts, transfer bytes, price tracking and charges. `COMPARISONS` in the key-value store holds the comparison records alone.

```json
{
  "kind": "comparison",
  "resultId": "1f93d0d4ff7505d87804d5fe08a4416cb2a73278da81173d6c21415c8ef4591b",
  "searchTerm": "milk",
  "zipCodes": [
    "60601"
  ],
  "currency": "USD",
  "productsCompared": 120,
  "scope": "delivered search results across requested ZIP codes",
  "partial": false,
  "byChain": [
    {
      "chainId": "costco",
      "chain": "Costco",
      "count": 20,
      "cheapestPrice": 2.98,
      "medianPrice": 16.09,
      "status": "ok",
      "reason": null,
      "byZip": [
        {
          "zipCode": "60601",
          "count": 20,
          "cheapestPrice": 2.98,
          "medianPrice": 16.09
        }
      ]
    },
    {
      "chainId": "aldi",
      "chain": "ALDI US",
      "count": 20,
      "cheapestPrice": 0.95,
      "medianPrice": 2.92,
      "status": "ok",
      "reason": null,
      "byZip": [
        {
          "zipCode": "60601",
          "count": 20,
          "cheapestPrice": 0.95,
          "medianPrice": 2.92
        }
      ]
    },
    {
      "chainId": "jewel-osco",
      "chain": "Jewel-Osco",
      "count": 20,
      "cheapestPrice": 2.99,
      "medianPrice": 4.94,
      "status": "ok",
      "reason": null,
      "byZip": [
        {
          "zipCode": "60601",
          "count": 20,
          "cheapestPrice": 2.99,
          "medianPrice": 4.94
        }
      ]
    },
    {
      "chainId": "meijer",
      "chain": "Meijer",
      "count": 20,
      "cheapestPrice": 1.99,
      "medianPrice": 4.99,
      "status": "ok",
      "reason": null,
      "byZip": [
        {
          "zipCode": "60601",
          "count": 20,
          "cheapestPrice": 1.99,
          "medianPrice": 4.99
        }
      ]
    },
    {
      "chainId": "cvs",
      "chain": "CVS",
      "count": 20,
      "cheapestPrice": 2.49,
      "medianPrice": 4.09,
      "status": "ok",
      "reason": null,
      "byZip": [
        {
          "zipCode": "60601",
          "count": 20,
          "cheapestPrice": 2.49,
          "medianPrice": 4.09
        }
      ]
    },
    {
      "chainId": "walgreens",
      "chain": "Walgreens",
      "count": 20,
      "cheapestPrice": 2.49,
      "medianPrice": 5.14,
      "status": "ok",
      "reason": null,
      "byZip": [
        {
          "zipCode": "60601",
          "count": 20,
          "cheapestPrice": 2.49,
          "medianPrice": 5.14
        }
      ]
    }
  ],
  "cheapestProduct": {
    "resultId": "7b8d36446f1a485b4a49f43208b460a6ab74a704226f5a5940054f989c86646c",
    "chainId": "aldi",
    "chain": "ALDI US",
    "zipCode": "60601",
    "productName": "ALDI Evaporated Milk",
    "size": "12 oz",
    "price": 0.95,
    "productUrl": "https://www.instacart.com/store/aldi/products/18647623-baker-s-corner-vitamin-d-added-12-fl-oz"
  },
  "upcMatches": [],
  "comparisonNote": "Search results can differ in brand, size, stock and price basis. Only matching valid UPC/GTIN values identify the same product; fees and memberships are excluded.",
  "generatedAt": "2026-11-11T21:47:37Z"
}
```

### Pricing

- **Price: $0.0015 per delivered product row ($1.50 per 1,000; $1.35 on Silver, $1.20 on Gold and higher plans).** One primary product event; no start, search or comparison fee.
- Comparison records, price tracking and requests with no delivered priced products are free. Refused chains are not charged for failed requests; delivered rows from successful chains still cost the product event price.
- One product returned for two search terms or two ZIPs creates two contextual rows and two events. Stable result IDs prevent charging the same context twice after an interrupted run resumes.

What typical jobs cost at the list price:

| Job | Cost |
|---|---|
| Default input: 120 products and one free comparison | $0.18 |
| One search × 3 ZIPs × 3 chains × 20 delivered products | $0.27 for 180 rows |
| Daily monitoring of 200 delivered rows for 30 days | $9 for 6,000 rows |

Set Maximum cost per run in Apify. The Actor checks whether a whole product event fits before doing more work, stops cleanly at the limit and still writes free comparison records. A capped comparison summarizes only rows actually delivered and has partial=true. Prices above are proposals pending publisher review.

### Tips

- Compare sizes and units before interpreting a low price. A 12-ounce can and a gallon jug can both match milk.
- Use the per-ZIP breakdown for local comparisons. The top-level per-chain median pools rows across all requested ZIPs, so the same physical store can contribute once for each requested ZIP.
- Check priceBasis, fulfillment and loyaltyPrice when mixing Kroger regular prices with Instacart channel prices. Availability is the source signal, not a reserved inventory count.
- Read coverage status before treating an empty chain as expensive or out of stock. It may not serve the ZIP, may have refused the request or may not have run before the spending limit.
- Keep one scheduled run at a time per tracking history. Changing the search cap or source ranking changes the search-result sample and its median even if individual prices do not move.

### Use it through the API

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("zaiq/grocery-price-compare").call(run_input={"searches": ["milk"], "zipCodes": ["60601"], "chains": ["costco", "aldi", "jewel-osco", "meijer", "cvs", "walgreens"], "maxProductsPerChain": 20})
for row in client.dataset(run.default_dataset_id).iterate_items():
    print(row)
```

**JavaScript**

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('zaiq/grocery-price-compare').call({"searches": ["milk"], "zipCodes": ["60601"], "chains": ["costco", "aldi", "jewel-osco", "meijer", "cvs", "walgreens"], "maxProductsPerChain": 20});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

**HTTP (one call, results back)**

```bash
curl -X POST 'https://api.apify.com/v2/acts/zaiq~grocery-price-compare/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"searches": ["milk"], "zipCodes": ["60601"], "chains": ["costco", "aldi", "jewel-osco", "meijer", "cvs", "walgreens"], "maxProductsPerChain": 20}'
```

### Integrations and schedules

- **Schedules:** run it every hour, day or week from the Apify Console (Schedules) and keep a history of results.
- **Make, Zapier, n8n, Google Sheets, Slack, Airtable:** connect it through Apify's integrations, or send each finished run to a **webhook**.
- **Datasets:** results stay in the run's dataset; export them or read them by API whenever you need them.

### Use it with AI agents (MCP)

Add Apify's MCP server with this Actor already pinned (`https://mcp.apify.com?tools=zaiq/grocery-price-compare`) to Claude, ChatGPT, Cursor, VS Code or any MCP client. The agent can find this Actor and run it for you: ask it for "Compare milk and eggs at Costco, ALDI and Safeway for ZIP codes 60601 and 94103. Return search-result statistics and identify any missing chains.". AI agents can also pay for runs directly through Apify's agentic payments.

### Limits

- Only public signed-out data is read: no login, no account. A chain whose site asks for a login or refuses stops for that run and the summary says why; the other chains continue.
- Kroger-family prices are the chosen store's regular price, with the card price in `loyaltyPrice`. Nearby stores that cannot be read are skipped for the next nearest store of the same banner.
- Instacart prices may be above store shelf prices; Costco Same-Day prices may differ from warehouse prices. Taxes, delivery fees, tips, club memberships, coupons and complete checkout totals are not compared.
- A search-result minimum or median is not a matched basket, a unit-normalized comparison or the cheapest product in the entire retailer catalog. It depends on the search words, ranking, cap and requested ZIPs. Out-of-stock rows may still have prices and remain in the comparison.
- Only exact valid UPC/GTIN values identify shared products. No cross-chain UPC matches appeared in the real tests because the successful Instacart responses omitted UPCs. Equal names, images or product IDs do not establish a match.
- Instacart shop responses did not publish physical store name or city, so those fields are null. Brand and size labels are preserved even when a bulk pack is labelled each or the brand field differs from the product title.
- The Actor chooses one shop per chain and ZIP, preferring delivery on Instacart. When another fulfillment type is used, the row names it. Kroger verifies the returned store ID before emitting prices.
- Chains run one after another, so a run with many chains and ZIP codes takes longer: about 6 seconds per chain and ZIP for one search. SUMMARY shows what each chain returned.
- The source search response bounds the result set. Kroger exposes at most 24 items per search; Instacart commonly supplies fewer than the requested cap. Whole-catalog completeness is not offered.
- Website changes and regional coverage can change results; read each run's SUMMARY. Tracking keeps at most 60,000 recently seen products in a named key-value store in your account.

### FAQ

**Does the cheapest result mean the same product is cheaper?**

No. The minimum compares delivered search-result prices, including different brands and pack sizes. Only entries in upcMatches carry a matching checksum-valid UPC/GTIN across chains.

**Why did one chain return nothing?**

It may not serve that ZIP or may have no priced search results. A failed chain carries a reason in SUMMARY and byChain; an unavailable shop is recorded against its ZIP. No priced rows means no product events for that chain.

**How are prices tracked?**

The Actor compares each chain, physical store ID, ZIP, fulfillment and product against its previous completed history, then saves only delivered rows. Search terms do not create separate baselines for the same product context. Tracking problems leave price fields null and put a note in SUMMARY.

**What does newProduct mean?**

The product had no priced baseline in this tracking list. It does not mean it is new to the market, and a changed store or fulfillment starts another context.

**Can I export only products?**

Yes. Filter kind=product when reading the dataset. Free kind=comparison records have a separate documented shape, and COMPARISONS in the key-value store contains those records alone.

**Do I need retailer accounts?**

No. The Actor uses public signed-out storefront data and stops at login requirements. It does not accept retailer credentials.

**Are these prices final checkout costs?**

No. They are published product prices for the source store or Instacart shop. Membership conditions, fees, taxes, discounts and fulfillment affect the final amount.

### Support

Questions, a site that changed, or a field you need? Open an issue on this Actor's **Issues** tab: we answer there, usually within a day.

***

Also found as: US grocery price comparison, grocery prices by ZIP code, supermarket price comparison, Kroger prices, Costco grocery prices, Safeway prices, ALDI US prices, multi-chain grocery scraper, grocery price API for AI agents, grocery price monitoring.

# Actor input Schema

## `searches` (type: `array`):

Type grocery searches such as milk, eggs or oat milk, one per line. Use specific names and sizes for a tighter comparison. Up to 20 searches.

## `zipCodes` (type: `array`):

Type five-digit US ZIP codes, one per line, such as 60601. Each chain uses the nearby store or shop serving that ZIP. Unavailable chains are reported. Up to 10 ZIPs.

## `chains` (type: `array`):

Select one or more chains. Every selected chain is checked for every ZIP and search. Kroger banners use store websites; other banners use Instacart. Regional chains may not serve your ZIP.

## `maxProductsPerChain` (type: `integer`):

Type the most product rows to return per chain for each search at each ZIP. Default 20, maximum 500. Kroger pages expose at most 24. Only delivered rows are charged.

## `trackPrices` (type: `boolean`):

Leave on to compare prices with your last run for the same chain, store, ZIP and fulfillment. Adds priceDropped, priceRose and newProduct at no extra charge.

## `trackingName` (type: `string`):

Type a short name such as weekly-milk to keep a separate price history. Leave blank for the default history. Run one job at a time per history.

## Actor input object example

```json
{
  "searches": [
    "milk"
  ],
  "zipCodes": [
    "60601"
  ],
  "chains": [
    "costco",
    "aldi",
    "jewel-osco",
    "meijer",
    "cvs",
    "walgreens"
  ],
  "maxProductsPerChain": 20,
  "trackPrices": true
}
```

# Actor output Schema

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

Dataset: the results.

## `summary` (type: `string`):

What each input returned, and notes.

# 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 = {
    "searches": [
        "milk"
    ],
    "zipCodes": [
        "60601"
    ],
    "chains": [
        "costco",
        "aldi",
        "jewel-osco",
        "meijer",
        "cvs",
        "walgreens"
    ],
    "maxProductsPerChain": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("zaiq/grocery-price-compare").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 = {
    "searches": ["milk"],
    "zipCodes": ["60601"],
    "chains": [
        "costco",
        "aldi",
        "jewel-osco",
        "meijer",
        "cvs",
        "walgreens",
    ],
    "maxProductsPerChain": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("zaiq/grocery-price-compare").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 '{
  "searches": [
    "milk"
  ],
  "zipCodes": [
    "60601"
  ],
  "chains": [
    "costco",
    "aldi",
    "jewel-osco",
    "meijer",
    "cvs",
    "walgreens"
  ],
  "maxProductsPerChain": 20
}' |
apify call zaiq/grocery-price-compare --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zaiq/grocery-price-compare"
        }
    }
}
```

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/f4CpYb1FWvWGRIeZP/builds/CeZZuacZjEo4t57zh/openapi.json
