EXIF — BMI API

Öffentliche BMI-API

Berechnet den Body-Mass-Index serverseitig. Unterstützt metric (kg/cm) und imperial (lbs/in), mit Kategorie-Label, gesundem Zielbereich und kompaktem Antwortschema.

Kurzbeschreibung

Die EXIF BMI API nimmt weight und height entgegen, optional units (metric | imperial) und precision (0–3), validiert Eingaben, rechnet ggf. Einheiten um und liefert BMI, Kategorie und den gesunden Gewichtsbereich (BMI 18.5–24.99) zurück.

Endpoint

https://exif.one/api/bmi (GET oder JSON-POST)

Parameter

  • weight – Zahl > 0 (kg bei metric, lbs bei imperial)
  • height – Zahl > 0 (cm bei metric, inches bei imperial)
  • units – optional, metric (Standard) oder imperial
  • precision – optional, 0–3 Nachkommastellen (Standard: 2)

Kategorien (DE)

  • < 18.5: Untergewicht
  • 18.5–24.99: Normalgewicht
  • 25–29.99: Übergewicht
  • 30–34.99: Adipositas Grad I
  • 35–39.99: Adipositas Grad II
  • ≥ 40: Adipositas Grad III

Sicherheit & Limits

  • Gehärtete Header (CSP, HSTS, X-Frame-Options, nosniff, Referrer-Policy, XSS-Protection)
  • Strikte Validierung & Einheiten-Konvertierung (kg/cm bzw. lbs/in)
  • Rate-Limit (Rolling Window): Standard-Konfiguration $MAX_REQUESTS = 2 pro Fenster $WINDOW = 5 (Sekunden)
  • CORS: aktuell Access-Control-Allow-Origin: * (einfach einbindbar)
  • Kein Server-Caching (API-Antworten: no-store)

API — Kopierbare Beispiele

Wähle deinen Anwendungsfall – per Klick kopieren.

GET (metric: kg/cm)

https://exif.one/api/bmi?weight=75&height=175&units=metric&precision=2 # cURL curl -s "https://exif.one/api/bmi?weight=75&height=175&units=metric&precision=2" # JavaScript (fetch) const url = "https://exif.one/api/bmi?weight=75&height=175&units=metric&precision=2"; const res = await fetch(url, { headers: { "Accept":"application/json" } }); if(!res.ok) throw new Error(await res.text()); const json = await res.json(); console.log(json);

GET (imperial: lbs/in)

https://exif.one/api/bmi.php?weight=170&height=70&units=imperial&precision=2 # entspricht ~77.11 kg und 1.778 m # cURL curl -s "https://exif.one/api/bmi?weight=170&height=70&units=imperial&precision=2" # JavaScript (fetch) const url = "https://exif.one/api/bmi?weight=170&height=70&units=imperial&precision=2"; const res = await fetch(url, { headers: { "Accept":"application/json" } }); if(!res.ok) throw new Error(await res.text()); const json = await res.json(); console.log(json);

JSON-POST

# cURL curl -s -X POST "https://exif.one/api/bmi" \ -H "Content-Type: application/json" \ -d '{ "weight": 75, "height": 175, "units": "metric", "precision": 2 }' # JavaScript (fetch) const endpoint = "https://exif.one/api/bmi"; const res = await fetch(endpoint, { method: "POST", headers: { "Content-Type":"application/json", "Accept":"application/json" }, body: JSON.stringify({ weight: 75, height: 175, units: "metric", precision: 2 }) }); if(!res.ok) throw new Error(await res.text()); const json = await res.json(); console.log(json);

Beispiel-Antwort (200)

{ "status": "ok", "data": { "bmi": 24.49, "bmi_formatted": "24.49", "category": "Normalgewicht", "height_m": 1.75, "weight_kg": 75.0, "healthy_weight_range_kg": { "min": 56.66, "max": 76.56 }, "inputs": { "provided_units": "metric", "precision": 2, "raw_input": { "weight": 75, "height": 175 } }, "advice_short": "Gewicht im Normbereich. Achte weiter auf Ernährung und Bewegung." }, "meta": { "server_time_utc": "2025-10-17T14:00:00Z", "client_ip_sanitized": "203.0.113.45" } }

Beispiel-Fehler (400)

{ "status": "error", "message": "weight and height are required. Example: ?weight=75&height=175" }