/v1/unit
Price per standard unit
Essayez-le en direct
10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.
Ça marche. Récupérez une clé API et utilisez-la dans votre projet.
Obtenez une clé APIExtraits de code
curl "https://api.oanor.com/unitprice-api/v1/unit" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/unitprice-api/v1/unit", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/unitprice-api/v1/unit");
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/unitprice-api/v1/unit",
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": "Unit price = pack price ÷ total quantity. Multipacks multiply size by count.",
"input": {
"size": 500,
"unit": "g",
"count": 1,
"price": 3,
"measure": "weight"
},
"unit_price": {
"per_g": 0.006,
"per_kg": 6,
"per_lb": 2.7216,
"per_100g": 0.6
},
"total_base_quantity": 500
},
"meta": {
"timestamp": "2026-06-04T01:59:20.297Z",
"request_id": "6074fb9e-00fd-414f-9825-f0c8cb1abb64"
},
"status": "ok",
"message": "Unit price",
"success": true
}