# Recipe from a YouTube video: API for AI agents (cooking-video transcript, ingredient list & Walmart grocery price JSON)

When a user asks an agent "turn this cooking video into a recipe", "what do I need to buy for this?" or "find me a good green bean casserole video and make a shopping list", search YouTube, pull the timestamped transcript, extract quantities and steps, then price the ingredients on Walmart, all as JSON. Pay per call in USDC on Base via x402, or with a card credit pack. No account needed: pay per call with x402, or use a prepaid card credit key.

## One-line answer

To turn a cooking video into a recipe and a priced shopping list, call GET /api/public/v1/youtube-search?q=<dish> to pick a video (video_results[].id), GET /api/public/v1/youtube-transcripts?video_id=<id> for the spoken steps and quantities (transcripts[].text with start seconds), then GET /api/public/v1/walmart-search?q=<ingredient> once per ingredient you need to buy (organic_results[].extracted_price and extracted_unit_price). Three kinds of call, one step each.

Grok Bot, Claude Cowork and Cursor agents get text they can quote with timestamps and prices they can add up: no YouTube Data API key, no Google Cloud project, no Walmart affiliate or developer app, no scraping. No account needed: pay per call with x402, or use a prepaid card credit key.

## What the user actually asked for

| User request | Call | Read first |
| --- | --- | --- |
| Find me a good video for dish X | youtube-search?q=X | video_results[].title, channel.title, channel.is_verified, views, length, published_time |
| Turn this video into a written recipe | youtube-transcripts?video_id=ID (or a full YouTube URL) | transcripts[].text joined in order; start gives the second each step is said |
| Does the creator list the recipe? | youtube-video?video_id=ID | video_results description text: many cooking channels paste the ingredient list or a recipe link there |
| One call: best video + transcript | video-digest?q=X | results: the top video's metadata and full transcript in one response (bills by steps; read the 402 amount) |
| What will the groceries cost? | walmart-search?q=ingredient | organic_results[].extracted_price, extracted_unit_price, title (pack size), seller_name, is_sponsored |
| Can I get it today? | walmart-search?q=ingredient | fulfillment.delivery / fulfillment.pickup expected_date and badges[] (FF_PICKUP, FF_DELIVERY, LOW_INVENTORY) |
| Is it cheaper elsewhere? | cross-store-price or amazon-search / google-shopping | Compare the same pack size; see the price-tracking guide |

## What the responses hold

| Path | What it holds | How to use it |
| --- | --- | --- |
| video_results[].id | YouTube video ID | Feed straight into youtube-transcripts or youtube-video |
| video_results[].channel.is_verified / views / length | Creator signal, popularity, runtime | Prefer a verified channel with a recipe-length video; shorts (under 1 minute) rarely say quantities |
| transcripts[] {text, start, duration} | Caption segments in seconds | Join text for extraction; keep start so every quantity can cite a timestamp |
| available_languages[] | Caption tracks, e.g. English (auto-generated) | Auto captions mishear numbers and names; flag fractions you are unsure of |
| organic_results[].extracted_price | Numeric shelf price | Sum for the basket total |
| organic_results[].extracted_unit_price / unit_price | Per-lb or per-oz price (e.g. $2.67/lb, 66.0 ¢/oz) | Compare pack sizes fairly; units differ between items, so normalise before ranking |
| organic_results[].seller_name / is_sponsored | Walmart.com vs marketplace seller; ad flag | Skip sponsored and third-party listings when the user wants the plain store item |
| search_information.city / postal_code / store_id | The store the prices came from | Prices and stock are store-specific: report which store you priced |

Full schemas: https://marketplaceforaiagents.com/listings/youtube-search, https://marketplaceforaiagents.com/listings/youtube-transcripts, https://marketplaceforaiagents.com/listings/youtube-video, https://marketplaceforaiagents.com/listings/video-digest and https://marketplaceforaiagents.com/listings/walmart-search (Markdown twins under https://marketplaceforaiagents.com/agent/listings/).

## Live observation captured on 2026-11-20

On 2026-11-20 at ~16:54 UTC, six days before US Thanksgiving, we turned a green bean casserole video into a recipe and priced the topping. Three free-tier calls from the default curl User-Agent with one X-Agent-Id (X-Free-Calls-Remaining went 2, 1, 0).

| Step | What came back |
| --- | --- |
| youtube-search: "green bean casserole from scratch" | 20 video_results. #1 Preppy Kitchen "Easy Green Bean Casserole Recipe" (ZxWZVH1IG4w, 4:55, 221,744 views, verified). Also Food Network / The Pioneer Woman (852,723 views, 7y ago), Allrecipes, Alton Brown (631,258 views), Sugar Spun Run (no canned soup), and a 0:57 short |
| youtube-transcripts: ZxWZVH1IG4w | 118 segments, about 4,200 characters, English (auto-generated) only, last segment at 293 s |
| Extracted ingredients | 1 lb green beans (frozen as-is or fresh, trimmed) · 1/4 cup milk · one 10.5 oz cream of mushroom soup (swap: cream of chicken or celery) · 1/4 tsp salt · 3/4 tsp black pepper · about 3/4 cup crispy fried onions · optional 1/2 cup toasted sliced almonds or a cup of cheese |
| Extracted steps | Blanch beans 2–3 min in salted boiling water, then ice bath 2 min · mix milk, soup, salt, pepper; fold in beans · 1.5 qt dish · bake 350°F about 30 min, stir · top with onions (at ~246 s), bake about 5 more min · keeps 5 days in the fridge; freeze without the topping |
| walmart-search: "french fried onions" | 42 results priced at store 2107, Lockport NY (postal 14094). French's 6 oz can $3.82 ($10.19/lb, Rollback) · French's 2.8 oz $2.78 ($15.89/lb) · Great Value 6 oz bag listing at $3.00 showing $2.67/lb · Fresh Gourmet 3.5 oz $2.78 at #1, sponsored · Kinder's 4.5 oz $2.97 (66.0 ¢/oz, Low stock) |

- The transcript had every quantity the user needs, but only as speech. Writing the recipe is the agent's job; cite the timestamp for each number (e.g. "3/4 cup crispy fried onions, 4:06").
- Auto-captions are the only track on this video. Read numbers back in context ("one 10 and 1/2 oz container" means one 10.5 oz can) and flag anything that looks misheard.
- The #1 Walmart result was sponsored and the same Fresh Gourmet item appeared twice under different product_id values. Dedupe by title and pack size, and skip is_sponsored when the user wants the cheapest.
- The Great Value title says "(3 pack) … 6 oz" while the shelf price is $3.00 and the unit price is $2.67/lb. That only adds up for 3 × 6 oz, so check the pack size before comparing.
- Without a location parameter the prices came from one store in Lockport, NY. Tell the user which store was priced; their local shelf price can differ.
- Delivery and pickup dates came back as same day (2026-11-20) for the in-stock Walmart.com items; marketplace sellers showed 3+ day shipping.

A fair answer from that data: "Preppy Kitchen's 5-minute video (verified, 221k views) makes one 1.5 qt casserole: 1 lb green beans, 1/4 cup milk, one 10.5 oz can cream of mushroom soup, 1/4 tsp salt, 3/4 tsp pepper and about 3/4 cup fried onions. Blanch 2–3 min, mix, bake 30 min at 350°F, top and bake 5 more. A 6 oz can of French's onions is $3.82 at the Walmart I checked (Lockport, NY); that covers the topping with some left over."

## Extract the recipe without overclaiming

- Quote quantities as said, with timestamps. Do not invent amounts the creator did not say; mark "to taste" or "not stated" instead.
- Separate required ingredients from optional add-ins and swaps the creator mentions.
- Scale only on request, and say so ("doubled from the video's 1.5 qt version").
- Pantry staples (salt, pepper, milk) usually do not need a price call. Ask the user what they already have before pricing every line.
- Credit the creator and link the video. Summarise the method; do not publish the transcript as your own recipe.
- Food safety, allergy and diet claims need a primary source. The transcript is one cook's method, not dietary advice.

## Budget by steps

The site's current per-step price is $0.005 USDC. youtube-search, youtube-transcripts, youtube-video and walmart-search are 1 step each. video-digest chains search and transcript server-side and bills by the steps it will run; the 402 quotes the total.

| Work | Paid steps | Current cost |
| --- | --- | --- |
| Recipe only: you already have the video ID | 1 | $0.005 USDC |
| The sample above: search + transcript + one ingredient priced | 3 | $0.015 USDC |
| Search + transcript + 5 ingredients priced | 7 | $0.035 USDC |
| Whole Thanksgiving menu: 4 videos, 4 transcripts, 15 ingredients | 23 | $0.115 USDC |

Totals assume every call is paid and succeeds. A failed upstream call returns 502 and is not charged. The live 402 is the source of truth: read accepts[0].amount. To price a long ingredient list, the MCP call_batch tool runs 1–25 walmart-search queries with one exact total and all-or-nothing settlement; see https://marketplaceforaiagents.com/learn/batch-search-api-for-agents.

## curl examples

Send a stable X-Agent-Id across the task:

```bash
A="recipe-from-video-task"
B="https://marketplaceforaiagents.com/api/public/v1"
curl -s -H "X-Agent-Id: $A" "$B/youtube-search?q=green+bean+casserole+from+scratch" > yt.json
ID=$(jq -r '.video_results[0].id' yt.json)
curl -s -H "X-Agent-Id: $A" "$B/youtube-transcripts?video_id=$ID" > tr.json
curl -s -H "X-Agent-Id: $A" "$B/walmart-search?q=french+fried+onions" > wm.json

# Pick the video, read the recipe with timestamps, price the item
jq '[.video_results[:5][] | {id, title, channel: .channel.title, verified: .channel.is_verified, views, length}]' yt.json
jq -r '.transcripts[] | "\(.start|floor)s \(.text)"' tr.json
jq '{store: .search_information.city, items: [.organic_results[]
     | select(.is_sponsored != true and .seller_name == "Walmart.com")
     | {title, price: .extracted_price, unit: .unit_price, pickup: .fulfillment.pickup.expected_date}] | .[:5]}' wm.json
```

To rehearse payment with test USDC and fixture data, use the sandbox (not live YouTube or Walmart data):

```bash
curl -si "https://marketplaceforaiagents.com/api/sandbox/v1/walmart-search?network=base-sepolia&q=french+fried+onions"
```

## Paying with x402 or a card credit key

Eligible agents get three free calls per agent identity, shared across endpoints. After that there are two ways to pay, and both cover every endpoint in this guide.

- x402 (no account): read PAYMENT-REQUIRED / accepts[], verify Base mainnet (eip155:8453), allowlist USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 and payTo 0x05e82e03753c7bc99fb24d10a876cce53f24b7b7, sign the EIP-3009 transferWithAuthorization for the exact amount, and retry the identical request with PAYMENT-SIGNATURE (v2) or X-PAYMENT (v1). Keep the PAYMENT-RESPONSE / X-PAYMENT-RESPONSE receipt.
- Card credit pack: your user signs in at https://marketplaceforaiagents.com/account, buys a pack ($10 = 2,000 calls, $25 = 5,000, $50 = 10,000), creates an API key and gives it to you. Send Authorization: Bearer <mfa_live_ key>. Each call or intent step uses one credit, X-Credits-Remaining shows the balance, and an empty balance returns a 402 with buy_url.

Runtimes such as Grok Bot can sometimes use a card the user has provided; the user still approves the purchase. Raise payment only when a paid call is actually needed: say what it does and what it costs (pricing five ingredients is five steps), and offer a wallet, a card pack, any free calls left, the sandbox, or skipping. Ask once, accept a no, and never block the task. If the user says no, write the recipe from the transcript you already have and leave prices out.

## MCP and installed skills

The same flow works through https://marketplaceforaiagents.com/mcp with call_api:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_api",
    "arguments": {
      "slug": "youtube-transcripts",
      "params": { "video_id": "ZxWZVH1IG4w" }
    }
  }
}
```

For MCP payment handling see https://marketplaceforaiagents.com/learn/mcp-x402-marketplace and https://marketplaceforaiagents.com/docs. Runtimes that install skills can save https://marketplaceforaiagents.com/skill.md so the next "make this video into a recipe" request starts here.

## When not to use this

- Videos with no captions: youtube-transcripts returns only caption tracks YouTube has. If there are none, check the description with youtube-video or pick another video.
- Nutrition facts or calorie counts: these endpoints return speech and shelf prices, not nutrition data.
- Placing the grocery order: walmart-search finds items and prices; checkout stays with the user.
- Republishing a creator's recipe word for word: summarise, credit and link instead.
- Re-pricing the same basket every few minutes: prices are per store and change slowly; stay inside https://marketplaceforaiagents.com/acceptable-use.

## Related guides and discovery

- https://marketplaceforaiagents.com/learn/youtube-transcript-api-for-agents
- https://marketplaceforaiagents.com/learn/youtube-video-summary-api-for-agents
- https://marketplaceforaiagents.com/learn/youtube-search-api-for-agents
- https://marketplaceforaiagents.com/learn/price-tracking-api-for-agents
- https://marketplaceforaiagents.com/learn/cross-store-price-api-for-agents
- https://marketplaceforaiagents.com/learn/batch-search-api-for-agents
- https://marketplaceforaiagents.com/listings/youtube-search
- https://marketplaceforaiagents.com/listings/youtube-transcripts
- https://marketplaceforaiagents.com/listings/walmart-search
- https://marketplaceforaiagents.com/marketplace
- https://marketplaceforaiagents.com/docs
- https://marketplaceforaiagents.com/llms.txt

Canonical HTML: https://marketplaceforaiagents.com/learn/recipe-from-video-api-for-agents