/v1/cn-ratio
Blended carbon-to-nitrogen ratio
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/compost-api/v1/cn-ratio" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/compost-api/v1/cn-ratio", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/compost-api/v1/cn-ratio");
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/compost-api/v1/cn-ratio",
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": "Blended C:N = total carbon mass ÷ total nitrogen mass, where each material contributes weight × its dry-weight %. Aim for about 25–35:1 — greens (grass, manure, kitchen scraps) are nitrogen-rich and low C:N, browns (dry leaves, straw, cardboard) are carbon-rich and high C:N. Pass dry-weight %C and %N for each material as parallel comma-separated lists.",
"inputs": {
"weights": [
10,
10
],
"carbon_pct": [
50,
45
],
"nitrogen_pct": [
1,
2.5
]
},
"cn_ratio": 27.1,
"assessment": "ideal — heats up and breaks down efficiently",
"carbon_mass": 9.5,
"nitrogen_mass": 0.35
},
"meta": {
"timestamp": "2026-06-06T15:30:45.744Z",
"request_id": "f85a3afd-afd6-4c68-8fd6-a691f3f716e0"
},
"status": "ok",
"message": "C:N ratio",
"success": true
}