# AI Restaurant Menu Parser — Dishes, Prices & Allergens (`nomad-agent/ai-menu-parser`) Actor

Parse restaurant menu photos into structured data: every dish with translated name, price, atomic ingredients, EU-14 allergens with confidence, dietary type (vegan/vegetarian/pescetarian), nutrition estimates and origin story — 15 output languages. BYO Gemini key; no browser, no proxies.

- **URL**: https://apify.com/nomad-agent/ai-menu-parser.md
- **Developed by:** [Nomad Dev](https://apify.com/nomad-agent) (community)
- **Categories:** AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 dish extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## AI Restaurant Menu Parser — Photos → Dishes, Prices & Allergens

Upload menu photos (or send URLs/base64 through JSON), get back the menu as
**structured JSON** — one record per dish. Richer than generic menu-OCR actors:

- `name` (translated to your language) + `originalName` (as printed)
- `category`, `price` (with currency, as shown)
- `ingredients` — atomic base ingredients (composite preparations like
  pesto or hummus are decomposed), each with an English database name,
  translated display name, and **EU-14 allergens with confidence levels**
- `dietaryType` — Vegan / Vegetarian / Pescetarian / Other, with explanation
- `nutritionInfo` — estimated serving size, calories, protein, fat, carbs
- `story` — origin story / cultural significance
- `isAlcoholic` for beverages

15 output languages. The prompt is the production pipeline of a
dietary-restrictions travel app — battle-tested on real menus worldwide.

### Bring your own Gemini key

Parsing runs on **your** Google AI Studio key
([get one free](https://aistudio.google.com/apikey)) — you control the AI
cost and quota. A typical menu runs a few cents on Gemini 2.5 Flash, or a
fraction of that on Flash-Lite.

Apify charges $0.005 after a non-empty dataset is pushed, plus $0.002 per
dish. Your first live run waives up to 10 per-dish charges; the $0.005 start
charge still applies. Empty and failed parses produce a `diagnostic: true`
row with a `message` and create no Apify billing events, although Gemini may
still charge your account for an attempted inference.

### Input example

```json
{
  "imageUrls": ["https://example.com/menu-page-1.jpg", "https://example.com/menu-page-2.jpg"],
  "geminiApiKey": "AIza…",
  "language": "en"
}
```

### Notes

- The untouched keyless Console run returns one deterministic row labelled
  `recordType: "DEMO"` / `isDemo: true`. It makes no image or Gemini call and
  is not billed. Customize the input and add your Gemini key to use the normal
  live path.
- The Console accepts local JPEG, PNG, or WebP uploads directly. API callers
  may use HTTP(S) URLs, base64 data URIs, or raw base64 in `imageUrls`.
- Each decoded image is limited to 10 MiB. Inline payloads and signed URL
  credentials are replaced with safe references in output records and logs.
- **First live run allowance**: up to 10 per-dish charges are waived; the
  actor-start charge still applies. The untouched prefilled DEMO is separate
  and completely free.
- Up to 20 images per run, parsed together as one menu.
- Unreadable items are skipped rather than guessed; empty results produce a
  non-billed diagnostic row explaining why.
- Don't have menu photos yet? The companion **Google Maps Menu Scraper**
  actor finds them from a Google Maps place URL and parses them in one run.

### Safety

Allergen, dietary, ingredient and nutrition fields are AI-generated estimates.
They can be wrong and do not account reliably for substitutions or kitchen
cross-contact. Verify critical information with the restaurant; do not rely on
this output as medical advice or as the sole safeguard for a severe allergy.

### Support & links

- Questions, bug reports and FAQ:
  [github.com/Exdenta/traveleat-support](https://github.com/Exdenta/traveleat-support)
- This actor runs the same menu pipeline as [Travel Eat](https://traveleat.app) —
  scan a menu, get allergens, ingredients and dietary filters in 36 languages.

# Actor input Schema

## `imageUrls` (type: `array`):

Upload menu photos or provide direct image URLs (JPEG/PNG/WebP, 10 MiB per image). API/JSON callers may also pass base64 data URIs or raw base64 strings in imageUrls. All images are parsed as one menu — up to 20 per run. The untouched owned sample returns a free, clearly marked DEMO preview; replace it with your own images for a live parse.

## `geminiApiKey` (type: `string`):

Required for live parses of your own images. Get a free key at <a href='https://aistudio.google.com/apikey'>aistudio.google.com/apikey</a>. Parsing runs on your key, so you control the AI cost. Leave it empty only for the untouched free DEMO preview.

## `geminiModel` (type: `string`):

Model used to read the menu photos.

## `language` (type: `string`):

Language for dish names, descriptions, stories and allergen summaries (ingredient database names stay English).

## Actor input object example

```json
{
  "imageUrls": [
    "https://raw.githubusercontent.com/Exdenta/traveleat-support/main/docs/assets/menu-demo-small.jpg"
  ],
  "geminiModel": "gemini-2.5-flash",
  "language": "en"
}
```

# Actor output Schema

## `items` (type: `string`):

The run's dataset items (see the dataset schema for the field-by-field structure).

# 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 = {
    "imageUrls": [
        "https://raw.githubusercontent.com/Exdenta/traveleat-support/main/docs/assets/menu-demo-small.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nomad-agent/ai-menu-parser").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 = { "imageUrls": ["https://raw.githubusercontent.com/Exdenta/traveleat-support/main/docs/assets/menu-demo-small.jpg"] }

# Run the Actor and wait for it to finish
run = client.actor("nomad-agent/ai-menu-parser").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 '{
  "imageUrls": [
    "https://raw.githubusercontent.com/Exdenta/traveleat-support/main/docs/assets/menu-demo-small.jpg"
  ]
}' |
apify call nomad-agent/ai-menu-parser --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nomad-agent/ai-menu-parser"
        }
    }
}

```

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/71WySDIdIJed34QxE/builds/KGZ42ePpq0LTk11bR/openapi.json
