/v1/recipe
Recipe & per-portion cost
Δοκιμάστε το ζωντανά
10 δωρεάν κλήσεις την ημέρα — χωρίς εγγραφή, χωρίς κλειδί API. Μέσω του gateway του oanor.
Δουλεύει. Πάρε ένα κλειδί API και χρησιμοποίησέ το στο έργο σου.
Λάβετε ένα κλειδί APIΑποσπάσματα κώδικα
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_..."}
)
Παράδειγμα απόκρισης
Πραγματική απόκριση αυτού του endpoint, από τον τελευταίο έλεγχο υγείας.
{
"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
}