# King Arthur Baking Recipe Scraper (`muhammadafzal/king-arthur-baking-recipe-scraper`) Actor

Scrape public King Arthur Baking recipes into structured records with ingredients, instructions, timings, yields, ratings, images, and source URLs for recipe research.

- **URL**: https://apify.com/muhammadafzal/king-arthur-baking-recipe-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Integrations
- **Stats:** 2 total users, 1 monthly users, 100.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

## King Arthur Baking Recipe Scraper

Scrape public King Arthur Baking recipe pages into clean, machine-readable recipe records for meal planning, baking research, content analysis, and recipe databases.

### Extracted fields

Each dataset item includes the recipe name, description, author, category, keywords, ingredients, optional ordered instructions, prep/cook/total times, yield, aggregate rating, image URLs, source URL, timestamp, and extraction warnings.

### Inputs

Use a direct recipe URL for the most deterministic run. You can also provide public `/recipes/` collection URLs or search terms such as `sourdough` and `chocolate cake`. The default input targets a public Basic Sourdough Bread recipe and returns up to 10 records. Only King Arthur Baking URLs are accepted; private pages, shopping pages, and unrelated websites are outside the contract.

```json
{
  "recipeUrls": ["https://www.kingarthurbaking.com/recipes/basic-sourdough-bread-recipe"],
  "maxResults": 1,
  "includeInstructions": true
}
```

### Output example

```json
{
  "name": "Basic Sourdough Bread",
  "ingredients": ["2 1/2 cups (300g) King Arthur Unbleached All-Purpose Flour"],
  "instructions": ["Mix the ingredients..."],
  "prepTime": "PT10M",
  "cookTime": "PT50M",
  "sourceUrl": "https://www.kingarthurbaking.com/recipes/basic-sourdough-bread-recipe"
}
```

### Pricing

| Event | Price |
|---|---:|
| Actor start | $0.0001 per run |
| Recipe record | $0.003 per dataset item |

For example, a one-recipe run costs up to $0.0031 in event charges before any platform-level usage. Dataset-item charging is automatic through Apify PPE; the Actor does not manually double-charge records.

### Reliability and limitations

The Actor uses a single, bounded Playwright session because the target may return a browser client challenge to plain HTTP clients. It does not bypass CAPTCHAs, authentication, paywalls, or access controls. If the target returns a client challenge, the run reports a blocked diagnostic and writes no fabricated recipe records. Structured JSON-LD is the primary extraction source, so fields that the source page does not publish are returned as `null` or an empty array.

### Compliance

Use the Actor only for public pages and in accordance with King Arthur Baking’s terms, robots guidance, and applicable law. Respect copyright and do not republish recipe text beyond your lawful use case.

# Actor input Schema

## `recipeUrls` (type: `array`):

Use this for one or more public King Arthur Baking recipe URLs, for example https://www.kingarthurbaking.com/recipes/basic-sourdough-bread-recipe. Defaults to a known recipe. This is not a general web URL field.

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

Use this for public King Arthur Baking /recipes/ pages, including collections that link to recipes. Example: https://www.kingarthurbaking.com/recipes/collections/sourdough-bread-recipes. Unsupported domains are ignored.

## `searchTerms` (type: `array`):

Use this to search King Arthur Baking recipes by keyword, for example 'sourdough' or 'chocolate cake'. Defaults to no keyword search; direct recipe URLs are more deterministic.

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

Maximum number of unique recipe records to write and charge. Enter 1 to 100; defaults to 10. This is not a page count.

## `includeInstructions` (type: `boolean`):

Set true to include ordered recipe steps from JSON-LD; set false for smaller ingredient and metadata records. Defaults to true.

## Actor input object example

```json
{
  "recipeUrls": [
    "https://www.kingarthurbaking.com/recipes/basic-sourdough-bread-recipe"
  ],
  "startUrls": [],
  "searchTerms": [],
  "maxResults": 10,
  "includeInstructions": true
}
```

# Actor output Schema

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

Structured recipe records with ingredients, optional instructions, timing, ratings, and source URL.

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

Record count, blocked-page count, invalid URL count, and warnings.

# 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 = {
    "recipeUrls": [
        "https://www.kingarthurbaking.com/recipes/basic-sourdough-bread-recipe"
    ],
    "startUrls": [],
    "searchTerms": [],
    "maxResults": 10,
    "includeInstructions": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/king-arthur-baking-recipe-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 = {
    "recipeUrls": ["https://www.kingarthurbaking.com/recipes/basic-sourdough-bread-recipe"],
    "startUrls": [],
    "searchTerms": [],
    "maxResults": 10,
    "includeInstructions": True,
}

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/king-arthur-baking-recipe-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 '{
  "recipeUrls": [
    "https://www.kingarthurbaking.com/recipes/basic-sourdough-bread-recipe"
  ],
  "startUrls": [],
  "searchTerms": [],
  "maxResults": 10,
  "includeInstructions": true
}' |
apify call muhammadafzal/king-arthur-baking-recipe-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/king-arthur-baking-recipe-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/ntjI4fczt1OVwYRx3/builds/ECLJO2Q9n5gWOHsmY/openapi.json
