arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Quick Start Guide

Get up and running with the PizzaStack API in minutes! This guide walks you through making your first virtual pizza using HTTP requests.

circle-info

PizzaStackarrow-up-right is TomatoPy's pizza-making HTTP API. Acquire, prepare, cook, and assemble virtual pizzas programmatically.

hashtag
Basic Usage

hashtag
Acquiring Your First Tomato

hashtag
Slicing Your Tomato

Tomatoes must be sliced before they can be used in cooking operations.

hashtag
Simmering a Sauce

hashtag
Creating a Pizza Base

hashtag
Assembling the Pizza

hashtag
Baking the Pizza

hashtag
Taste Testing

hashtag
Next Steps

  • - Learn about core PizzaStack API concepts

  • - Follow a complete tutorial

  • - Explore the full API

hashtag
Tips and Tricks

Pro Tip: Use the session debug endpoint to inspect the state of all objects in your session:

Note: All measurements in the PizzaStack API use the metric system by default. Weights are in grams, temperatures in Celsius, and volumes in milliliters.

Basic Concepts
Making Your First Sauce
API Endpoints
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"
}

# Acquire a fresh tomato
response = requests.post(f"{API_BASE}/tomato/acquire", headers=HEADERS, json={
    "variety": "San Marzano",
    "ripeness": 0.8,
    "weight": 150
})
tomato = response.json()

print(tomato["id"])        # "tom_abc123"
print(tomato["variety"])   # "San Marzano"
print(tomato["ripeness"])  # 0.8
# Slice the tomato
response = requests.post(f"{API_BASE}/tomato/slice", headers=HEADERS, json={
    "tomato_ids": [tomato["id"]],
    "method": "dice",
    "size": "medium",
    "consistency": "uniform"
})
sliced = response.json()
# Simmer sliced tomatoes into a sauce
response = requests.post(f"{API_BASE}/cook/simmer", headers=HEADERS, json={
    "ingredients": [
        {"id": sliced["id"], "name": "tomato", "amount": 150, "unit": "g"}
    ],
    "temperature": 100,
    "duration": "30m"
})
sauce = response.json()
print(sauce["consistency"])  # "smooth"
# Create the pizza base
response = requests.post(f"{API_BASE}/pizza/base", headers=HEADERS, json={
    "thickness": "medium",
    "size": "12inch",
    "style": "neapolitan",
    "hydration": 0.65
})
base = response.json()
# Assemble the pizza
response = requests.post(f"{API_BASE}/pizza/assemble", headers=HEADERS, json={
    "base_id": base["id"],
    "sauce_id": sauce["id"],
    "toppings": [
        {"name": "mozzarella", "amount": 200, "unit": "g"},
        {"name": "basil", "amount": 10, "unit": "leaves"}
    ]
})
pizza = response.json()
# Bake the assembled pizza
response = requests.post(f"{API_BASE}/pizza/bake", headers=HEADERS, json={
    "pizza_id": pizza["id"],
    "temperature": 450,
    "duration": "2m"
})
baked = response.json()
print(baked["quality_score"])  # 0.92
# Analyze the final product
response = requests.post(f"{API_BASE}/taste/analyze", headers=HEADERS, json={
    "dish_id": baked["id"],
    "depth": "comprehensive",
    "include_aroma": True,
    "include_texture": True
})
profile = response.json()

print(profile["acidity"])    # 0.7
print(profile["sweetness"])  # 0.3
print(profile["umami"])      # 0.8
curl -H "X-API-Key: your-api-key" \
  https://api.tomatopy.pizza/v1/session/your-session-id/log