# Too Good To Go Scraper: Stores, Surprise Bags & Availability (`abotapi/toogoodtogo-surprise-bag-scraper`) Actor

Scrape Too Good To Go (TGTG) stores and surprise bags by location or item: price, value, savings, quantity, pickup windows, ratings, favorites and store details. Availability monitoring (NEW, UPDATED, REAPPEARED, EXPIRED), detail enrichment, incremental runs, MCP export.

- **URL**: https://apify.com/abotapi/toogoodtogo-surprise-bag-scraper.md
- **Developed by:** [Abot API](https://apify.com/abotapi) (community)
- **Categories:**
- **Stats:** 2 total users, 2 monthly users, 70.6% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.80 / 1,000 bag or store records

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

## Too Good To Go Scraper - Stores & Surprise Bags

Scrape Too Good To Go (toogoodtogo.com), the app-first food-waste marketplace, directly from
the same mobile service the official app uses. This actor returns surprise-bag listings and
store details around any location: price, value, savings, quantity available, pickup windows,
ratings, favorite counts, categories, addresses and geo coordinates. It also monitors
availability across runs (NEW, UPDATED, REAPPEARED, EXPIRED), enriches each item from its
detail endpoint, and pipes results into your apps through MCP connectors.

### Why This Scraper?

- Real mobile-service data: bag listings with exact quantity available, pickup window, price
  and value in one record, not a scraped map screenshot.
- Location search around one or many points, with a per-location share of the item budget so
  multi-city runs stay balanced.
- Item mode: paste item links or numeric ids for fully enriched single-item reads.
- Availability monitoring: scheduled runs classify every record as NEW, UPDATED, UNCHANGED,
  REAPPEARED or EXPIRED, with per-campaign state you can name or share.
- Detail enrichment toggle: fuller description and tab data per item, billed as a separate
  per-item event only when the fetch succeeds.
- MCP connector export: send results to Notion and other connectors without changing the
  dataset.
- Structured failures: a blocked or unauthorized run fails loudly with a clear message
  instead of returning an empty dataset.

### Data You Get

> Sample shape: values are illustrative placeholders, not from a live listing.

| Field | Example value |
|---|---|
| kind | bag |
| itemId | 00000001 |
| url | https://www.toogoodtogo.com/en-us/item/00000001 |
| title | Espresso House - Dom Aquarée (Überraschungstüte) |
| itemName | Überraschungstüte |
| category | Baked goods |
| storeName | Sample Store |
| branch | Mitte |
| price | 3.99 |
| currency | EUR |
| value | 12.0 |
| savingsPercent | 66.7 |
| quantityAvailable | 3 |
| pickupStart | 2026-01-01T16:30:00Z |
| pickupEnd | 2026-01-01T18:00:00Z |
| soldOutAt | null |
| favoriteCount | 214 |
| ratingAverage | 4.7 |
| ratingCount | 96 |
| itemTags | 3 left |
| dietTags | vegetarian |
| street | Sample Street 12 |
| city | Berlin |
| postalCode | 10115 |
| country | Germany |
| countryCode | DE |
| latitude | 52.5305 |
| longitude | 13.3902 |
| distanceKm | 1.24 |
| storeWebsite | https://sample-store.example |
| inSalesWindow | true |
| changeType | NEW |
| firstSeenAt / lastSeenAt | 2026-01-01T00:00:00.000Z |

Every record also carries the full upstream item object (raw) and the full store block
(storeRaw), so no upstream field is ever dropped.

### How to Use

**Zero setup:** the source requires a free app account for every data route, and the actor handles that account for you: on first use it self-registers one free app account (the signup is confirmed automatically), stores that session **encrypted**, and reuses it in every later run. Nothing to provide, nothing to configure.

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| mode | select | search | search (locations) or url (item links or ids) |
| locations | list | `Berlin` | Where to search — city or place names (Berlin, 10115 Berlin, Paris), or exact coordinates as lat,lng |
| radiusKm | integer | 5 | Search radius in km, 0.5 to 100 |
| dietCategories | multi-select | empty | vegan, vegetarian, halal, kosher, pescatarian, gluten-free |
| searchPhrase | string | empty | Only stores matching this text (search mode) |
| withStockOnly | boolean | false | Hide sold-out listings (search mode) |
| weCareOnly | boolean | false | Only We Care labeled stores (search mode) |
| favoritesOnly | boolean | false | Only the account's favorite stores (search mode) |
| itemInputs | array | empty | Item links or numeric ids (url mode) |
| allowAutoSignup | boolean | true | Automatic account self-registration (hidden; managed by the actor) |
| fetchDetails | boolean | false | Fetch each item's detail endpoint; billed as detail-enrichment |
| maxItems | integer | 20 | Stop after this many records (0 = no limit) |
| maxPages | integer | 100 | Page walk bound per location; the run stops at maxItems first |
| resumeFromRunId | string | empty | Continue one interrupted run, skipping collected ids |
| incrementalMode | boolean | false | Recurring monitoring with change detection |
| stateKey | string | empty | Name a monitoring campaign (incremental mode) |
| emitUnchanged | boolean | false | Also return UNCHANGED rows (returns and bills extra rows) |
| emitExpired | boolean | false | Also return EXPIRED rows after a complete scan |
| mcpConnectors | array | empty | Optional MCP connector export |
| notionParentPageUrl | string | empty | Notion parent page for the Notion connector |
| maxNotifyListings | integer | 50 | Cap per connector per run |
| proxyConfiguration | object | proxy on | Standard Apify proxy settings |

Filters apply to search mode only; url mode ignores them because each item is read directly.

### Output Example

> Sample shape: values are illustrative placeholders, not from a live listing.

```json
{
  "kind": "bag",
  "itemId": 00000001,
  "url": "https://www.toogoodtogo.com/en-us/item/00000001",
  "title": "Surprise Bag",
  "description": "Assorted baked goods, contents revealed at pickup.",
  "itemType": "MAGIC_BAG",
  "price": 3.99,
  "currency": "EUR",
  "value": 12.0,
  "savingsPercent": 66.7,
  "quantityAvailable": 3,
  "pickupStart": "2026-01-01T16:30:00Z",
  "pickupEnd": "2026-01-01T18:00:00Z",
  "soldOutAt": null,
  "favoriteCount": 214,
  "favorite": false,
  "ratingAverage": 4.7,
  "ratingCount": 96,
  "itemTags": ["3 left"],
  "dietTags": ["vegetarian"],
  "imageUrl": "https://images.example/cover.jpg",
  "inSalesWindow": true,
  "storeId": "00001",
  "storeName": "Sample Store",
  "branch": "Mitte",
  "street": "Sample Street 12",
  "city": "Berlin",
  "postalCode": "10115",
  "country": "Germany",
  "countryCode": "DE",
  "latitude": 52.5305,
  "longitude": 13.3902,
  "distanceKm": 1.24,
  "storeWebsite": "https://sample-store.example",
  "storeTimeZone": "Europe/Berlin",
  "storeFavoriteCount": 1893,
  "storeRaw": { "full upstream store object" },
  "raw": { "full upstream item object" },
  "changeType": "NEW",
  "changedFields": [],
  "firstSeenAt": "2026-01-01T00:00:00.000Z",
  "lastSeenAt": "2026-01-01T00:00:00.000Z"
}
```

### Plan Requirement

The source requires a free account session (see How to Use). The actor uses the Apify proxy
with automatic exit rotation and session refresh; run it on any plan that includes proxy
access. Detail enrichment adds a per-item request and is billed through the separate
detail-enrichment event only for records where the detail read succeeded.

# Actor input Schema

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

Search finds surprise bags around one or more locations. URL mode reads one or more item links or numeric item ids.

## `locations` (type: `array`):

Where to search — one entry per location. A city or place name (Berlin, Paris, 10115 Berlin), or exact coordinates as lat,lng (52.52,13.405). Names are resolved automatically and cached.

## `radiusKm` (type: `integer`):

Search mode: how far from each point to look, 0.5 to 100 km.

## `dietCategories` (type: `array`):

Search mode: only items matching these diet preferences.

## `searchPhrase` (type: `string`):

Search mode: only stores whose name or description matches this text.

## `withStockOnly` (type: `boolean`):

Search mode: hide sold-out listings.

## `weCareOnly` (type: `boolean`):

Search mode: only stores carrying the We Care label.

## `favoritesOnly` (type: `boolean`):

Search mode: only stores the account has favorited.

## `itemInputs` (type: `array`):

URL mode: numeric item ids, or any link carrying the id (for example toogoodtogo.com/en-us/item/12345678). Multi-value supported.

## `accessToken` (type: `string`):

From a community CLI login for your own account. Leave empty if you use the email login below; a session from a previous run is reused automatically.

## `refreshToken` (type: `string`):

Long-lived pair member; the actor exchanges it for a fresh access token automatically when one expires.

## `sessionCookie` (type: `string`):

The Set-Cookie header returned next to the token pair. Optional.

## `email` (type: `string`):

Starts the email login: run the actor, open the login email on a desktop browser and confirm it while the run polls (up to 4 minutes). The confirmed session is saved for future runs.

## `loginPollingId` (type: `string`):

From a previous login attempt, paired with the PIN below to complete the login in a second run.

## `loginPin` (type: `string`):

The PIN code from the login email, completing a login started in an earlier run.

## `allowAutoSignup` (type: `boolean`):

On by default: if no saved session exists, the actor sets up a free app account for you, stores that session encrypted in a single record, and reuses it in later runs. Switch off only to manage the app account yourself.

## `fetchDetails` (type: `boolean`):

Fetch each item's detail endpoint for the fuller description and tab data. Adds a per-item request, billed as the detail-enrichment event.

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

Stop after this many records (0 = no limit; the run then stops at Max pages or when results run out).

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

No page limit by default; the walk stops at Max items or when a location runs out of results.

## `resumeFromRunId` (type: `string`):

Paste a previous run ID or dataset ID to continue a large pull without returning items already collected there.

## `incrementalMode` (type: `boolean`):

Turn this on for daily or recurring monitoring. The first run returns every matching record as NEW. Later runs normally return only NEW, UPDATED and REAPPEARED records. Turn on Emit unchanged or Emit expired only when you also want those rows returned (and billed). State is kept separately for each search, filter and lookup setup; use State key to name or deliberately share a monitoring campaign.

## `stateKey` (type: `string`):

Optional. Name this monitoring campaign to keep its state stable, or deliberately share state across differently configured runs. Leave empty to let the actor derive a key automatically from the search and filter settings.

## `emitUnchanged` (type: `boolean`):

Off by default. Turn on to also return records that have not changed since the last run, marked UNCHANGED. This returns, and bills, extra rows you already have.

## `emitExpired` (type: `boolean`):

Off by default. Turn on to also return records that were present in a previous run but are no longer found, marked EXPIRED. Only produced once a run has fully scanned the tracked search.

## `mcpConnectors` (type: `array`):

Optionally send results into the apps you already use, via Model Context Protocol (MCP) connectors. Authorize one under Apify, Settings, API & Integrations, then select it here. Notion gets a rich page-per-item export; other connectors get a best-effort write or digest. Leave empty to skip; never changes the dataset output.

## `notionParentPageUrl` (type: `string`):

URL or id of the Notion page under which item pages are created. Required to enable the Notion export; ignored by other connectors.

## `maxNotifyListings` (type: `integer`):

Cap on items written to each connector per run. Does not affect the dataset.

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

Apify Proxy settings. Works on every proxy plan; the source is served through connection pools with automatic exit rotation.

## Actor input object example

```json
{
  "mode": "search",
  "locations": [
    "Berlin"
  ],
  "radiusKm": 5,
  "withStockOnly": false,
  "weCareOnly": false,
  "favoritesOnly": false,
  "itemInputs": [
    "123456789"
  ],
  "allowAutoSignup": true,
  "fetchDetails": false,
  "maxItems": 20,
  "maxPages": 100,
  "incrementalMode": false,
  "emitUnchanged": false,
  "emitExpired": false,
  "maxNotifyListings": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "mode": "search",
    "locations": [
        "Berlin"
    ],
    "radiusKm": 5,
    "withStockOnly": false,
    "weCareOnly": false,
    "favoritesOnly": false,
    "itemInputs": [
        "123456789"
    ],
    "allowAutoSignup": true,
    "fetchDetails": false,
    "maxItems": 20,
    "maxPages": 100,
    "incrementalMode": false,
    "emitUnchanged": false,
    "emitExpired": false,
    "maxNotifyListings": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("abotapi/toogoodtogo-surprise-bag-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",
    "locations": ["Berlin"],
    "radiusKm": 5,
    "withStockOnly": False,
    "weCareOnly": False,
    "favoritesOnly": False,
    "itemInputs": ["123456789"],
    "allowAutoSignup": True,
    "fetchDetails": False,
    "maxItems": 20,
    "maxPages": 100,
    "incrementalMode": False,
    "emitUnchanged": False,
    "emitExpired": False,
    "maxNotifyListings": 50,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("abotapi/toogoodtogo-surprise-bag-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",
  "locations": [
    "Berlin"
  ],
  "radiusKm": 5,
  "withStockOnly": false,
  "weCareOnly": false,
  "favoritesOnly": false,
  "itemInputs": [
    "123456789"
  ],
  "allowAutoSignup": true,
  "fetchDetails": false,
  "maxItems": 20,
  "maxPages": 100,
  "incrementalMode": false,
  "emitUnchanged": false,
  "emitExpired": false,
  "maxNotifyListings": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call abotapi/toogoodtogo-surprise-bag-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,abotapi/toogoodtogo-surprise-bag-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/09Z9mcRx4PC9zYBta/builds/1Onv8YawBDddcowfd/openapi.json
