Vai al contenuto
GET /v1/recipe

Recipe & per-portion cost

Provalo dal vivo

10 chiamate gratuite al giorno — senza registrazione, senza chiave API. Passa dal gateway oanor.

Intestazioni personalizzate (facoltative)
api.oanor.com/foodcost-api

Funziona. Prendi una chiave API e usala nel tuo progetto.

Ottieni una chiave API

Frammenti di codice

curl "https://api.oanor.com/foodcost-api/v1/recipe" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/foodcost-api/v1/recipe", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/foodcost-api/v1/recipe");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/foodcost-api/v1/recipe",
    headers={"x-oanor-key": "oanor_test_..."}
)

Risposta di esempio

Una risposta reale di questo endpoint, acquisita dall'ultimo health check.

{
    "data": {
        "note": "Recipe cost = Σ ingredient line costs, divided by the yield factor (1 − waste%) and the portions. Yield loss raises the true cost per usable plate.",
        "inputs": {
            "portions": 4,
            "ingredients": 3,
            "waste_percent": 10
        },
        "raw_cost": 4.5,
        "cost_per_portion": 1.25,
        "yield_adjusted_cost": 5
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:48.001Z",
        "request_id": "6be51d9c-4bd2-4d53-8244-733349dc24b3"
    },
    "status": "ok",
    "message": "Recipe cost",
    "success": true
}