# AllRecipes Search Scraper (`muhammadafzal/allrecipes-search-scraper`) Actor

Search public AllRecipes recipe cards and return structured recipe metadata, timing, nutrition, ingredients, and instructions for data workflows and AI agents.

- **URL**: https://apify.com/muhammadafzal/allrecipes-search-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Other, Automation, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 recipe returneds

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/platform/actors/running/actors-in-store#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

## AllRecipes Search Scraper

Search AllRecipes for public recipe cards and return one structured record per recipe. Use it for recipe discovery, ingredient research, meal-planning datasets, culinary content analysis, and AI-agent workflows that need recipe metadata, timing, nutrition, ingredients, and instructions.

The actor searches one query at a time, paginates up to a bounded page count, deduplicates recipe URLs, and optionally opens each recipe page to parse the public Schema.org `Recipe` data. It does not scrape accounts, private saves, reviews, comments, or logged-in content.

### What it extracts

| Field | Description |
| --- | --- |
| `recipeUrl`, `name`, `description`, `imageUrl` | Public recipe identity and media |
| `rating`, `ratingCount` | Aggregate rating values when published |
| `prepTime`, `cookTime`, `totalTime`, `recipeYield` | Timing and yield metadata |
| `recipeCategory`, `recipeCuisine`, `calories` | Public classification and nutrition |
| `ingredients`, `instructions` | Ordered public recipe content when `scrapeDetails` and `responseFormat` are detailed |
| `author`, `datePublished`, `dateModified` | Public attribution and dates |
| `searchQuery`, `searchPage`, `scrapedAt`, `warnings` | Provenance and quality diagnostics |

### Input

The default input is intentionally small and works for the Apify health test:

```json
{
  "searchQuery": "chicken",
  "maxResults": 10,
  "maxPages": 3,
  "scrapeDetails": true,
  "responseFormat": "detailed",
  "requestDelayMs": 400
}
```

Set `scrapeDetails` to `false` when you only need search-card metadata and want fewer requests. Set `responseFormat` to `concise` when an AI agent needs fast metadata without ingredient and instruction arrays. `maxResults` is always the hard output and billing cap.

### Example output

```json
{
  "recipeUrl": "https://www.allrecipes.com/recipe/12682/apple-pie-by-grandma-ople/",
  "name": "Apple Pie by Grandma Ople",
  "description": "A classic homemade apple pie.",
  "imageUrl": "https://www.allrecipes.com/thmb/example/image.jpg",
  "author": "MOSHASMAMA",
  "rating": 4.8,
  "ratingCount": 13006,
  "prepTime": "PT30M",
  "cookTime": "PT1H",
  "totalTime": "PT1H30M",
  "recipeYield": "8 servings",
  "ingredients": ["8 small Granny Smith apples", "1/2 cup unsalted butter"],
  "instructions": ["Gather the ingredients.", "Bake until golden."],
  "searchQuery": "apple pie",
  "searchPage": 1,
  "scrapedAt": "2026-08-01T12:00:00.000Z",
  "warnings": []
}
```

### Pricing

| Event | Price |
| --- | ---: |
| Actor start | $0.00005 |
| Recipe record stored | $0.005 |

The actor prints the maximum result-event cost before scraping. For example, `maxResults: 10` caps result events at about `$0.050`, excluding the start event and any Apify pay-per-usage option shown at run time. The actor charges only after a validated record is stored and stops when the result or event cap is reached.

### Reliability and limitations

AllRecipes can change public HTML, structured-data fields, pagination behavior, or rate limits. The actor uses retries, a single consistent request worker, bounded pagination, and explicit warnings. Empty valid searches exit successfully with a warning. If every request fails before a response is completed, the run is marked failed so the issue is visible instead of being reported as a misleading empty dataset.

The actor reads public pages only. You are responsible for complying with AllRecipes terms, applicable law, copyright rules, and any restrictions on storing or redistributing recipe text. Recipe data should be independently verified before production publishing or safety-critical use.

### API and MCP

Run through the standard Apify Actor API and fetch the default dataset after completion:

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('YOUR_USERNAME/allrecipes-search-scraper').call({
  searchQuery: 'one pot pasta',
  maxResults: 10,
  scrapeDetails: true
});
console.log(run.defaultDatasetId);
```

For hosted Apify MCP, use this actor when an agent needs AllRecipes search results and structured recipe records. Do not use it for AllRecipes member profiles, private saved recipes, or review sentiment; those are outside this actor's scope.

### Related workflows

This actor is a search-and-extract source. For a production content workflow, pass selected `recipeUrl` values to a separate detail or normalization step rather than increasing `maxResults` without a cost cap.

### Support

When reporting a missing field or layout change, include the run ID, search query, and affected public recipe URL.

# Actor input Schema

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

Use this to search AllRecipes for recipe names, ingredients, cuisines, or dietary terms. Enter plain text such as 'one pot chicken pasta'. Defaults to 'chicken'. This is not a direct recipe URL; use the AllRecipes search actor for search results.

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

Use this to cap the number of recipe records returned across all search pages. Enter an integer from 1 to 100, for example 10. Defaults to 10 for a bounded browser run. This is a result cap, not a page count or a request limit.

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

Use this to limit how many AllRecipes result pages are visited when maxResults has not been reached. Enter an integer from 1 to 10, for example 3. Defaults to 3. This does not change the maximum number of recipe records.

## `scrapeDetails` (type: `boolean`):

Use this to fetch each recipe page and parse ingredients, instructions, timing, nutrition, and author data from its public Recipe JSON-LD. Defaults to true. Set false for faster search-card records; this is not a review or user-profile scraper.

## `responseFormat` (type: `string`):

Use this to choose item richness for an AI agent or API consumer. Choose 'concise' for metadata and timing with empty ingredient/instruction arrays, or 'detailed' for full public recipe fields. Defaults to 'detailed'.

## `requestDelayMs` (type: `integer`):

Use this to add a polite delay between scheduled pages and recipe details. Enter 250 to 5000 milliseconds, for example 500. Defaults to 400. This is not a concurrency or billing setting.

## Actor input object example

```json
{
  "searchQuery": "one pot chicken pasta",
  "maxResults": 10,
  "maxPages": 3,
  "scrapeDetails": true,
  "responseFormat": "detailed",
  "requestDelayMs": 400
}
```

# Actor output Schema

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

Structured AllRecipes search records with recipe metadata, timing, nutrition, ingredients, instructions, and source URLs.

## `summary` (type: `string`):

JSON run summary with query, records collected, pages visited, warnings, and result-event charges.

# 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 = {
    "searchQuery": "chicken"
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/allrecipes-search-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 = { "searchQuery": "chicken" }

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/allrecipes-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQuery": "chicken"
}' |
apify call muhammadafzal/allrecipes-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=muhammadafzal/allrecipes-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/WafTcYh7VqtBb3wpb/builds/5TGJbArPvsRMaxDRT/openapi.json
