extract-menu-data

n8n custom node for extracting structured data from restaurant menus using AI

Package Information

Downloads: 0 weekly / 67 monthly
Latest Version: 1.0.1
Author: Your Name

Documentation

n8n Menu Data Extractor

A custom n8n node that uses AI to extract structured data from restaurant menus, regardless of their design or layout.

Features

  • Multi-format Support: Extract data from text, HTML, or image URLs
  • AI-Powered: Uses OpenRouter API with multiple AI models (GPT-4, Claude, Gemini)
  • Structured Output: Returns organized JSON with categories, items, prices, and more
  • Flexible Fields: Choose between basic extraction or comprehensive data including allergens, ingredients, etc.
  • Multi-language: Support for English, Spanish, French, German, Italian, and Portuguese

Installation

  1. Install dependencies:
npm install
  1. Build the node:
npm run build
  1. Copy the dist folder to your n8n custom nodes directory

Setup

  1. Get an API key from OpenRouter
  2. Add the OpenRouter API credentials in n8n
  3. Use the "Extract Menu Data" node in your workflow

Installation in n8n

  1. Go to SettingsCommunity nodes
  2. Click Install
  3. Enter package name: n8n-nodes-extract-menu-data
  4. Check the risk acknowledgment checkbox
  5. Click Install

Usage

Basic Usage

  1. Add the "Extract Menu Data" node to your workflow
  2. Configure the OpenRouter API credentials
  3. Input your menu content (text, HTML, or image URL)
  4. Select the appropriate content type
  5. Choose your preferred AI model
  6. Execute the workflow

Input Parameters

  • Menu Content: The menu data to extract from
  • Content Type:
    • Text: Plain text menu
    • HTML: HTML formatted menu
    • Image URL: URL to menu image
  • AI Model: Choose from available models (GPT-4, Claude, Gemini)
  • Include Additional Fields: Toggle for extra fields like allergens, ingredients
  • Language: Language of the menu content

Output Format

{
  "restaurant_name": "Restaurant Name",
  "menu_categories": [
    {
      "category_name": "Appetizers",
      "items": [
        {
          "product_title": "Caesar Salad",
          "product_price": "12.99",
          "currency": "USD",
          "description": "Fresh romaine lettuce with caesar dressing",
          "allergens": ["dairy", "eggs"],
          "vegetarian": true,
          "vegan": false,
          "gluten_free": false
        }
      ]
    }
  ],
  "extraction_metadata": {
    "total_categories": 5,
    "total_items": 25,
    "extraction_date": "2024-01-01T00:00:00.000Z",
    "confidence_score": 0.95
  }
}

Supported AI Models

  • GPT-4 Vision (for image analysis)
  • GPT-4 Turbo
  • Claude 3 Opus/Sonnet/Haiku
  • Gemini Pro Vision

Error Handling

The node includes comprehensive error handling:

  • Invalid API keys
  • Network errors
  • Malformed responses
  • Missing required fields

Development

# Install dependencies
npm install

# Build
npm run build

# Watch for changes
npm run dev

# Lint
npm run lint

# Format
npm run format

License

MIT
"# n8n-nodes-extract-menu-data"

Discussion