Cardio Risk Prediction API v1

This service predicts the probability of cardiovascular disease from basic clinical and lifestyle features. Send a POST request to /predict with a JSON body and receive a risk score.

Endpoint

POST https://cvd-detector-main.fly.dev/predict

Request body

Required JSON fields:

  • age_years – age of the patient in years
  • gender – 1 = female, 2 = male
  • height – height in cm
  • weight – weight in kg
  • ap_hi – systolic blood pressure
  • ap_lo – diastolic blood pressure
  • cholesterol – 1, 2 or 3
  • gluc – 1, 2 or 3
  • smoke – 0 or 1
  • alco – 0 or 1
  • active – 0 or 1

Example JSON:

{
  "age_years": 52.0,
  "gender": 2,
  "height": 170,
  "weight": 80.0,
  "ap_hi": 130,
  "ap_lo": 80,
  "cholesterol": 2,
  "gluc": 1,
  "smoke": 0,
  "alco": 0,
  "active": 1
}

Response

The API returns a JSON object:

{
  "cardio_prediction": 1,        // 0 = no disease, 1 = disease
  "cardio_probability": 0.73     // probability of disease
}