Aller au contenu
GET /v1/percent

Percent composition

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/molarmass-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/molarmass-api/v1/percent" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/molarmass-api/v1/percent", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/molarmass-api/v1/percent");
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/molarmass-api/v1/percent",
    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": "Mass percent = (element mass in one mole / molar mass) × 100. With a sample mass, the mass of each element is given too.",
        "inputs": {
            "formula": "C6H12O6",
            "sample_mass_g": 100,
            "molar_mass_g_mol": 180.156
        },
        "composition": [
            {
                "mass_g": 40.001998,
                "element": "C",
                "percent": 40.001998
            },
            {
                "mass_g": 6.714181,
                "element": "H",
                "percent": 6.714181
            },
            {
                "mass_g": 53.283821,
                "element": "O",
                "percent": 53.283821
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:05.015Z",
        "request_id": "e9bd47a0-c1af-4f3c-b8ff-e914e0374739"
    },
    "status": "ok",
    "message": "Percent comp",
    "success": true
}