Menu Health Monitoring
The /report endpoint analyzes an entire restaurant menu and returns a comprehensive quality assessment. Use it to catch data issues before they reach customers.
What the report covers
- Noise detection - promo text, prices, serving sizes, formatting junk embedded in item names
- Duplicates - items that are the same dish under different spellings or transliterations
- Non-food items - pharmacy, grocery, or merchandise items that shouldn't be in a food menu
- Cuisine classification - breakdown of cuisine types across the menu
- Quality score - single 0-100 number summarizing overall menu health
Basic usage
import requests
API_KEY = "YOUR_KEY"
BASE = "https://embed.statode.com"
headers = {"X-API-Key": API_KEY, "Content-Type": "application/json"}
resp = requests.post(f"{BASE}/report", headers=headers,
json={"items": full_menu, "restaurant_name": "My Restaurant"})
report = resp.json()
print(f"Quality score: {report['quality_score']}/100")
print(f"Noisy items: {report['noise_analysis']['items_with_noise']}")
print(f"Duplicates: {report['dedup_summary']['total_duplicate_items']}")
print(f"Non-food items: {len(report['non_food_items'])}")
Setting up scheduled monitoring
Run the report daily or weekly to catch issues from menu imports:
import json
from datetime import datetime
def run_health_check(menu_items, restaurant_name):
resp = requests.post(f"{BASE}/report", headers=headers,
json={"items": menu_items, "restaurant_name": restaurant_name})
report = resp.json()
# Alert if quality drops
if report["quality_score"] < 70:
send_alert(f"{restaurant_name} quality score dropped to {report['quality_score']}")
# Log for trend tracking
log_entry = {
"timestamp": datetime.now().isoformat(),
"restaurant": restaurant_name,
"score": report["quality_score"],
"duplicates": report["dedup_summary"]["total_duplicate_items"],
"noisy": report["noise_analysis"]["items_with_noise"],
"non_food": len(report["non_food_items"])
}
with open("menu_health_log.jsonl", "a") as f:
f.write(json.dumps(log_entry) + "\n")
return report
Quality score interpretation
| Score | Rating | Action |
|---|---|---|
| 90-100 | Excellent | No action needed |
| 70-89 | Good | Review flagged items when convenient |
| 50-69 | Needs attention | Clean up duplicates and noise this week |
| Below 50 | Poor | Immediate cleanup required |
Common issues
Promo text noise - Items like "NEW 50% OFF Chicken Biryani (Serves 2)" should just be "Chicken Biryani". The report flags these so you can clean your source data.
Duplicates from multi-source import - When the same restaurant feeds data from Zomato, Swiggy, and their POS, each source uses slightly different names. The report catches these overlaps.
Non-food items from POS categories - POS systems often include "Tissue Paper", "Packaging Charge", or "Delivery Fee" as menu items. The report identifies these for removal.
Missing cuisine signal - If the cuisine breakdown shows "unknown" for many items, the item names may be too noisy or abbreviated for classification.
Limits
- Up to 2,000 items per report request
- For larger menus, split by restaurant or outlet and run separate reports