Aller au contenu
GET /v1/recipe

Recipe & per-portion cost

Essayez-le en direct

10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.

En-têtes personnalisés (facultatif)
api.oanor.com/foodcost-api

Ça marche. Récupérez une clé API et utilisez-la dans votre projet.

Obtenez une clé API

Extraits de code

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

Exemple de réponse

Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.

{
    "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
}