Zum Inhalt springen
GET /v1/recipe

Recipe & per-portion cost

Live testen

10 freie Calls pro Tag — keine Anmeldung, kein API-Key. Geht durchs oanor-Gateway.

Eigene Header (optional)
api.oanor.com/foodcost-api

Funktioniert. Hol dir einen API-Key und nutze sie in deinem Projekt.

API-Key holen

Code-Snippets

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_..."}
)

Beispiel-Response

Echte Antwort dieses Endpoints, erfasst beim letzten 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
}