# BBC Food Recipe & Ingredient Scraper (`dataspryva/bbc-food-recipe-and-ingredient-scraper`) Actor

Find BBC Food recipes by keyword or direct recipe URL and get the full ingredient list, step-by-step method, timings, servings, rating, and cuisine for each one.

- **URL**: https://apify.com/dataspryva/bbc-food-recipe-and-ingredient-scraper.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 Food Recipe & Ingredient Scraper

Turn a BBC Food search or a list of recipe links into structured recipe data. The actor crawls bbc.co.uk/food's search results page by page and reads each recipe's own structured data, so you get the same ingredients, steps, and timings shown on the page itself.

### What this actor does

- **Keyword search** across BBC Food's recipe search, paging through results until `maxItems` is reached
- **Direct URL mode** for a known list of recipe pages
- **Post-fetch filters** by cuisine text match and minimum rating
- **Full recipe body** — ingredients, numbered method steps, timings, servings, and nutrition where BBC Food publishes it
- **Empty fields are omitted** — a recipe without a rating, for example, simply has no `rating` field

### Output per recipe

- `title` — recipe name
- `description` — recipe summary text
- `author` — chef or BBC programme credited with the recipe
- `prepTime`, `cookTime`, `totalTime` — ISO 8601 duration strings (e.g. `PT20M`) as published by BBC Food
- `servings` — recipe yield (e.g. number of servings or portions)
- `ingredients` — list of ingredient lines
- `ingredientCount` — number of ingredient lines
- `instructions` — list of method steps in order
- `stepCount` — number of method steps
- `calories` — calories per serving, when BBC Food publishes a nutrition panel
- `rating` — average community rating
- `ratingCount` — number of ratings behind that average
- `categories` — recipe category tags
- `cuisine` — cuisine type
- `keywords` — up to 10 keyword/tag terms
- `imageUrl` — recipe photo URL
- `datePublished` — original publish date
- `sourceUrl` — the BBC Food recipe page the record came from
- `recordType` — always `recipe`, so mixed datasets stay easy to filter
- `scrapedAt` — UTC timestamp of when the record was collected

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `search` | `search` (keyword) or `byUrl` (direct recipe links) |
| `query` | string | – | Keyword used when `mode` is `search`; falls back to BBC Food's "popular" search when left empty |
| `cuisine` | string | – | Keep only recipes whose cuisine or category text contains this value |
| `minRating` | number | – | Keep only recipes rated at or above this value (1.0–5.0) |
| `startUrls` | array | `[]` | Recipe URLs to fetch directly when `mode` is `byUrl` |
| `maxItems` | integer | `20` | Maximum number of recipes to return (1–500) |

#### Example: search for a dish

```json
{ "mode": "search", "query": "roast chicken", "maxItems": 20 }
```

#### Example: search restricted by cuisine and rating

```json
{ "mode": "search", "query": "curry", "cuisine": "Indian", "minRating": 4, "maxItems": 30 }
```

#### Example: fetch specific recipe pages

```json
{ "mode": "byUrl", "startUrls": ["https://www.bbc.co.uk/food/recipes/perfect_roast_chicken_93247"] }
```

### Use cases

- **Recipe app content** — populate a cooking app with structured ingredients and steps instead of raw HTML
- **Meal planning tools** — pull servings, timings, and calories to feed into a planner
- **Content research** — gather a batch of recipes by cuisine for editorial or recipe-roundup work
- **Nutrition tracking** — collect calorie figures across a set of dishes where BBC Food publishes them

### FAQ

**Does this need a login or API key?**
No. bbc.co.uk/food is a public website and the actor reads only its publicly available pages.

**Why do some recipes have no `calories` or `rating`?**
Not every BBC Food recipe page publishes a nutrition panel or carries community ratings. Those fields are left off the record rather than filled with a placeholder.

**What format are `prepTime`, `cookTime`, and `totalTime` in?**
They're kept exactly as BBC Food publishes them — ISO 8601 durations like `PT20M` for 20 minutes or `PT1H30M` for one hour thirty.

**How does the cuisine filter work?**
`cuisine` is matched against both the recipe's cuisine field and its category tags, so a value like `Italian` catches recipes tagged either way.

**Can I scrape a specific recipe directly?**
Yes — set `mode` to `byUrl` and list the exact recipe URLs in `startUrls`; the cuisine and rating filters still apply.

**How many recipes can one run return?**
Up to `maxItems`, capped at 500. In search mode, the actor keeps paging through BBC Food's search results until it reaches that cap or runs out of matches.

**How does pagination work?**
Search mode walks BBC Food's result pages in order, de-duplicates recipe links, and stops when `maxItems` is reached or two consecutive pages add nothing new. You do not need to supply page numbers.

**Is this affiliated with the BBC?**
No. This is an independent, third-party actor that reads BBC Food's publicly available recipe pages and is not affiliated with or endorsed by the BBC.

# Actor input Schema

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

Search BBC Food by keyword, or fetch specific recipe pages from Start URLs.

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

Keyword used in search mode. Leave empty to use BBC Food's popular recipes.

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

Keep only recipes whose cuisine or category text contains this value (e.g. Italian, British, Dessert).

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

Keep only recipes rated at or above this value. Recipes without a rating are kept.

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

Maximum number of recipes to return.

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

BBC Food recipe pages to fetch when mode is 'Fetch from direct URLs'.

## Actor input object example

```json
{
  "mode": "search",
  "query": "roast chicken",
  "maxItems": 3,
  "startUrls": []
}
```

# Actor output Schema

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

Dataset containing all scraped BBC Food recipe records.

# 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": "roast chicken",
    "maxItems": 3,
    "startUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("dataspryva/bbc-food-recipe-and-ingredient-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",
    "query": "roast chicken",
    "maxItems": 3,
    "startUrls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("dataspryva/bbc-food-recipe-and-ingredient-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",
  "query": "roast chicken",
  "maxItems": 3,
  "startUrls": []
}' |
apify call dataspryva/bbc-food-recipe-and-ingredient-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dataspryva/bbc-food-recipe-and-ingredient-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/tDnB7UQRhyua0nD6T/builds/DdB0lPIvQgoYV51PO/openapi.json
