# Bon Appétit Recipes Scraper (`muhammadafzal/bon-appetit-recipes-scraper`) Actor

Scrape public Bon Appétit recipe pages and recipe indexes into structured records with ingredients, instructions, timing, author, yield, keywords, and optional nutrition.

- **URL**: https://apify.com/muhammadafzal/bon-appetit-recipes-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Other, Agents, Automation
- **Stats:** 2 total users, 1 monthly users, 75.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 recipe records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Bon Appétit Recipes Scraper

Scrapes public Bon Appétit recipe pages and returns normalized recipe records for recipe databases, meal-planning workflows, food research, and AI agents.

Use `startUrls` for public recipe or index pages, or `searchQuery` to discover recipes by keyword. `maxResults` defaults to 10 (1–100), `maxPages` defaults to 3 (1–10), and `includeNutrition` keeps nutrition data from Recipe JSON-LD when available. With no input, the Actor uses Bon Appétit’s public recipes index.

Each dataset item includes the recipe URL, name, description, image, author, publication date, prep/cook/total times, yield, categories, cuisine, keywords, ingredients, instructions, nutrition, scrape timestamp, and extraction warnings. The Actor returns only schema-valid recipe records; blocked or empty runs return zero fabricated records and explain the outcome in `OUTPUT` and the terminal status.

Example:

```json
{
  "startUrls": [{ "url": "https://www.bonappetit.com/bon-appetit/recipe/one-pot-ratatouille" }],
  "maxResults": 1,
  "includeNutrition": true
}
```

Bon Appétit content remains subject to the source website’s terms and robots/access policies. This Actor accesses public pages only and does not bypass authentication, paywalls, CAPTCHAs, or other access controls.

### What data does Bon Appétit Recipes Scraper return?

| Field | Type | Description |
|---|---|---|
| `recordType` | string | Record Type |
| `url` | string | Recipe URL |
| `recipeId` | string or null | Recipe ID |
| `name` | string | Recipe Name |
| `description` | string or null | Description |
| `image` | string or null | Image URL |
| `author` | string or null | Author |
| `datePublished` | string or null | Value returned as datePublished. |
| `prepTime` | string or null | Value returned as prepTime. |
| `cookTime` | string or null | Value returned as cookTime. |
| `totalTime` | string or null | Value returned as totalTime. |
| `recipeYield` | string or null | Value returned as recipeYield. |
| `recipeCategory` | array | Value returned as recipeCategory. |
| `recipeCuisine` | array | Value returned as recipeCuisine. |
| `keywords` | array | Value returned as keywords. |
| `ingredients` | array | Value returned as ingredients. |
| `instructions` | array | Value returned as instructions. |
| `nutrition` | object or null | Value returned as nutrition. |
| `scrapedAt` | string | Value returned as scrapedAt. |
| `warnings` | array | Value returned as warnings. |

### Use cases

- Schedule repeatable collection and export results to downstream workflows.
- Run a one-off research job and export the structured result as JSON, CSV, Excel, XML, or RSS from Apify.
- Schedule the same input to monitor changes over time and send completed datasets to a webhook or integration.
- Feed schema-shaped records into a database, spreadsheet, BI tool, or AI workflow with the source URL retained for verification.

### Input

| Field | Type | Description |
|---|---|---|
| `startUrls` | array | Use for public Bon Appétit recipe, category, or search pages. Example: https://www.bonappetit.com/bon-appetit/recipe/one-pot-ratatouille. |
| `searchQuery` | string | Use to discover Bon Appétit recipes by keyword, for example 'chicken pasta'. Leave empty when using startUrls. |
| `maxResults` | integer | Maximum structured recipe records to return; 1-100. Each valid recipe is one result event. |
| `maxPages` | integer | Maximum index/search pages for recipe-link discovery; 1-10. Direct recipe URLs do not use this limit. |
| `includeNutrition` | boolean | Keep nutrition fields from Recipe JSON-LD when available. |

### Output example

```json
{
  "recordType": "Example Record Type",
  "url": "Example Recipe URL",
  "recipeId": "Example Recipe ID",
  "name": "Example Recipe Name",
  "description": "Example Description",
  "image": "Example Image URL",
  "author": "Example Author",
  "datePublished": "Example datePublished",
  "prepTime": "Example prepTime",
  "cookTime": "Example cookTime",
  "totalTime": "Example totalTime",
  "recipeYield": "Example recipeYield"
}
```

The exact fields depend on the selected input and what the public source exposes. Use the dataset schema as the machine-readable contract and retain source URLs for verification.

### Run Bon Appétit Recipes Scraper with the Apify API

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('muhammadafzal/bon-appetit-recipes-scraper').call({
  "startUrls": [],
  "searchQuery": "",
  "maxResults": 10,
  "maxPages": 3,
  "includeNutrition": true
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

You can also run the Actor from Apify Console, schedules, webhooks, the REST API, Make, Zapier, n8n, or the hosted Apify MCP server.

### Pricing and cost control

This Actor uses **pay-per-event** pricing. Charges follow the live event definitions shown below.

| Event | Price (USD) | When it is charged |
|---|---:|---|
| `recipe-record` | $0.003 | Charged once for each schema-valid Bon Appétit recipe record returned. |
| `apify-actor-start` | $0.00005 | Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event). |

For example, 100 `recipe-record` events cost **$0.3**, plus any enabled Actor-start event. Empty or failed work should be checked in the run log and dataset before reuse.

### Responsible use

Use this Actor only for data you are authorized to access. Follow the target website's terms, robots and access policies, and applicable privacy, database, copyright, anti-spam, and data-protection laws. Do not use it to bypass authentication or other access controls, collect private data, harass people, or make high-impact decisions without independent verification.

### Support

When reporting a problem, include the **Actor run ID**, a redacted input, the expected result, and a small public example URL when applicable. Do not post API tokens, cookies, credentials, or personal data in an issue.

# Actor input Schema

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

Use for public Bon Appétit recipe, category, or search pages. Example: https://www.bonappetit.com/bon-appetit/recipe/one-pot-ratatouille.

## `searchQuery` (type: `string`):

Use to discover Bon Appétit recipes by keyword, for example 'chicken pasta'. Leave empty when using startUrls.

## `maxResults` (type: `integer`):

Maximum structured recipe records to return; 1-100. Each valid recipe is one result event.

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

Maximum index/search pages for recipe-link discovery; 1-10. Direct recipe URLs do not use this limit.

## `includeNutrition` (type: `boolean`):

Keep nutrition fields from Recipe JSON-LD when available.

## Actor input object example

```json
{
  "startUrls": [],
  "searchQuery": "",
  "maxResults": 10,
  "maxPages": 3,
  "includeNutrition": true
}
```

# Actor output Schema

## `recipes` (type: `string`):

No description

## `summary` (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 = {
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/bon-appetit-recipes-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 = { "maxResults": 10 }

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/bon-appetit-recipes-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 '{
  "maxResults": 10
}' |
apify call muhammadafzal/bon-appetit-recipes-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/bon-appetit-recipes-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/7BCGifspLgSaxXeAI/builds/Wme3ievnfchTTtmVo/openapi.json
