RESTful API for cardiac risk assessment, food recognition, health tracking, medication management, and PDF report generation. Built for African health applications.
Our API gives you access to the same AI models that power HeartAfrika. Integrate into hospital systems, mobile apps, wellness platforms, and research projects across Africa.
Embed cardiac risk scoring into Electronic Medical Records. Submit patient vitals (age, BP, cholesterol, BMI, HbA1c, etc.) and receive instant risk scores and categories.
Add heart risk assessment, food recognition (AI-powered image analysis), and health tracking to any mobile or web health application.
Offer employees heart health screening via bulk assessments. Export assessment data as CSV for HR reporting and wellness analytics.
Use our cardiovascular risk models built for African populations. Access health summary analytics and assessment trend data via API.
Connect your own WhatsApp bot to our assessment engine via the webhook endpoint. Users complete assessments entirely within WhatsApp.
import requests
# Create a cardiac risk assessment
response = requests.post(
"https://heartafrika.xyz/cardio/api/v1/assessments",
headers={
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"age": 45,
"sex": "male",
"systolic_bp": 135,
"diastolic_bp": 85,
"pulse_rate": 72,
"respiratory_rate": 16,
"height": 175,
"weight": 82,
"cholesterol": 220,
"smoker": False,
"diabetic": False,
"family_history": True
}
)
result = response.json()
# {
# "assessment": {
# "risk_score": 32.4,
# "risk_category": "moderate",
# "bmi": 26.8,
# ...
# }
# }
All endpoints use base URL https://heartafrika.xyz/cardio/api/v1 and require an X-API-Key header.
Submit vitals (age, sex, BP, cholesterol, BMI, HbA1c, lifestyle) and receive a risk score + category.
List all assessments for the authenticated user with pagination (limit & offset).
Export all assessment data as CSV for reporting and analytics.
Upload a food image for AI-powered recognition with nutritional information and heart-health score.
Search the Nigerian food database by name. Returns calories, protein, carbs, fat, and heart-healthy flag.
Aggregated health summary: food logs, activity entries, heart-healthy eating ratio, and trends.
Generate and download a detailed PDF cardiac risk report for any assessment.
Create medication reminders with dosage, frequency, and stock tracking. Mark taken or skipped.
AI-generated health recommendations based on assessment results. Track read and completion status.
All plans include API key management, usage stats, and the full endpoint suite. Upgrade anytime from your dashboard.
Generate API keys from your HeartAfrika dashboard. Include your key in every request header. Keys are scoped to your plan with automatic rate limiting.
# Authenticate with API Key header
curl -X POST \
https://heartafrika.xyz/cardio/api/v1/assessments \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"age": 52,
"sex": "female",
"systolic_bp": 140,
"diastolic_bp": 90,
"pulse_rate": 78,
"respiratory_rate": 18,
"height": 165,
"weight": 74,
"cholesterol": 240
}'
# Check your API usage
curl https://heartafrika.xyz/cardio/api/v1/api-usage \
-H "X-API-Key: YOUR_API_KEY"
Sign up for a free account, generate your API key, and start building in minutes.