# Tesco Groceries Scraper (`crawloop/tesco-scraper`) Actor

Scrape Tesco UK grocery search and category pages. Export price, unit price, Clubcard offers, GTIN, brand, rating, and category. HTTP, no browser.

- **URL**: https://apify.com/crawloop/tesco-scraper.md
- **Developed by:** [Andrej Kiva](https://apify.com/crawloop) (community)
- **Categories:** E-commerce, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

## Tesco Groceries Scraper

Tesco UK grocery prices, unit prices, Clubcard offers, and GTIN from search and category pages. Independent tool, not affiliated with Tesco.

Pull a search or a category listing when you need shelf price, unit price, a Clubcard flag, barcode, brand, and rating in one row. Paste keywords or listing URLs. Each dataset row is one product. This is a Tesco scraper and a Tesco API alternative for Python, Node.js, and MCP.

| UK grocery search | US weekly ad | EU leaflets | US grocery |
| :--- | :--- | :--- | :--- |
| Tesco Groceries Scraper ◄── you are here | [Aldi Weekly Ad Scraper](https://apify.com/crawloop/aldi-weekly-ad-scraper) | [Lidl Weekly Offers Scraper](https://apify.com/crawloop/lidl-weekly-offers-scraper) | [Walmart Scraper](https://apify.com/crawloop/walmart-scraper) |

### When to use

- Snapshot Tesco UK shelf prices for a keyword or a category
- Flag Clubcard promotions next to the regular shelf price
- Match products by GTIN, brand, and category path

Use a grocery circular Actor when you need a weekly ad rather than the live Tesco shelf.

### Key features

- Search keywords and category or search URLs
- Price, unit price, currency, stock flag
- Clubcard promotion text and a Clubcard boolean
- GTIN, brand, rating, review count
- Department path: super department, department, aisle, shelf
- Competitor price-match names when the listing includes them
- HTTP fetch, 256 MB, no browser

### Input

| Field | Required | Description |
| :--- | :--- | :--- |
| `queries` | One of `queries` or `startUrls` | Search terms such as `milk` |
| `startUrls` | One of `queries` or `startUrls` | Tesco UK search or category URLs |
| `maxItems` | No | Stop after this many products. Default 24, maximum 1000 |
| `maxPages` | No | Pages per keyword or URL. Default 1. About 24 products per page |
| `clubcardOnly` | No | Keep only rows with a Clubcard promotion |

#### Input example

```json
{
  "queries": ["oat milk"],
  "maxItems": 24,
  "maxPages": 1
}
```

### Output

| Field | Description |
| :--- | :--- |
| `title` | Product name |
| `brand` | Brand |
| `price` | Shelf price |
| `unitPrice` | Price per unit |
| `unitOfMeasure` | Unit, such as litre or kg |
| `currency` | GBP |
| `clubcardOffer` | True when a Clubcard promotion is present |
| `promotionText` | Promotion description |
| `gtin` | Barcode when the listing includes one |
| `inStock` | Available for sale |
| `rating` | Average rating |
| `reviewCount` | Number of reviews |
| `priceMatch` | Competitor names marked as a price match |
| `productUrl` | Product page URL |
| `superDepartment`, `department`, `aisle`, `shelf` | Category path |

#### Output example

```json
{
  "source": "tesco.com",
  "productId": "252207537",
  "title": "Tesco British Semi Skimmed Milk 1.13L, 2 Pints",
  "brand": "TESCO",
  "gtin": "05000436338826",
  "price": 1.2,
  "unitPrice": 1.06,
  "unitOfMeasure": "litre",
  "currency": "GBP",
  "inStock": true,
  "clubcardOffer": false,
  "promotionText": null,
  "priceMatch": ["ALDI"],
  "rating": 4.3,
  "reviewCount": 286,
  "superDepartment": "Drinks",
  "department": "Milk & Milkshakes",
  "aisle": "Milk",
  "shelf": "Semi-Skimmed Milk",
  "productUrl": "https://www.tesco.com/shop/en-GB/products/252207537",
  "query": "milk"
}
```

### Use cases

- **Price check** — export shelf and unit price for one keyword
- **Clubcard watch** — turn on `clubcardOnly` and keep the promotion text
- **Catalog match** — join GTIN and brand to another grocery file

### Integration examples

Replace `APIFY_TOKEN` with your Apify token. The Actor name is `crawloop/tesco-scraper`.

#### Node.js

```javascript
import { ApifyClient } from "apify-client";

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor("crawloop/tesco-scraper").call({
  queries: ["oat milk"],
  maxItems: 24,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("crawloop/tesco-scraper").call(run_input={
    "queries": ["oat milk"],
    "maxItems": 24,
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

#### cURL

```bash
curl "https://api.apify.com/v2/acts/crawloop~tesco-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"queries\":[\"oat milk\"],\"maxItems\":24}"
```

### MCP and AI assistants

Use this Actor from AI tools via [Apify MCP](https://docs.apify.com/platform/integrations/mcp). Connect your Apify account, then call this Actor by its Store name.

Example prompts:

- "Run Tesco Groceries Scraper for oat milk and return title, price, unit price, and GTIN as JSON"
- "Scrape Tesco search for cheddar with clubcardOnly and list the promotion text"
- "Pull 24 Tesco milk rows, then run Aldi Weekly Ad Scraper for ZIP 60174 and compare milk prices"

### Suite next step

After Tesco UK shelf prices, run [Aldi Weekly Ad Scraper](https://apify.com/crawloop/aldi-weekly-ad-scraper) for a US weekly circular, or [Walmart Scraper](https://apify.com/crawloop/walmart-scraper) for ZIP-local US grocery prices.

### Related Actors

- Tesco Groceries Scraper ◄── you are here
- [Aldi Weekly Ad Scraper](https://apify.com/crawloop/aldi-weekly-ad-scraper) — ALDI US weekly ad and ALDI Finds
- [Lidl Weekly Offers Scraper](https://apify.com/crawloop/lidl-weekly-offers-scraper) — Lidl weekly leaflets
- [Walmart Scraper](https://apify.com/crawloop/walmart-scraper) — ZIP-local Walmart prices
- [DoorDash Menu Scraper](https://apify.com/crawloop/doordash-menu-scraper) — chain menu items

### FAQ

**Does this open a single product page for nutrition and ingredients?**\
No. It reads the search and category listing: price, unit price, Clubcard text, GTIN, brand, rating, and category path.

**What if the keyword matches nothing?**\
The run finishes with an empty dataset. Other keywords in the same input still run.

**How many products are on a page?**\
About 24. Raise `maxPages` when you need more than one page. `maxItems` caps the combined rows.

# Actor input Schema

## `queries` (type: `array`):

Shopper search terms, for example milk or oat milk. Each keyword is paginated until maxItems or maxPages.

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

Tesco UK search or category page URLs. Product URLs are fetched as a single row when the page contains that product.

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

Stop after this many products across all keywords and URLs.

## `maxPages` (type: `integer`):

Listing pages to open for each keyword or URL. A page holds about 24 products.

## `clubcardOnly` (type: `boolean`):

Keep products that show a Clubcard price or Clubcard promotion.

## Actor input object example

```json
{
  "queries": [
    "milk"
  ],
  "startUrls": [
    {
      "url": "https://www.tesco.com/groceries/en-GB/search?query=oat+milk"
    }
  ],
  "maxItems": 24,
  "maxPages": 1,
  "clubcardOnly": false
}
```

# Actor output Schema

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

Default dataset items.

# 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 = {
    "queries": [
        "milk"
    ],
    "startUrls": [
        {
            "url": "https://www.tesco.com/groceries/en-GB/search?query=oat+milk"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawloop/tesco-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 = {
    "queries": ["milk"],
    "startUrls": [{ "url": "https://www.tesco.com/groceries/en-GB/search?query=oat+milk" }],
}

# Run the Actor and wait for it to finish
run = client.actor("crawloop/tesco-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 '{
  "queries": [
    "milk"
  ],
  "startUrls": [
    {
      "url": "https://www.tesco.com/groceries/en-GB/search?query=oat+milk"
    }
  ]
}' |
apify call crawloop/tesco-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawloop/tesco-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/8h1qhUQAmFxfq00pG/builds/EHfx3IgRhqrtWDuB6/openapi.json
