# BBC Good Food Recipe & Nutrition Extractor (`dataspryva/bbc-good-food-recipe-and-nutrition-extractor`) Actor

Search BBC Good Food by keyword, browse a recipe category, or fetch direct recipe URLs and get ingredients, method steps, timings, calories, rating, and cuisine for each recipe.

- **URL**: https://apify.com/dataspryva/bbc-good-food-recipe-and-nutrition-extractor.md
- **Developed by:** [Dataspryva](https://apify.com/dataspryva) (community)
- **Categories:** Automation, Developer tools, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## BBC Good Food Recipe & Nutrition Extractor

Turn BBC Good Food pages into structured recipe rows: ingredients, method steps, timings, yield, per-serving UK nutrition, dietary tags, difficulty, rating, and the canonical source URL. The actor reads public pages without cookies, logins, or an API key, so a fresh Apify account can run it immediately.

### Ways to collect recipes

| Mode | What it does |
|---|---|
| **Search recipes** | Uses BBC Good Food's own search endpoint. Add cuisine, diet, meal type, difficulty, rating, time, calorie, and serving filters. |
| **Browse all recipes** | Walks the complete recipe index with the same filters; ideal when you do not have a keyword. |
| **Browse a collection** | Takes a collection slug (for example `pasta-recipes`, `vegan-recipes`, `baking-recipes`) or a full collection URL. |
| **Recipe URLs** | Fetches an exact list of recipe pages, including `/premium/` links. |
| **Walk the recipe sitemap** | Starts with the newest BBC Good Food recipe sitemaps and works forward, for fresh-content monitoring. |

Search and all-recipes modes page through results until `maxItems` is reached or the source runs out. Collection and URL modes deduplicate by recipe URL. Every mode applies the same filters to the fetched recipe pages, so a record only appears when it genuinely matches.

### Input highlights

- `mode` — pick one of the five collection routes above.
- `query` — keyword for search mode.
- `category` — collection slug or URL for collection mode.
- `cuisine` — one value or a comma-separated list such as `italian,mediterranean`.
- `diets` — multi-select: vegetarian, vegan, healthy, nut-free, egg-free, dairy-free, gluten-free, low-sugar, low-calorie, low-fat, high-fibre, high-protein.
- `mealTypes` — multi-select: dinner, lunch, breakfast, dessert, supper, and more.
- `difficulty` — easy, more effort, or a challenge.
- `minRating`, `maxTotalTimeMinutes`, `maxCalories`, `minServings` — numeric bounds.
- `sortBy` — most relevant, latest added, most popular, or quickest.
- `startUrls` — recipe links for URL mode (Apify request-list entries).
- `maxItems` — 1–1000 records.

#### Input reference

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | select | `search` | Search, all recipes, collection, recipe URLs, or sitemap |
| `query` | text | – | Keyword for search mode |
| `category` | text | `pasta-recipes` | Collection slug or URL for collection mode |
| `cuisine` | text | – | Cuisine or comma-separated cuisines |
| `diets` | multi-select | empty | Dietary tags, all selected tags must match |
| `difficulty` | select | Any difficulty | Easy, more effort, or a challenge |
| `mealTypes` | multi-select | empty | Meal type tags, at least one must match |
| `minRating` | number | – | Minimum community rating (1-5) |
| `maxTotalTimeMinutes` | integer | – | Maximum published total time |
| `maxCalories` | integer | – | Maximum calories per serving |
| `minServings` | integer | – | Minimum published yield |
| `sortBy` | select | `relevant` | Relevant, latest, popular, or quickest |
| `startUrls` | request list | empty | Recipe links for URL mode |
| `maxItems` | integer | `20` | Records to return (1-1000) |

#### Examples

```json
{"mode": "search", "query": "chicken curry", "maxItems": 40}
```

```json
{"mode": "search", "query": "pasta", "diets": ["vegan", "vegetarian"], "maxTotalTimeMinutes": 30, "sortBy": "rating", "maxItems": 50}
```

```json
{"mode": "byCategory", "category": "dessert-recipes", "minRating": 4.5, "maxItems": 30}
```

```json
{"mode": "byUrl", "startUrls": [{"url": "https://www.bbcgoodfood.com/recipes/creamy-pesto-kale-pasta"}], "maxItems": 1}
```

#### Existing tasks keep working

The original fields are still accepted: `query`, `category`, `cuisine`, `minRating`, `startUrls`, `maxItems`, and `mode`. Legacy collection names are mapped automatically (`quick-healthy` → quick recipes, `desserts` → dessert-recipes, `baking` → baking-recipes). Old output fields keep their names and types; the revamp adds fields beside them.

### Output per recipe

Core: `title`, `description`, `sourceUrl`, `recipeId`, `slug`, `author`, `authorUrl`, `authors`, `prepTime`, `cookTime`, `totalTime`, `prepTimeMinutes`, `cookTimeMinutes`, `totalTimeMinutes`, `servings`, `servingsCount`.

Ingredients and method: `ingredients`, `ingredientCount`, `ingredientGroups` (quantity, name, note, metric/imperial units, glossary link), `instructions`, `stepCount`.

Nutrition: `calories`, `caloriesKcal`, and a `nutrition` object with `calories`, `fat`, `saturatedFat`, `carbohydrates`, `sugars`, `fibre`, `protein`, `salt`, low-salt/low-sugar flags, and the per-serving caption.

Classification: `categories`, `cuisine`, `cuisines`, `diets`, `difficulty`, `mealTypes`, `occasions`, `nutritionTags`, `keywords`, `tags`, `publication`, `publications`, `isPremium`.

Media and provenance: `imageUrl`, `imageAlt`, `datePublished`, `dateModified`, `discoveredVia`, `source`, `recordType`, `scrapedAt`.

Fields the source does not publish are omitted; you will never see `null`, `""`, or empty arrays in a row.

### FAQ

**Do I need cookies, a login, or an API key?**
No. The actor uses BBC Good Food's public pages and its own public search endpoint. No account, cookie, or proxy configuration is required.

**Why do some recipes lack `cuisine` or `prepTime`?**
Those fields are conditional on the page. BBC Good Food does not publish a cuisine or a preparation time for every recipe, so the field is left out rather than invented.

**How are nutrition values expressed?**
The `nutrition` object keeps BBC Good Food's per-serving units (`450 kcal`, `20 g`, `0.8 g`). `caloriesKcal` is the numeric calorie value for calculations.

**What does `ingredients` contain when a recipe groups ingredients?**
`ingredients` is the flat list. `ingredientGroups` preserves the source's headings ("For the filling") and each item's quantity, name, note, and metric/imperial units.

**Why did a collection return fewer rows than `maxItems`?**
Some BBC Good Food collections are hand-curated and contain fewer recipes than the cap. The actor stops when the collection is exhausted; use search or all-recipes mode for a broader sweep.

**What happens if BBC Good Food briefly redirects to a regional site?**
The actor retries the request with a fresh URL before giving up, then skips that card and continues. The run status message reports skipped or filtered cards.

**How many recipes can one run return?**
Up to `maxItems` (1–1000). Search reports a source ceiling around 10,000 matches; all-recipes and sitemap modes page until the cap or the source ends.

**Is this affiliated with BBC Good Food?**
No. It is an independent third-party tool that reads publicly available pages and is not endorsed by BBC Good Food or the BBC.

### Notes and limits

- Search results are capped by the source at roughly 10,000 matches; narrow the query or use sitemap mode for a deeper sweep.
- Some hand-curated collections expose fewer than 100 cards and do not paginate.
- Premium recipe pages are fetched when linked; if BBC Good Food does not publish recipe data for a premium page, the card is skipped.
- UK nutrition panels are per serving. Values are passed through in the source's units and are not converted.

# Actor input Schema

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

How to find recipes. Search uses BBC Good Food's own search. Browse all walks the full index with the same filters. Collection takes a slug or collection URL. Recipe URLs fetches exact pages. Sitemap walks newest sitemap files first.

## `query` (type: `string`):

Keyword for mode=search (e.g. 'chicken curry', 'vegan cake'). Leave empty to browse every recipe.

## `category` (type: `string`):

Collection for mode=byCategory. Use a slug like 'pasta-recipes', 'vegan-recipes', 'baking-recipes', 'dessert-recipes', or paste a full https://www.bbcgoodfood.com/recipes/collection/... URL. Leave empty to browse all recipes.

## `cuisine` (type: `string`):

Optional cuisine filter; comma-separate several values, e.g. 'italian,mediterranean'. Common values: italian, british, indian, asian, chinese, french, mexican, thai, mediterranean, american, spanish, greek, middle-eastern, japanese, caribbean, moroccan, turkish, vietnamese.

## `diets` (type: `array`):

Keep recipes carrying every selected dietary tag. Empty array = no diet filter.

## `difficulty` (type: `string`):

Keep only recipes at this skill level.

## `mealTypes` (type: `array`):

Keep recipes matching at least one selected meal type. Empty array = no meal filter.

## `minRating` (type: `number`):

Keep recipes rated at or above this community rating (1.0-5.0).

## `maxTotalTimeMinutes` (type: `integer`):

Keep recipes whose published total time is at most this many minutes.

## `maxCalories` (type: `integer`):

Keep recipes at or below this calories-per-serving value.

## `minServings` (type: `integer`):

Keep recipes whose published yield is at least this many servings.

## `sortBy` (type: `string`):

Result order for search and all-recipes modes; collection and URL modes sort the collected rows.

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

Recipe pages for mode=byUrl. Accepts https://www.bbcgoodfood.com/recipes/... and /premium/... links.

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

Maximum number of recipe records to return.

## Actor input object example

```json
{
  "mode": "search",
  "query": "pasta",
  "category": "",
  "diets": [],
  "difficulty": "",
  "mealTypes": [],
  "sortBy": "relevant",
  "startUrls": [],
  "maxItems": 3
}
```

# Actor output Schema

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

Dataset containing every scraped BBC Good Food recipe record.

# 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",
    "query": "pasta",
    "category": "",
    "diets": [],
    "difficulty": "",
    "mealTypes": [],
    "sortBy": "relevant",
    "startUrls": [],
    "maxItems": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("dataspryva/bbc-good-food-recipe-and-nutrition-extractor").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",
    "query": "pasta",
    "category": "",
    "diets": [],
    "difficulty": "",
    "mealTypes": [],
    "sortBy": "relevant",
    "startUrls": [],
    "maxItems": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("dataspryva/bbc-good-food-recipe-and-nutrition-extractor").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",
  "query": "pasta",
  "category": "",
  "diets": [],
  "difficulty": "",
  "mealTypes": [],
  "sortBy": "relevant",
  "startUrls": [],
  "maxItems": 3
}' |
apify call dataspryva/bbc-good-food-recipe-and-nutrition-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dataspryva/bbc-good-food-recipe-and-nutrition-extractor"
        }
    }
}
```

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/dYkvJGqb3oE1By00b/builds/wtl3T6UszvJjAj1pd/openapi.json
