Taste Testing Module

The taste endpoints let you analyze and compare finished dishes and ingredients.

Analyzing a Dish

POST /v1/taste/analyze

Analyze the flavor profile of any dish or ingredient in your session.

import requests

API_BASE = "https://api.tomatopy.pizza/v1"
HEADERS = {
    "Content-Type": "application/json",
    "X-API-Key": "your-api-key",
    "X-Session-ID": "your-session-id"
}

# Basic analysis
response = requests.post(f"{API_BASE}/taste/analyze", headers=HEADERS, json={
    "dish_id": "bkd_vwx234",
    "depth": "basic"
})
profile = response.json()

print(f"Sweetness: {profile['sweetness']}")  # 0.3
print(f"Acidity: {profile['acidity']}")      # 0.7
print(f"Umami: {profile['umami']}")          # 0.8

Comprehensive Analysis

Include aroma and texture data for a fuller picture:

Request Body

Field
Type
Required
Description

dish_id

string

yes

ID of any dish or ingredient in the session

depth

string

no

"basic" or "comprehensive" (default: "basic")

include_aroma

boolean

no

Include aroma analysis (default: false)

include_texture

boolean

no

Include texture analysis (default: false)

Comparing Dishes

POST /v1/taste/compare

Compare multiple dishes or ingredients side by side on specific metrics.

Request Body

Field
Type
Required
Description

dish_ids

array of strings

yes

IDs of dishes to compare (minimum 2)

metrics

array of strings

yes

Metrics to compare (e.g., "sweetness", "acidity", "umami", "aroma", "texture")

Analyzing Different Stages

You can analyze ingredients at any stage of the pipeline -- raw tomatoes, sliced tomatoes, sauces, or finished pizzas:

Error Handling

Best Practices

  1. Choose the Right Depth

    Use "basic" for quick checks and "comprehensive" when you need full details. Comprehensive analysis includes more data but takes longer.

  2. Compare at the Same Stage

    For meaningful comparisons, compare dishes at the same pipeline stage (e.g., sauce vs sauce, not sauce vs raw tomato).

  3. Use Aroma and Texture for Final Products

Endpoint Reference

Endpoint
Method
Description

/v1/taste/analyze

POST

Analyze flavor profile of a dish

/v1/taste/compare

POST

Compare multiple dishes on specific metrics

Next Steps

Last updated

Was this helpful?