# Trolley Grocery Price Scraper (`crawloop/trolley-grocery-price-scraper`) Actor

Compare UK grocery prices from Trolley.co.uk. Search, categories, product pages, and deals with retailer prices and weekly history. HTTP, no browser.

- **URL**: https://apify.com/crawloop/trolley-grocery-price-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 $3.00 / 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

## Trolley Grocery Price Scraper

> **Disclaimer:** Unofficial tool — not affiliated with, sponsored by, or endorsed by Trolley.co.uk or its affiliates. Data is read from publicly accessible search results, category lists, product pages, and deal lists only. No login. You are responsible for complying with applicable law (including GDPR where personal data appears) and the site’s terms. No warranty on accuracy or availability. Provided for informational and research use.

UK grocery price comparison in one row: the best listed price, unit price, and — on a category or product page — each supermarket’s price side by side. This Trolley scraper is an API alternative for basket checks and deal monitoring. Paste a keyword, a category slug, or a product URL. Run it from Python, Node.js, or MCP and export JSON.

| UK price comparison | US weekly ad | EU leaflets | US grocery |
| :--- | :--- | :--- | :--- |
| Trolley Grocery Price 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

- Compare one grocery product across UK supermarkets
- Export a search page of best prices and unit prices
- Pull a category such as milks with the shops that stock each product
- Watch a retailer’s current deals, including the price before the cut

Use a grocery circular Actor when you need a weekly ad rather than a live comparison.

### Key features

- Search, category, product URL, and deals modes
- Best price, unit price, pack size, brand, and review count
- Nested retailer prices and offer text on category and product rows
- Weekly best-price series on a product page
- Deal cards with the previous price and the retailer
- HTTP fetch, 256 MB, no browser

### Input

| Field | Required | Description |
| :--- | :--- | :--- |
| `mode` | Yes | `search`, `category`, `product`, or `deals` |
| `queries` | For search | Keywords such as `milk` |
| `categorySlugs` | For category | Slug such as `milks` |
| `productUrls` | For product | Product URL that includes the slug and the product id |
| `store` | For deals | Asda, Sainsbury's, Morrisons, Co-op, Iceland, Boots, Superdrug, Savers, Amazon, or Ebay |
| `maxItems` | No | Stop after this many products. Default 20, maximum 500 |
| `maxPages` | No | Pages per keyword, category, or deals list. Default 1. A search page holds about 20 products |

#### Input example

```json
{
  "mode": "search",
  "queries": ["milk"],
  "maxItems": 20,
  "maxPages": 1
}
```

Product comparison:

```json
{
  "mode": "product",
  "productUrls": [
    "https://www.trolley.co.uk/product/cravendale-filtered-fresh-semi-skimmed-milk-fresher-for-longer/MOZ184"
  ]
}
```

### Output

| Field | Description |
| :--- | :--- |
| `title` | Brand and product name |
| `price` | Best listed price in GBP |
| `regularPrice` | Price before the cut on a deals card |
| `unitPrice` | Price per unit when the card includes one |
| `unitOfMeasure` | Unit, such as 100ml |
| `packSize` | Pack size |
| `dealRetailer` | Retailer named on a deals card |
| `priceDrop` | Saving text, such as 40p less |
| `retailers` | Supermarket, price, unit price, and offer. Filled on category and product rows |
| `priceHistory` | Weekly best price from a product page. `week` and `price` |
| `currentWeek` | Week number on that series |
| `reviewCount` | Reviews when the page shows them |
| `productUrl` | Product page URL |

#### Output example

```json
{
  "source": "trolley.co.uk",
  "listType": "product",
  "productId": "MOZ184",
  "title": "Cravendale Filtered Fresh Semi Skimmed Milk",
  "brand": "Cravendale",
  "name": "Filtered Fresh Semi Skimmed Milk",
  "packSize": "2 Litre",
  "price": 2.5,
  "unitPrice": 0.13,
  "unitOfMeasure": "100ml",
  "currency": "GBP",
  "lowestPrice": 2.5,
  "retailerCount": 2,
  "retailers": [
    {
      "retailer": "Asda",
      "retailerSlug": "asda",
      "price": 2.5,
      "unitPrice": 0.13,
      "unitOfMeasure": "100ml",
      "offer": null
    },
    {
      "retailer": "Tesco",
      "retailerSlug": "tesco",
      "price": 2.65,
      "unitPrice": 0.13,
      "unitOfMeasure": "100ml",
      "offer": "2 FOR £4"
    }
  ],
  "priceHistory": [
    { "week": 1, "price": 2.9 },
    { "week": 20, "price": 2.5 }
  ],
  "currentWeek": 40,
  "productUrl": "https://www.trolley.co.uk/product/cravendale-filtered-fresh-semi-skimmed-milk-fresher-for-longer/MOZ184"
}
```

### Use cases

- **Basket check** — open one product URL and read every supermarket price in `retailers`
- **Search export** — pull the best price and unit price for a keyword
- **Category shelf** — use `milks` and keep the shops nested on each row
- **Deal watch** — set `mode` to `deals` and `store` to Asda, then keep `regularPrice` and `priceDrop`

### Integration examples

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

#### Node.js

```javascript
import { ApifyClient } from "apify-client";

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor("crawloop/trolley-grocery-price-scraper").call({
  mode: "search",
  queries: ["milk"],
  maxItems: 20,
});
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/trolley-grocery-price-scraper").call(run_input={
    "mode": "search",
    "queries": ["milk"],
    "maxItems": 20,
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

#### cURL

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

### 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 Trolley Grocery Price Scraper for milk and return title, price, unit price, and pack size as JSON"
- "Open this Trolley product URL and list each supermarket price and the weekly history"
- "Pull Trolley deals for Asda, then run Aldi Weekly Ad Scraper for ZIP 60174 and compare milk prices"

### Suite next step

After the UK comparison, 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

- Trolley Grocery Price 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 search include every supermarket?**
Search rows are the card: best price, unit price, brand, and pack size. Set `mode` to `product` for each supermarket price and the weekly best-price series. Category rows already nest the shops shown on that list.

**Is the weekly series one price per supermarket?**
No. `priceHistory` is the best price by week on the product page. Each supermarket’s current price is in `retailers`.

**Which retailers can deals use?**
Asda, Sainsbury's, Morrisons, Co-op, Iceland, Boots, Superdrug, Savers, Amazon, and Ebay. Tesco and the other supermarkets still appear on product and category rows.

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

# Actor input Schema

## `mode` (type: `string`):

Search keywords, a category slug, product URLs, or current deals at one retailer.

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

Used when mode is search. Each keyword is paginated until maxItems or maxPages.

## `categorySlugs` (type: `array`):

Used when mode is category. A slug such as milks, or the last part of an explore path.

## `productUrls` (type: `array`):

Used when mode is product. Each URL must include the product slug and id. One row includes every retailer price and the weekly best-price series.

## `store` (type: `string`):

Used when mode is deals. The deals list only includes retailers that Trolley currently publishes on that page.

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

Stop after this many products.

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

Pages to open for each search, category, or deals request. A search page holds about 20 products.

## Actor input object example

```json
{
  "mode": "search",
  "queries": [
    "milk"
  ],
  "categorySlugs": [
    "milks"
  ],
  "productUrls": [
    "https://www.trolley.co.uk/product/cravendale-filtered-fresh-semi-skimmed-milk-fresher-for-longer/MOZ184"
  ],
  "store": "Asda",
  "maxItems": 20,
  "maxPages": 1
}
```

# 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 = {
    "mode": "search",
    "queries": [
        "milk"
    ],
    "categorySlugs": [
        "milks"
    ],
    "productUrls": [
        "https://www.trolley.co.uk/product/cravendale-filtered-fresh-semi-skimmed-milk-fresher-for-longer/MOZ184"
    ],
    "store": "Asda"
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawloop/trolley-grocery-price-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 = {
    "mode": "search",
    "queries": ["milk"],
    "categorySlugs": ["milks"],
    "productUrls": ["https://www.trolley.co.uk/product/cravendale-filtered-fresh-semi-skimmed-milk-fresher-for-longer/MOZ184"],
    "store": "Asda",
}

# Run the Actor and wait for it to finish
run = client.actor("crawloop/trolley-grocery-price-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 '{
  "mode": "search",
  "queries": [
    "milk"
  ],
  "categorySlugs": [
    "milks"
  ],
  "productUrls": [
    "https://www.trolley.co.uk/product/cravendale-filtered-fresh-semi-skimmed-milk-fresher-for-longer/MOZ184"
  ],
  "store": "Asda"
}' |
apify call crawloop/trolley-grocery-price-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawloop/trolley-grocery-price-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/PEzFYh3Ah48Lr5CM0/builds/LHpgkoA54GmURacWF/openapi.json
