# Tesco Scraper \[$1.50/1K💰] | Clubcard Prices | Groceries (`ahmed_jasarevic/tesco-scraper`) Actor

Scrape Tesco UK & Ireland grocery products via Tesco's own public JSON/GraphQL APIs (no browser). Name, brand, pack size, EAN/barcode, shelf price, Clubcard price, multibuy promos, unit price, rating, availability, category path. Pay-per-event.

- **URL**: https://apify.com/ahmed_jasarevic/tesco-scraper.md
- **Developed by:** [Ahmed Jasarevic](https://apify.com/ahmed_jasarevic) (community)
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 results

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 Scraper

Scrape Tesco UK & Ireland grocery products - prices, Clubcard offers, multibuy promotions, unit prices, barcodes, ratings, stock status and category paths - as clean, structured JSON. Built for CPG brands, UK grocery price monitoring / MAP teams and inflation-tracking researchers who need a reliable Tesco data source without an official price api.

No browser and no DOM scraping: the actor talks directly to the same public JSON/GraphQL endpoints Tesco's own web frontend calls (search + product GraphQL), so runs are fast, cheap and return clean structured records. 256 MB memory, plain HTTP.

### Main Use Cases

- **UK supermarket price monitoring** - track shelf prices, Clubcard prices and unit prices across categories over time
- **MAP and pricing compliance** - compare reseller prices against Tesco national online prices
- **Grocery inflation tracking** - historical price and promotion data for CPI-adjacent analysis
- **CPG and brand analytics** - pack sizes, EAN/barcodes, ratings and review counts per product
- **Price comparison and retail research** - Tesco UK (GBP) vs Ireland (EUR) storefronts in one schema

### How It Works - The Bypass (No Browser, No DOM Scraping)

Tesco's storefront (`www.tesco.com`) sits behind an **Akamai WAF** that returns `403 Access Denied` to plain HTTP requests. This actor instead talks directly to the **same public JSON/GraphQL endpoints Tesco's own web frontend calls**, which live on separate subdomains and are **not** behind that WAF:

1. **Search** - `GET https://search.api.tesco.com/search?distchannel=ghs&query=<term>&count=10&offset=<n>&geo=uk` returns product IDs (`tpnb`/`tpnc`) plus totals and offset pagination.
2. **Product details** - `POST https://xapi.tesco.com/` (GraphQL) with batched `GetProductByTpnb` / `GetProductByTpnc` operations (max 10 per request) returns the full product: title, brand, GTIN/EAN, price, unit price, promotions, review stats, pack size and the department/aisle/shelf hierarchy.

Both endpoints require **no cookies and no login**. The only credential is a **public API key embedded in Tesco's own frontend JavaScript**, sent as the `x-apikey` header. The key is not in the source code or input schema - it is provided as the `TESCO_API_KEY` Actor secret (or env var locally).

**Why this approach:** dramatically cheaper and faster than a browser (no Chrome, 256 MB memory), returns clean structured JSON, and sidesteps the storefront WAF entirely. A browser would only be needed if these endpoints disappeared.

#### Clubcard Price Parsing

Tesco encodes the Clubcard price inside the promotion description text, e.g. `"GBP 18.50 Save 25% Clubcard Price"` -> `clubcardPrice: 18.5`. Multibuy-style Clubcard offers (`"Any 2 for GBP 4 Clubcard Price"`) are **not** a straight per-unit price, so they are surfaced in `multibuy` and `clubcardPrice` stays `null`.

#### Measured Performance (verified)

The GraphQL API rate-limits to roughly 15-25 products per ~5 s window (it answers HTTP 200 with a per-item `429 Too many requests` error). Lookups run through a **3-worker parallel pool that re-queues throttled IDs**, so runs stay fast (~6 products/s) without dropping items.

### Input Parameters

| Field | Type | Required | Default | Notes |
| --- | --- | --- | --- | --- |
| `searchTerms` | array | No | `["olive oil", "semi skimmed milk"]` | Keywords to search the Tesco UK/Ireland grocery catalogue for |
| `startUrls` | array | No | `[]` | Tesco product pages (`/groceries/en-GB/products/...`), search pages (`?query=...`) or category pages; scraped in addition to search terms |
| `maxItems` | integer | No | 50 | Maximum number of products to collect across all inputs (free users capped at 10) |
| `country` | string | No | `uk` | Storefront/currency: `uk` (GBP) or `ie` (EUR) |
| `proxy` | object | No | off | Standard Apify proxy configuration (not required - the API endpoints are not WAF-protected) |

### Output Fields

One dataset row per product (full field list in the dataset schema):

- **Identity**: `url`, `productId` (TPNC), `tpnb`, `tpnc`, `gtin`/`ean` (barcode), `name`, `brand`, `packSize`
- **Pricing**: `price` (shelf), `currency` (GBP/EUR), `clubcardPrice` (straight price cuts only), `clubcardPriceText` (raw promo), `multibuy` (e.g. "Any 2 for GBP 4 Clubcard Price"), `promotionText` / `promotions` (raw promo objects), `unitPrice` / `unitOfMeasure` / `unitPriceText` (e.g. "GBP 0.73/litre")
- **Reputation & stock**: `rating`, `reviewCount`, `inStock`, `availability` (`InStock`/`OutOfStock`)
- **Category**: `department`, `aisle`, `shelf`, `categoryPath` (e.g. "Milk, Butter & Eggs > Milk > Semi-Skimmed Milk")
- **Metadata**: `image`, `country`, `searchTerm`, `scrapedAt`

### Example Input And Output

#### Example Input

```json
{
  "searchTerms": ["olive oil", "semi skimmed milk"],
  "startUrls": [{ "url": "https://www.tesco.com/groceries/en-GB/products/254656543" }],
  "maxItems": 100,
  "country": "uk"
}
```

#### Example Output

```json
{
  "url": "https://www.tesco.com/groceries/en-GB/products/254656543",
  "productId": "254656543",
  "tpnb": "54550994",
  "gtin": "05000436589457",
  "ean": "05000436589457",
  "name": "Tesco British Semi Skimmed Milk 2.272L, 4 Pints",
  "brand": "TESCO",
  "packSize": "2.272L",
  "price": 1.65,
  "currency": "GBP",
  "clubcardPrice": null,
  "multibuy": null,
  "unitPrice": 0.73,
  "unitOfMeasure": "litre",
  "unitPriceText": "GBP 0.73/litre",
  "rating": 4,
  "reviewCount": 704,
  "inStock": true,
  "availability": "InStock",
  "categoryPath": "Milk, Butter & Eggs > Milk > Semi-Skimmed Milk",
  "image": "https://digitalcontent.api.tesco.com/v2/media/ghs/....jpeg",
  "country": "uk",
  "searchTerm": "semi skimmed milk",
  "scrapedAt": "2026-10-10T09:20:00.000Z"
}
```

### Integrations & Automation

- **Apify API** - run via `POST https://api.apify.com/v2/acts/{actorId}/runs`, export via `GET /v2/datasets/{datasetId}/items?clean=true&format=json`
- **Schedules** - Apify Schedules for **daily price monitoring** (recommended for MAP and inflation tracking; recurring usage also improves Store recommendation signals)
- **Webhooks** - price-change events into downstream monitoring dashboards
- **Zapier / Make** - via the Apify integration (e.g. price drops to Google Sheets/Slack)
- **Pay-per-event** - $1.50 per 1,000 products, no subscription, free 10-item preview

### Related Actors

- [tesco-scraper](https://apify.com/radeance/tesco-scraper): the most-used Tesco actor on the Store (higher per-1K price), a reference point for the cluster.
- [tesco-product-scraper](https://apify.com/sian.agency/tesco-product-scraper): adds nutrition/ingredients and allergens detail at higher pricing.
- [tesco-products-scraper](https://apify.com/shahidirfan/tesco-products-scraper): another Tesco product scraper, for comparison.
- [mediamarkt-scraper](https://apify.com/ahmed_jasarevic/mediamarkt-scraper): EU retail product prices to broaden a European price dataset.
- [woolworths-scraper](https://apify.com/ahmed_jasarevic/woolworths-scraper): grocery price monitoring on another supermarket chain.

### FAQ

#### Is there an official Tesco API?

No public, official API exists for the grocery catalogue. This actor uses Tesco's own **frontend JSON/GraphQL endpoints** (`search.api.tesco.com` search + `xapi.tesco.com` GraphQL) with the public API key embedded in Tesco's JavaScript. The storefront WAF is avoided entirely because these API subdomains are not behind it.

#### How do I scrape Tesco prices without a browser?

Enter `searchTerms` (and optionally `startUrls`) and run. Searches page by offset (10 results/page) up to `maxItems`; product details are batched through GraphQL (max 10 products per request) with a 3-worker pool that handles the API's ~15-25 products/5 s rate limit automatically.

#### How do I track Clubcard prices?

`clubcardPrice` is parsed from straight price-cut promos (e.g. "Save 25% Clubcard Price"). Multibuy Clubcard offers ("Any 2 for GBP 4 Clubcard Price") are not a straight per-unit price, so they appear in `multibuy` while `clubcardPrice` stays `null`. Schedule a daily run to track both over time.

#### Does this work for Tesco Ireland?

Yes - set `country: "ie"` (EUR). Prices are national online prices for that storefront; store-level/regional pricing is not exposed by these endpoints.

#### What are the alternatives for UK grocery price data?

Store alternatives: radeance/tesco-scraper ($2.5 per 1K), sian.agency/tesco-product-scraper ($3-8.7 per 1K, adds nutrition/allergens), shahidirfan/tesco-products-scraper and powerai/tesco-products-scraper. This actor is the verified cheapest at $1.50 per 1,000 products on the same core fields.

#### How much does a run cost, and what if the key rotates?

$1.50 per 1,000 products (free 10-item preview). The public API key may rotate; if requests start returning `403 Forbidden: Invalid Client`, update the `TESCO_API_KEY` Actor secret. Category URLs are resolved best-effort (Tesco's facet IDs are not exposed by the search API).

### SEO Keywords

tesco scraper, tesco price scraper, tesco api, tesco grocery data, uk supermarket price monitoring, tesco clubcard price, clubcard price tracking, price monitoring uk, grocery price comparison, tesco product data, supermarket data api, grocery inflation data, ean barcode grocery data, uk food prices dataset, tesco ireland scraper, unit price data, cpg price monitoring, multibuy promotion data, retail price tracking, tesco product api

### For AI Agents & LLM Apps

- **Purpose**: returns one JSON row per Tesco UK/Ireland grocery product (name, brand, pack size, EAN/GTIN, shelf price, Clubcard price, multibuy, unit price, rating, availability, category path, image).
- **Minimal working input**:

```json
{ "searchTerms": ["olive oil"], "maxItems": 10, "country": "uk" }
```

- **Output field names**: `url, productId, tpnb, tpnc, gtin, ean, name, brand, packSize, price, currency, clubcardPrice, clubcardPriceText, multibuy, promotionText, promotions, unitPrice, unitOfMeasure, unitPriceText, rating, reviewCount, inStock, availability, department, aisle, shelf, categoryPath, image, country, searchTerm, scrapedAt`.
- **Behaviors an agent should know**:
  - `searchTerms` and `startUrls` are additive - start URLs are scraped **in addition to** search terms, and `maxItems` caps the combined total.
  - `clubcardPrice` is only populated for straight price cuts; multibuy Clubcard offers land in `multibuy` and leave `clubcardPrice` `null` - do not treat `null` as "no price available" when `multibuy` is set.
  - `gtin` and `ean` are aliases of the same barcode value.
  - Cost-relevant default: `maxItems` defaults to 50 (free tier 10); billing is a flat $0.0015 per dataset row regardless of how many API requests a product took.
  - `country` switches currency (GBP vs EUR) and storefront; prices are national online prices only, never store-level.
  - The actor may throttle internally under GraphQL rate limits (3-worker pool re-queues) - a run can take longer but does not drop items.
- **Billing**: pay-per-event - $0.0015 per product row, $0.00005 per run start. No proxy required.

### Legal & Compliance Disclaimer

This actor is an independent tool and is not affiliated with, endorsed by, or sponsored by Tesco plc or Tesco Ireland. It accesses only publicly available catalogue data via Tesco's own public frontend JSON/GraphQL endpoints; it does not bypass login, authentication or paywalls, and does not solve CAPTCHAs.

Users are responsible for complying with Tesco's terms of service and applicable data-protection law. Prices and product data are public by design, but respect the site's terms and robots.txt, and use the data for lawful analysis, monitoring and research purposes.

# Actor input Schema

## `searchTerms` (type: `array`):

Keywords to search the Tesco UK/Ireland grocery catalogue for (e.g. "olive oil", "milk").

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

Tesco product pages (https://www.tesco.com/groceries/en-GB/products/...), search pages (?query=...) or category pages. Scraped in addition to the search terms.

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

Maximum number of products to collect across all inputs.

## `country` (type: `string`):

Tesco storefront / currency to use.

## `proxy` (type: `object`):

Select proxies to be used by your crawler.

## Actor input object example

```json
{
  "searchTerms": [
    "olive oil",
    "semi skimmed milk"
  ],
  "startUrls": [],
  "maxItems": 50,
  "country": "uk",
  "proxy": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

# 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 = {
    "searchTerms": [
        "olive oil",
        "semi skimmed milk"
    ],
    "startUrls": [],
    "proxy": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ahmed_jasarevic/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 = {
    "searchTerms": [
        "olive oil",
        "semi skimmed milk",
    ],
    "startUrls": [],
    "proxy": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("ahmed_jasarevic/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 '{
  "searchTerms": [
    "olive oil",
    "semi skimmed milk"
  ],
  "startUrls": [],
  "proxy": {
    "useApifyProxy": false
  }
}' |
apify call ahmed_jasarevic/tesco-scraper --silent --output-dataset

```

## MCP server setup

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