# Sainsbury's Scraper — UK Groceries Full Catalogue & Prices (`studio-amba/sainsburys-scraper`) Actor

Scrape the full Sainsbury's UK groceries catalogue: 30,000+ products with prices, Nectar offers, EAN codes, unit prices, ratings and images. Walks the category tree for guaranteed completeness. No login, no cookies.

- **URL**: https://apify.com/studio-amba/sainsburys-scraper.md
- **Developed by:** [Studio Amba](https://apify.com/studio-amba) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 result scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Sainsbury's Scraper

Scrape the full Sainsbury's UK groceries catalogue — product names, prices, Nectar offers, EAN codes, unit prices, ratings and images — straight from the official Sainsbury's Groceries Online API.

### Why use this actor?

Sainsbury's is one of the "big four" UK supermarkets with 30,000+ products online. If you track grocery prices, build a price-comparison feed, monitor competitors, or feed a retail-analytics pipeline, this actor gives you the whole catalogue as clean structured JSON. It walks the full category tree rather than guessing at keywords, so you get guaranteed coverage — not just whatever a search box returns. No cookies, no login, no browser automation.

### What you get

- **Full catalogue coverage** — walks all 18 top-level departments (with automatic drill-down if a category is too large), so nothing is silently missed.
- **Accurate prices** — current retail price plus the was-price and Nectar-member offer price when a promotion is active.
- **Real identifiers** — Sainsbury's `product_uid` and EAN barcodes, so you can join against other datasets.
- **Deduplicated** — products live in multiple categories; results are deduped by product ID.
- **Certifiable completeness** — the actor reads the API's authoritative per-category record counts, so a full run can be reconciled against Sainsbury's own totals.

### How to scrape Sainsbury's data

1. Add the actor to your Apify account.
2. Set your **Bright Data Web Unlocker** API key (input field `brightDataApiKey`, or the `BRIGHT_DATA_API_KEY` environment variable). This is required — Sainsbury's protects the whole site, including its JSON API, with Akamai Bot Manager, and Bright Data handles the unblocking server-side.
3. Choose a mode:
   - **Full catalogue** — leave `searchQuery` and `categoryId` empty and set `maxProducts` to `0`. The actor fetches the category taxonomy and walks every department.
   - **Single category** — set `categoryId` to a numeric Sainsbury's category ID.
   - **Keyword search** — set `searchQuery` (e.g. `milk`, `coffee`, `wine`).
4. Run it. Results stream into the dataset and can be exported as JSON, CSV, Excel, or pushed to your own API.

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `searchQuery` | String | No | Search products by keyword. Leave empty to walk the catalogue by category. |
| `categoryId` | String | No | Restrict to one Sainsbury's category ID. Ignored when `searchQuery` is set. |
| `maxProducts` | Integer | No | Max unique products. `0` = the full catalogue (default 20). |
| `brightDataApiKey` | String | Yes | Bright Data Web Unlocker key (or `BRIGHT_DATA_API_KEY` env var). |
| `proxyConfiguration` | Object | No | Kept for compatibility; unblocking is done by Bright Data. |

### Output

Each result is a flat JSON object:

| Field | Type | Example |
|-------|------|---------|
| `name` | String | `"Sainsbury's British Semi Skimmed Milk 2.27L (4 pint)"` |
| `brand` | String | `"Sainsbury's"` |
| `price` | Number | `1.75` |
| `currency` | String | `"GBP"` |
| `originalPrice` | Number | `9.00` |
| `pricePerUnit` | String | `"£0.77/ltr"` |
| `discount` | String | `"Nectar: Buy 1 for 7.5"` |
| `nectarPrice` | Number | `7.50` |
| `ean` | String | `"0000000357937"` |
| `productId` | String | `"357937"` |
| `inStock` | Boolean | `true` |
| `rating` | Number | `4.6` |
| `reviewCount` | Number | `1989` |
| `category` | String | `"Fresh milk"` |
| `imageUrl` | String | Full image URL |
| `url` | String | Full product page URL |
| `scrapedAt` | String | ISO 8601 timestamp |

### Example output

```json
{
    "name": "Sainsbury's British Semi Skimmed Milk 2.27L (4 pint)",
    "brand": "Sainsbury's",
    "price": 1.75,
    "currency": "GBP",
    "pricePerUnit": "£0.77/ltr",
    "ean": "0000000357937",
    "productId": "357937",
    "inStock": true,
    "rating": 4.6,
    "reviewCount": 1989,
    "category": "Fresh milk",
    "imageUrl": "https://assets.sainsburys-groceries.co.uk/gol/357937/image.jpg",
    "url": "https://www.sainsburys.co.uk/gol-ui/product/sainsburys-british-semi-skimmed-milk-2-27l-4-pint",
    "scrapedAt": "2026-07-03T12:00:00.000Z"
}
```

### How it works

Sainsbury's Groceries Online is a client-side app that reads from a JSON API at `/groceries-api/gol-services/product/v1/product`. Akamai Bot Manager guards the whole domain, including that API, so plain HTTP is blocked. This actor routes every request through the Bright Data Web Unlocker, which solves the Akamai challenge server-side and returns the raw JSON. It first pulls the category taxonomy, then browses each category page by page (60 products per request), reading the API's own record counts to know when a category is complete. Products are deduplicated by their Sainsbury's product ID.

### Cost estimate

A full-catalogue run is roughly **650 Bright Data requests** (about 38,000 rows before dedup, ~30,000 unique products at 60 products per request). Keyword and single-category runs are far smaller. Because pricing scales with Bright Data usage, this actor runs on a premium per-result tier.

### Limitations

- Requires a Bright Data Web Unlocker key — Sainsbury's Akamai protection can't be bypassed reliably any other way.
- `brand` is a best-effort value derived from the product name (Sainsbury's does not expose a clean brand field on the listing API).
- Nutrition, ingredients and full image galleries live on a separate per-product endpoint and are not included in the catalogue crawl.
- Data is scraped from the public website and may change without notice. Respect Sainsbury's terms of service and use responsibly.

### Need this data on a schedule, or a custom version?

We run this scraper as a managed service for businesses: scheduled runs,
deduplication, delta detection, and delivery to your inbox, Google Sheets,
or API — maintenance included. We can also build a custom version with your
exact fields and filters, or combine multiple sources into one feed.

See [studioamba.dev/services](https://studioamba.dev/services/) or email
<hello@studioamba.dev> for a free data sample.
We maintain 300+ European web scrapers and answer within one business day.

# Actor input Schema

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

Search products by keyword (e.g. 'milk', 'coffee', 'wine'). Leave empty to walk the full catalogue by category instead.

## `categoryId` (type: `string`):

Restrict the crawl to a single Sainsbury's category ID (numeric, from the category taxonomy). Leave empty to walk all top-level departments. Ignored when a Search Query is set.

## `maxProducts` (type: `integer`):

Maximum number of unique products to return. Set to 0 for the full catalogue (30,000+ products).

## `brightDataApiKey` (type: `string`):

Bright Data Web Unlocker API key, used to bypass Sainsbury's Akamai anti-bot. Falls back to the BRIGHT\_DATA\_API\_KEY environment variable if left blank.

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

Proxy settings. Sainsbury's unblocking is handled by Bright Data Web Unlocker, so this is optional. GB residential is prefilled for QA compatibility.

## Actor input object example

```json
{
  "searchQuery": "milk",
  "maxProducts": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "GB"
  }
}
```

# 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 = {
    "searchQuery": "milk",
    "maxProducts": 20,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "GB"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("studio-amba/sainsburys-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 = {
    "searchQuery": "milk",
    "maxProducts": 20,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "GB",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("studio-amba/sainsburys-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 '{
  "searchQuery": "milk",
  "maxProducts": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "GB"
  }
}' |
apify call studio-amba/sainsburys-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/F3VDWDNndr2fVJsza/builds/BVQ2imuRLkcNN53dA/openapi.json
