# Shoprite Scraper: South Africa Grocery Prices & Promotions (`hexagone-data/shoprite-scraper`) Actor

Scrape shoprite.co.za categories: price in ZAR, every promotion including Xtra Savings card prices, price per kg, stock, brand, barcodes, ingredients and product info. Pay per result.

- **URL**: https://apify.com/hexagone-data/shoprite-scraper.md
- **Developed by:** [Hexagone Data](https://apify.com/hexagone-data) (community)
- **Categories:** E-commerce, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.05 / 1,000 products

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

## Shoprite Scraper — South African Grocery Prices & Promotions

Collect product information from **shoprite.co.za** (Shoprite, Africa's largest supermarket chain). Paste department category URLs and get every product of the category, with prices in South African rand, **every promotion** (including Xtra Savings card prices), stock, ingredients and product information — one record per product, paginated to the end of the list.

Use dated exports to track an assortment or monitor promotions over time.

### Try it with 20 products

1. Paste a category URL into **Start URLs**.
2. Set **Maximum number of products** to `20`.
3. Start the Actor and open its dataset.
4. Read **Run summary** before exporting JSON, CSV or Excel: a successful process can still contain incomplete URLs or check warnings.

For the Apify API, a valid input for the steps above is:

```json
{
  "startUrls": [{"url": "https://www.shoprite.co.za/department/food-cupboard/breakfast-cereals-porridge-and-pap-2-67075db7ff98781136400739"}],
  "maxItems": 20
}
```

The form's product-count prefill is 20, while the schema default is 500. Set `maxItems` explicitly in API calls; `0` removes the product-count limit. Categories hold a handful to a few hundred products: start small.

### What to paste

| Input | Data | Notes |
|---|---|---|
| Category `https://www.shoprite.co.za/department/food-cupboard/breakfast-cereals-porridge-and-pap-2-67075db7ff98781136400739` | Every product of the category, up to 1000 in one request | The category id is the 24-character hexadecimal code at the end of the URL. |
| Sub-category `https://www.shoprite.co.za/department/milk-dairy-and-eggs/cheese/everyday-and-speciality-cheese-3-67075e31ff987811364007b5` | The sub-category only | Sub-categories have their own URL and can be pasted too. |

You can paste several categories; they are scraped one after the other and deduplicated within the run (by `articleNumber` + `unitOfMeasure`). Anything else — the home page, a department root without category, search pages, product pages, another domain, URLs with parameters — is rejected with a reason and never blocks the other URLs.

**Categories with more than 1000 products:** the Actor requests 1000 products per page, which covers a whole category in one call for every category measured so far (the largest measured department category held 445). If a category ever announces more than 1000 products, the run is honest about what it could not see: the URL is marked `partial_collection` with a count of missing products, and you should paste its sub-categories for full coverage — the catalogue reorders itself between requests, so piling up requests on the same huge category does not guarantee anything.

### Prices are the site's default-store prices

The Actor browses like a signed-out visitor, and the site then applies its own default store — at the time of writing **Shoprite Jabulani** (Soweto), id `65cb65a1f88f400671ab9c79`. These are **not** the prices of a store you chose, and they are not a national average: compare exports only with that context in mind. Every record carries the `storeId` its price comes from, and the run summary names the dominant store of the run: on 25 October 2026, 8 of 1029 measured products came from a different store than the dominant one.

### Weighed products: `price` is per kilogram

For products sold by weight (`unitOfMeasure: "KG"`, e.g. boerewors or sliced short rib), **`price` is the price PER KILOGRAM** and `priceUnit` is `"kg"` — the product page shows it as "R124.99 per kilogram". The page's big headline price for such products is only the site's estimate of the heaviest pack (price/kg × maximum weight). `weightRange` carries the pack weight range in grams, as numbers (`{"min": 300, "max": 500}`; a decimal weight such as 100.5 g would be kept exactly, never rounded) and `displayName` is the name exactly as the page displays it, with the weight range in place of "Per KG" ("Sliced Short Rib Beef (300g - 500g)"). For everything else (`EA`, `PK1`, `PK2`), `priceUnit` is null and `price` is the shelf price of one item or pack.

### Promotions and the Xtra Savings card

`promotions` lists **every** offer the catalogue attaches to the product (most have none; some have up to three). Each offer carries its text (`name`), its kind, its dates and who it is reserved to:

- `requiresLoyaltyCard: true` means the offer is reserved to **Xtra Savings card holders** ("Available to xtra savings members only", `memberType: "fox_members"`). The product page then shows this card price as the main price — "SAVE R15 / R59.99" with a "Deal expires" date — **without saying that a card is required**. `price` stays the normal non-member price; do not read the page's main price as the public price for these.
- `discountType` says what `discountValue` means: `"fixed_discount"` — `discountValue` is the final price ("Now R59.99"); `"amount"` — it is the saving in rand ("Save R2"); `"other"` — a multi-buy formula ("Buy 2 For R40"), `discountValue` is 0 and **no unit price can be calculated from it**.
- The page displays only **one** of a product's several offers (its choice rule is unknown; measured 25 October 2026: one product with "Buy 2 For R40" and "Buy 2 For R35" showed only "R40"; Stork, carrying "Buy 2 For R100" and a card-only "Now R47.99", displayed only "BUY 2 FOR R100" — the card price was not on the page at all). The Actor delivers the complete list so you can decide.

`isOnPromotion` is the API's raw flag with an unclear meaning (13 of 1029 measured products had it true with no offer attached): treat `promotions` as the reliable source.

### Stock is catalogue-only

`inStock` comes from the catalogue API. The product page shows **no out-of-stock text at all** (measured on rendered pages): an unavailable product looks normal on the page, so rely on `inStock`, not on the page.

### Product information

`description`, `boxContent` ("What's in the box") and `attributes` (ingredients, allergens, nutritional information, halaal status…) come from the catalogue with HTML stripped, matching the page's display. Only real tags are removed — a tag starts with `<` followed by a letter, `/`, `!` or `?` — and tags are removed **before** entities are decoded, so nutritional "lower than" values keep their sign exactly as the page shows them ("Protein: <0.3g"), whether the catalogue encodes it (`&lt;`) or sends it raw ("Energy: <1kJ", both measured in the catalogue). `barcodes` (usually EAN-13) and `brand` are filled on every product measured so far.

### Honest coverage

A category that stops before the total the site announces (empty page in mid-pagination, shrinking announcement, a page served twice under correct numbering) is delivered but reported as `partial_collection` with a counted gap ("stopped early: 38 of 58 announced products seen (20 missing)") — never as a clean success. The run summary (OUTPUT record and the readable `SUMMARY` page) lists the status of every pasted URL, rejected URLs included, and the automatic checks warn when something unusual appears.

**A wrong category id answers exactly like an empty category** — the site returns an empty product list for both, so the Actor cannot tell them apart. An empty category is reported `no_products` with the reason "the category is empty or its id is wrong"; if not a single pasted URL yields any product, the run **fails** with that same explicit message (an all-empty run is almost always a mis-pasted id, and you should see it without opening the dataset).

Two other per-URL statuses tell you when something other than an empty category happened:

- `unexpected_response` — the site answered HTTP 200 with something that is not a product listing (an HTML control page, an error JSON): the site refused or changed, this is not about your URL. The run summary shows it per URL, with the automatic check `ANO_TYPE_PAGE_INCONNU`.
- a URL can also end `partial_collection` (stopped before the announced total) or `stopped_at_limit` (cut by your `maxItems` or charge limit) — see Run summary below.

**Fields with an unexpected type are counted, never delivered broken.** If the catalogue sends a field with a type the output schema does not allow (a numeric brand, a text date…), the field is set to `null` and counted in the run output's `neutralizedFields` (with the `ANO_CHAMPS_NEUTRALISES` check warning); the product itself is still delivered. A product whose identity (article number, unit, name) is unreadable is skipped entirely and counted in `skippedProducts`. The Actor never fetches more than what the site's catalogue API serves to a normal browser session.

### Output

One record per product. A value the site does not give is `null`, never an invented `0`, `false` or empty text.

| Field | Meaning |
|---|---|
| `articleNumber`, `unitOfMeasure` | Shoprite article number (text) and the unit it is sold in (`EA`, `PK1`/`PK2`, `KG`): together they identify a product. `productId` is the catalogue id (null if the catalogue gives none). |
| `name`, `displayName` | Catalogue name, and the name as the product page displays it (for weighed products the page shows the weight range instead of "Per KG"). |
| `url` | The product's official page URL — the address a browser ends up on (measured on 114 product pages). |
| `brand`, `barcodes` | Brand as filed in the catalogue; barcodes (usually EAN-13). |
| `price`, `priceUnit`, `currency` | Normal non-member price in rand (`currency` is always `ZAR`); **per kilogram when `priceUnit` is `"kg"`**. |
| `weightRange` | `{"min": …, "max": …}` in grams for weighed products (numbers: whole grams as published, a decimal kept exactly), else null. |
| `inStock` | Stock flag from the catalogue (the page shows none, see above). |
| `promotions`, `promotionCount` | Every offer: `name` (its text), `discountType`, `discountValue`, `memberType`, `requiresLoyaltyCard` (Xtra Savings card), `startDate`/`endDate` (milliseconds since 1970, UTC). `[]` when there is none. |
| `isOnPromotion` | The catalogue's raw flag — use `promotions` instead (see above). |
| `storeId` | Store whose prices the record carries (the site's default store). |
| `description`, `attributes`, `boxContent` | Product information as the page shows it (ingredients, allergens, nutritional information…), HTML stripped. |
| `position`, `page`, `sourceUrl`, `scrapedAt` | Where and when the product was collected. |

#### Real output example

A record delivered by build 0.1.4 (run `oKR4bdomF2hhKLTpx`, collected on **28 October 2026**), unchanged. It shows the format, not today's price.

```json
{
  "productId": "664f5b7e037d28c7eb4f2b45",
  "articleNumber": "10173871",
  "unitOfMeasure": "EA",
  "url": "https://www.shoprite.co.za/product/ritebrand-light-meat-shredded-tuna-in-vegetable-oil-170g-10173871EA",
  "name": "Ritebrand Light Meat Shredded Tuna in Vegetable Oil 170g",
  "displayName": "Ritebrand Light Meat Shredded Tuna in Vegetable Oil 170g",
  "brand": "Ritebrand",
  "barcodes": ["6001001395076", "6001001428736"],
  "price": 21.99,
  "priceUnit": null,
  "weightRange": null,
  "currency": "ZAR",
  "inStock": true,
  "isOnPromotion": false,
  "promotionCount": 1,
  "promotions": [
    {
      "name": "Buy 2 For R35",
      "discountType": "other",
      "discountValue": 0,
      "memberType": "fox_members",
      "requiresLoyaltyCard": true,
      "startDate": 1787436000000,
      "endDate": 1794175199000
    }
  ],
  "storeId": "65cb65a1f88f400671ab9c79",
  "description": "Ritebrand Light Meat Shredded Tuna in Vegetable Oil offers a convenient and tasty addition to meals. ...",
  "attributes": {
    "Allergens": "Contains soya and fish.",
    "Ingredients": "Skipjack Tuna (Katsuwonus Pelamis) (70%), Vegetable Oil (Soybean), Water, Salt.",
    "Serving Size": "55g"
  },
  "boxContent": "1 x 170g Ritebrand Light Meat Shredded Tuna in Vegetable Oil",
  "position": 9,
  "page": 1,
  "sourceUrl": "https://www.shoprite.co.za/department/food-cupboard/cans-tins-and-jars-2-67075dbaff9878113640073d",
  "scrapedAt": "2026-10-28T12:47:12+00:00"
}
```

(`description` and `attributes` are shortened here with "..." and fewer keys; the dataset carries them in full.) Here `price` 21.99 is what every visitor pays, while "Buy 2 For R35" is reserved to Xtra Savings members (`requiresLoyaltyCard: true`).

### Run summary

Open **Run summary** (the `SUMMARY` record; `OUTPUT` holds the same as JSON). For each pasted URL it shows a status and its counts:

- `done`: the category was read to its end and its products delivered.
- `stopped_at_limit`: your `maxItems` or maximum charge was reached first.
- `partial_collection`: products may be missing (stopped before the announced total); the gap is counted.
- `no_products`: the category is empty or its id is wrong (indistinguishable, see above); if no URL delivers anything, the run fails.
- `unexpected_response`: the site answered something that is not a product list.
- rejected URLs are listed with the reason, and never block the other URLs.

### Pricing

**$1.50 per 1,000 delivered products** plus a **$0.005 start fee per run** — **$0.035 for 20 products**, **$1.505 for 1,000**. You are charged per product delivered to the dataset (products skipped or not delivered are not charged) and once per run at start (once per GB of memory; the default is 1 GB). Apify subscribers pay less automatically, on both events: 10% off on the Bronze plan, 20% on Silver, 30% on Gold and above. Set `maxItems` or a maximum charge for your run: both stop the collection and the charges.

### Known limits

- **Default store only**: prices are those of the store the site applies to a signed-out visitor; no store can be chosen.
- **Categories only**: product pages, search and the home page are rejected as start URLs.
- The product page displays only one of a product's offers; `promotions` lists all of them as the catalogue files them.
- Categories above 1,000 products have not been met so far; the run summary reports any coverage gap.

### Support

For a reproducible problem, open an issue with the category URL, the run ID and the expected result. Never include API tokens. Retailer changes can affect collection: check the run summary before using the results.

Shoprite is a trademark of its owner. This Actor is not affiliated with, endorsed by or sponsored by Shoprite or the Shoprite Group.

# Actor input Schema

## `startUrls` (type: `array`):

shoprite.co.za department category pages to scrape, e.g. https://www.shoprite.co.za/department/food-cupboard/breakfast-cereals-porridge-and-pap-2-67075db7ff98781136400739 (the category id is the 24-character hexadecimal code at the end). Sub-categories have their own URL and can be pasted too. Other pages (home, department root, search, product) are rejected with a reason.

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

Stops after this many unique products across all start URLs. 0 = no limit. A category holds a handful to a few hundred products: start small.

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

Not needed by default. Only enable it if your runs get blocked.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.shoprite.co.za/department/food-cupboard/breakfast-cereals-porridge-and-pap-2-67075db7ff98781136400739"
    }
  ],
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `records` (type: `string`):

All product records, one per unique product: records are deduplicated by articleNumber+unitOfMeasure across all start URLs, so a product listed in several pasted categories is delivered once.

## `prices` (type: `string`):

Price view: unique products with price, weight range, stock and the complete offer list (Xtra Savings card offers flagged).

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

Readable per-URL summary: status, products delivered and announced, coverage, reason for any URL that returned nothing.

## `summaryJson` (type: `string`):

The same summary as JSON (OUTPUT record), for programmatic use.

# 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 = {
    "startUrls": [
        {
            "url": "https://www.shoprite.co.za/department/food-cupboard/breakfast-cereals-porridge-and-pap-2-67075db7ff98781136400739"
        }
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("hexagone-data/shoprite-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 = {
    "startUrls": [{ "url": "https://www.shoprite.co.za/department/food-cupboard/breakfast-cereals-porridge-and-pap-2-67075db7ff98781136400739" }],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("hexagone-data/shoprite-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 '{
  "startUrls": [
    {
      "url": "https://www.shoprite.co.za/department/food-cupboard/breakfast-cereals-porridge-and-pap-2-67075db7ff98781136400739"
    }
  ],
  "maxItems": 20
}' |
apify call hexagone-data/shoprite-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hexagone-data/shoprite-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/Jysah3yRU0yhvQ3vN/builds/d5uNF1XZAwrR1UdbI/openapi.json
