# Tesco Scraper - UK & IE (`thenetaji/tesco-scraper`) Actor

Use our scraper to get Tesco data at lightening speed.

- **URL**: https://apify.com/thenetaji/tesco-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** E-commerce, Automation, Developer tools
- **Stats:** 43 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

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

## Tesco Grocery Scraper

Scrape product data from **Tesco UK** and **Tesco Ireland** at scale.

Extracts full product details including price, promotions, nutrition, allergens, ingredients, competitor price matching, and reviews — from product URLs, category listings, or keyword searches.

### Features

- **Product scraping** — full details via Tesco's GraphQL API (fast, no browser)
- **Category listings** — paginated scraping of any browse/category URL
- **Keyword search** — search Tesco by keyword, get paginated results
- **Category slugs** — use short slugs like `fresh-food` without full URLs
- **Standalone reviews** — scrape all reviews for a product with `{id}/reviews`
- **UK + Ireland** — supports both `tesco.com` and `tesco.ie`
- **Proxy rotation** — uses Apify residential proxies, retries on block (429/403)
- **Auto URL migration** — old `/groceries/en-GB/` URLs are handled automatically

### Input

The `inputs` field accepts a mixed list of any of the following:

| Type | Example |
|------|---------|
| Product URL | `https://www.tesco.com/shop/en-GB/products/254656543` |
| Category URL | `https://www.tesco.com/shop/en-GB/browse/fresh-food/all` |
| Search URL | `https://www.tesco.com/shop/en-GB/search?query=milk` |
| Keyword | `milk` |
| Category slug | `fresh-food` or `fresh-food/milk-butter-and-eggs` |
| Bare product ID | `254656543` |
| Reviews | `303837409/reviews` |
| Ireland URL | `https://www.tesco.ie/shop/en-GB/products/254656543` |

#### Input schema

```json
{
  "inputs": [
    "https://www.tesco.com/shop/en-GB/products/254656543",
    "milk",
    "fresh-food",
    "303837409/reviews"
  ],
  "region": "UK",
  "maxItems": 100,
  "maxPages": 5,
  "includeReviews": false
}
```

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `inputs` | `string[]` | required | Mixed list of URLs, keywords, slugs, or `{id}/reviews` |
| `region` | `"UK"` | `"IE"` | `"UK"` | Tesco region (auto-detected from URL if provided) |
| `maxItems` | `integer` | `100` | Max products per search/category input |
| `maxPages` | `integer` | `5` | Max listing pages to crawl per input |
| `includeReviews` | `boolean` | `false` | Include up to 10 reviews per product |

### Output

Each item in the dataset has `_type: "product"` or `_type: "review"`.

#### Product

```json
{
  "_type": "product",
  "product_id": "254656543",
  "base_product_id": "76543210",
  "sku": "254656543",
  "gtin": "05000169137858",
  "brand_name": "TESCO",
  "name": "Tesco British Semi Skimmed Milk 2.272L, 4 Pints",
  "description": null,
  "url": "https://www.tesco.com/shop/en-GB/products/254656543",
  "image_url": "https://digitalcontent.api.tesco.com/v2/media/...",
  "price": 1.65,
  "currency": "GBP",
  "unit_price": 0.73,
  "unit": "litre",
  "in_stock": true,
  "is_new": false,
  "buy_limit": 99,
  "buy_limit_message": "Max allowed is 99.",
  "sale_type": "SingleProduct",
  "isLowEverydayPricing": true,
  "isLowPricePromise": false,
  "price_matches_competitor": true,
  "competitors": [{"id": "ALDI", "priceMatch": {"isMatching": true}}],
  "promotion": null,
  "main_category": "Fresh Food",
  "sub_category": "Milk, Butter & Eggs",
  "product_category": "Milk",
  "product_type": "Semi Skimmed Milk",
  "ingredients": null,
  "allergens": "Milk",
  "storage_instructions": ["Keep refrigerated. Best before see cap."],
  "nutrition": {"Energy": "195kJ (46kcal)", "Fat": "1.7g"},
  "nutrition_per_serving": null,
  "netContents": "2.272 litres ℮",
  "features": [],
  "healthClaims": null,
  "nutritionalClaims": null,
  "recyclingInfo": "Bottle. Recycle\nCap. Recycle",
  "warnings": [],
  "marketing_text": [],
  "manufacturer": "Tesco Stores Ltd, Welwyn Garden City, AL7 1GA",
  "total_reviews": 42,
  "overall_rating": 4.5,
  "reviews": null
}
```

#### Review (from `{id}/reviews` input)

```json
{
  "_type": "review",
  "product_id": "303837409",
  "review_id": "trn:tesco:ugc:rnr:uuid:...",
  "posted_at": "2025-02-16T16:47:59.219Z",
  "verified_buyer": true,
  "promotional_review": false,
  "rating": 5,
  "title": "Best Treats!",
  "text": "My dog absolutely loves these bacon treats..."
}
```

### Examples

#### Scrape a single product

```json
{
  "inputs": ["https://www.tesco.com/shop/en-GB/products/254656543"]
}
```

#### Keyword search with reviews

```json
{
  "inputs": ["organic milk", "free range eggs"],
  "maxItems": 50,
  "includeReviews": true
}
```

#### Category listing

```json
{
  "inputs": ["fresh-food/milk-butter-and-eggs/milk"],
  "maxItems": 200,
  "maxPages": 5
}
```

#### Mixed inputs in one run

```json
{
  "inputs": [
    "https://www.tesco.com/shop/en-GB/products/254656543",
    "https://www.tesco.com/shop/en-GB/browse/bakery/all",
    "protein bars",
    "303837409/reviews"
  ],
  "region": "UK",
  "maxItems": 100,
  "maxPages": 3
}
```

#### Tesco Ireland

```json
{
  "inputs": ["https://www.tesco.ie/shop/en-GB/products/254656543"],
  "region": "IE"
}
```

# Actor input Schema

## `inputs` (type: `array`):

Accepts: product URLs, category URLs, search URLs, raw keywords, category slugs (e.g. 'fresh-food'), product IDs, or '{id}/reviews' for standalone reviews.

## `region` (type: `string`):

Tesco region to scrape.

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

Maximum products to return per search/category input.

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

Maximum listing pages to crawl per search/category input.

## `includeReviews` (type: `boolean`):

Fetch up to 10 reviews per product when scraping products. For full reviews use '{id}/reviews' input.

## Actor input object example

```json
{
  "inputs": [
    "https://www.tesco.com/shop/en-GB/products/254656543",
    "https://www.tesco.com/shop/en-GB/browse/fresh-food/all",
    "milk",
    "fresh-food",
    "303837409/reviews"
  ],
  "region": "UK",
  "maxItems": 100,
  "maxPages": 5,
  "includeReviews": false
}
```

# 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 = {
    "inputs": [
        "https://www.tesco.com/shop/en-GB/products/254656543",
        "https://www.tesco.com/shop/en-GB/browse/fresh-food/all",
        "milk",
        "fresh-food",
        "303837409/reviews"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/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 = { "inputs": [
        "https://www.tesco.com/shop/en-GB/products/254656543",
        "https://www.tesco.com/shop/en-GB/browse/fresh-food/all",
        "milk",
        "fresh-food",
        "303837409/reviews",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/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 '{
  "inputs": [
    "https://www.tesco.com/shop/en-GB/products/254656543",
    "https://www.tesco.com/shop/en-GB/browse/fresh-food/all",
    "milk",
    "fresh-food",
    "303837409/reviews"
  ]
}' |
apify call thenetaji/tesco-scraper --silent --output-dataset

```

## MCP server setup

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