Allergen Nutrition Extractor

    by bd

    1

    Extracts allergens and nutrition facts from food PDFs into structured JSON using OCR and evidence-based mapping.

    Free

    Security scanned

    Works with the AI Agents you already use

    Allergen Nutrition Extractor

    Example session with this skill installed

    Extract allergens and nutrition data from the attached 'snack_label.pdf'. Output in JSON format.

    • Read your context and instructions
    • Compiled the allergen nutrition extractor

    I have processed the PDF using the text extraction script. The document was identified as a product label for "Almond Crunch Bar." I have mapped the ingredients and nutrition facts to the required JSON schema.

    Extracted Product Data

    {
      "product_name": "Almond Crunch Bar",
      "source_note": "Page 1",
      "allergens": [
        {
          "group": "cereals_containing_gluten",
          "status": "contains",
          "notes": "Contains whole grain oats"
        },
        {
          "group": "peanuts",
          "status": "may_contain",
          "notes": "Precautionary statement: 'Produced in a facility that also processes peanuts'"
        },
        {
          "group": "nuts",
          "status": "contains",
          "notes": "Contains almonds"
        },
        {
          "group": "milk",
          "status": "unknown",
          "notes": "Not specified in the document"
        }
      ],
      "nutrition": {
        "serving_basis": "per 100g",
        "energy_kj": 1845,
        "energy_kcal": 441,
        "fat_g": 18.2,
        "saturates_g": 2.1,
        "carbohydrates_g": 56.4,
        "sugars_g": 22.0,
        "protein_g": 8.5,
        "salt_g": 0.45
      }
    }
    

    Next steps

    1. Verify the may_contain status for peanuts against your specific regional labeling requirements.
    2. Confirm the milk status with the manufacturer as it was not mentioned in the specification.
    3. Cross-reference the fat decimal precision with the physical label to ensure OCR accuracy.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Extracting structured data from messy food labels and specification sheets is error-prone and slow. This skill automates the extraction of allergens and nutrition facts from text-based or scanned PDFs into valid JSON.

    What it does

    • Automated OCR handles scanned documents using Tesseract when embedded text is missing or insufficient.
    • Bilingual processing supports English and Hungarian documents, identifying ingredient lists and precautionary statements.
    • Evidence-based extraction classifies allergens into 14 regulatory groups based on specific document evidence.
    • Nutrition mapping captures product names, decimal values, and units (per 100g or per serving) exactly as stated.
    • Confidence labeling distinguishes between confirmed ingredients, precautionary "may contain" warnings, and unknown statuses.

    How it works

    1. Run the extract_text.py script on a local food product PDF to pull text or perform OCR.
    2. The skill analyzes the extracted text against a reference allergen list and the provided JSON schema.
    3. It maps ingredients to specific allergen categories while preserving original nutrition decimals and units.
    4. It outputs a structured JSON object containing the product metadata, allergen status, and nutrition table.

    Frameworks & tools

    Built for Python environments requiring pypdf, pdf2image, pytesseract, and Pillow. It relies on system-level Poppler and Tesseract OCR utilities for processing scanned images.

    Why this beats prompting it yourself

    Generic prompts often hallucinate the absence of allergens or fail to distinguish between "contains" and "may contain" warnings. This skill enforces a strict evidence-only policy, preventing the AI from inferring safety where the document is silent.

    Use cases

    • Automating the intake of supplier product specification sheets.
    • Building a database from scanned retail food labels.
    • Auditing ingredient lists for regulatory allergen compliance.

    Known limitations

    Does not provide food-safety guarantees or professional reviews. Requires Tesseract and Poppler installed on the host system for OCR functionality.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 8 days ago

    • Free with an Agensi account

    Software
    Python

    Permissions

    Terminal / Shell
    Write Files
    Listed8 days ago

    What's inside

    Creator

    B

    bd

    Frequently Asked Questions

    The skill extracts 14 specific regulatory allergen groups and maps nutrition data including product names, decimal values, and units (per 100g or serving) directly into a structured JSON schema.

    Unlike generic AI prompts, this skill uses an evidence-based extraction policy that distinguishes between confirmed ingredients and "may contain" warnings while preventing the AI from hallucinating safety when information is missing.

    Yes, the skill includes a built-in OCR pipeline using Tesseract to process scanned labels and images within PDFs, ensuring data is captured even when embedded text is unavailable.

    You will receive the core Python processing scripts, the evidence-based mapping logic, and the JSON schema required to integrate this skill into your local AI agent or automated workflow.

    The skill requires a Python environment with pypdf and Pillow, as well as system-level installations of Tesseract OCR and Poppler for handling image-to-text conversions.

    Currently, the skill is optimized for bilingual processing in English and Hungarian, supporting ingredient lists and precautionary statements in both languages.

    New in APIs & Backend

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.

    Free