API Endpoints
Complete reference for all Kantesti Blood Test API endpoints with code examples in multiple languages.
https://app.aibloodtestinterpret.com
Changelog
Track API versions, updates, and migration information. Use the recommended endpoints for new integrations.
Current Stable Endpoints
These endpoints are recommended for production use and new integrations.
| API | Endpoint | Status |
|---|---|---|
| Blood Test Analysis v11 | /api/v11/01-06-2025/analyze |
Recommended |
| Blood Test Analysis (Health Score) v11 | /api/v11/health-score/analyze |
Recommended |
| Nutrition Diet AI v1 | /api/v1/nutrition/diet-plan/analyze |
Stable |
| AI Blood Test Comparison v1 | /api/v1/bloodtest/comparison/analyze |
Stable |
| Family Health Risk Assessment v1 | /api/v1/family-health/analyze |
Released 23.03.2026 |
| ICR - Intelligent Character Recognition v1 | /api/icr/v1/extract |
Released 14.02.2026 |
| ICR Kan - Blood Test Extraction v1 | /api/icr/v1/kan |
Released 14.02.2026 |
| Trend Analysis v1 | /api/v1/analytics/trends/analyze |
Stable |
Version History
| Date | Version | Changes |
|---|---|---|
| March 2026 | Family Health v1 | Family Health Risk Assessment API released — AI-powered hereditary risk analysis, 100+ language support, family tree analysis, preventive care timeline, genetic screening recommendations, sandbox mode |
| February 2026 | ICR v1 | ICR (Intelligent Character Recognition) API released — 79% faster than OCR, structured JSON output, document type detection, table extraction, Kan blood test integration |
| December 2025 | Latest | Improved error handling, 98.7% accuracy, 100 language support |
| June 2025 | v11 | v11 Blood Test Analysis, health score endpoint, multi-file support |
| April 2025 | v9 | api_parameters_v9 model, enhanced parameter extraction |
| March 2025 | v8 | Multi-file upload support, batch processing |
Legacy Endpoints
These endpoints are maintained for backward compatibility but are not recommended for new integrations.
| Version | Endpoint | Status |
|---|---|---|
| v10 | /api/v10/health-score/analyze |
Legacy |
| v9 | /api/v9/14-04-2025/analyze |
Legacy |
| v8 | /api/v8/31-03-2025/analyze |
Legacy |
| v6 | /api/v6-1/21-11-2024/analyze |
Legacy |
| v3 | /api/v3/10-10-2024/analyze |
Legacy |
Legacy endpoints are maintained for backward compatibility but are not recommended for new integrations. Please migrate to the current stable endpoints for better performance and support.
Supported Languages Reference
The Kantesti API supports 100 languages for response localization. Use the language parameter with any ISO 639-1 code listed below. If not specified, responses default to English (en).
If no language parameter is provided, the API returns responses in English (en).
Major World Languages
| Code | Language | Native Name |
|---|---|---|
en | English | English |
zh | Chinese | 中文 |
es | Spanish | Español |
ar | Arabic | العربية |
hi | Hindi | हिन्दी |
pt | Portuguese | Português |
ru | Russian | Русский |
ja | Japanese | 日本語 |
fr | French | Français |
de | German | Deutsch |
ko | Korean | 한국어 |
tr | Turkish | Türkçe |
European Languages
| Code | Language | Native Name |
|---|---|---|
it | Italian | Italiano |
nl | Dutch | Nederlands |
pl | Polish | Polski |
el | Greek | Ελληνικά |
sv | Swedish | Svenska |
no | Norwegian | Norsk |
da | Danish | Dansk |
fi | Finnish | Suomi |
cs | Czech | Čeština |
uk | Ukrainian | Українська |
ro | Romanian | Română |
hu | Hungarian | Magyar |
bg | Bulgarian | Български |
hr | Croatian | Hrvatski |
sk | Slovak | Slovenčina |
sl | Slovenian | Slovenščina |
sr | Serbian | Српски |
lt | Lithuanian | Lietuvių |
lv | Latvian | Latviešu |
et | Estonian | Eesti |
ca | Catalan | Català |
eu | Basque | Euskara |
gl | Galician | Galego |
cy | Welsh | Cymraeg |
ga | Irish | Gaeilge |
is | Icelandic | Íslenska |
mt | Maltese | Malti |
sq | Albanian | Shqip |
mk | Macedonian | Македонски |
bs | Bosnian | Bosanski |
lb | Luxembourgish | Lëtzebuergesch |
be | Belarusian | Беларуская |
Middle Eastern & Central Asian Languages
| Code | Language | Native Name |
|---|---|---|
he | Hebrew | עברית |
fa | Persian | فارسی |
az | Azerbaijani | Azərbaycan |
ka | Georgian | ქართული |
hy | Armenian | Հայերdelays |
kk | Kazakh | Қазақша |
uz | Uzbek | Oʻzbek |
tg | Tajik | Тоҷикӣ |
ky | Kyrgyz | Кыргызча |
tk | Turkmen | Türkmen |
mn | Mongolian | Монгол |
ps | Pashto | پښتو |
ku | Kurdish | Kurdî |
South Asian Languages
| Code | Language | Native Name |
|---|---|---|
bn | Bengali | বাংলা |
ta | Tamil | தமிழ் |
te | Telugu | తెలుగు |
mr | Marathi | मराठी |
gu | Gujarati | ગુજરાતી |
kn | Kannada | ಕನ್ನಡ |
ml | Malayalam | മലയാളം |
pa | Punjabi | ਪੰਜਾਬੀ |
ur | Urdu | اردو |
ne | Nepali | नेपाली |
si | Sinhala | සිංහල |
sd | Sindhi | سنڌي |
as | Assamese | অসমীয়া |
or | Odia | ଓଡ଼ିଆ |
Southeast Asian Languages
| Code | Language | Native Name |
|---|---|---|
id | Indonesian | Bahasa Indonesia |
th | Thai | ไทย |
vi | Vietnamese | Tiếng Việt |
ms | Malay | Bahasa Melayu |
my | Myanmar (Burmese) | မြန်မာ |
km | Khmer | ភាសាខ្មែរ |
lo | Lao | ລາວ |
fil | Filipino | Filipino |
tl | Tagalog | Tagalog |
jv | Javanese | Basa Jawa |
su | Sundanese | Basa Sunda |
African Languages
| Code | Language | Native Name |
|---|---|---|
af | Afrikaans | Afrikaans |
sw | Swahili | Kiswahili |
am | Amharic | አማርኛ |
ha | Hausa | Hausa |
yo | Yoruba | Yorùbá |
ig | Igbo | Igbo |
zu | Zulu | isiZulu |
xh | Xhosa | isiXhosa |
so | Somali | Soomaali |
mg | Malagasy | Malagasy |
Other Languages
| Code | Language | Native Name |
|---|---|---|
la | Latin | Latina |
eo | Esperanto | Esperanto |
yi | Yiddish | ייִדיש |
ht | Haitian Creole | Kreyòl Ayisyen |
mi | Maori | Te Reo Māori |
sm | Samoan | Gagana Samoa |
to | Tongan | Lea Faka-Tonga |
haw | Hawaiian | ʻŌlelo Hawaiʻi |
Blood Test Analysis API
Analyze blood test images or PDFs using AI to extract parameters and generate comprehensive medical interpretations.
Production endpoint for blood test analysis. Consumes 1 credit per request.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Your API username |
password | string | Yes | Your API password |
file | file | Yes | Blood test image (PNG, JPG, WEBP) or PDF. Max 20MB. |
language | string | No | Response language code (default: en). See supported languages. |
cURL Example
curl -X POST "https://app.aibloodtestinterpret.com/api/v11/01-06-2025/analyze" \
-F "username=YOUR_USERNAME" \
-F "password=YOUR_PASSWORD" \
-F "language=en" \
-F "file=@blood_test.pdf"
Python Example
import requests
def analyze_blood_test(file_path: str, username: str, password: str, language: str = "en"):
"""
Analyze a blood test file using Kantesti API.
Args:
file_path: Path to the blood test PDF or image
username: API username
password: API password
language: Response language code (default: en)
Returns:
dict: API response with analysis results
"""
url = "https://app.aibloodtestinterpret.com/api/v11/01-06-2025/analyze"
with open(file_path, "rb") as f:
files = {"file": (file_path, f, "application/pdf")}
data = {
"username": username,
"password": password,
"language": language
}
response = requests.post(url, files=files, data=data, timeout=120)
response.raise_for_status()
return response.json()
# Example usage
if __name__ == "__main__":
result = analyze_blood_test(
file_path="blood_test.pdf",
username="your_username",
password="your_password",
language="en"
)
print(f"Status: {result['status']}")
print(f"Parameters found: {len(result['data']['parameters'])}")
C++ Example (libcurl)
#include <iostream>
#include <string>
#include <curl/curl.h>
size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* userp) {
userp->append((char*)contents, size * nmemb);
return size * nmemb;
}
std::string analyzeBloodTest(const std::string& filePath,
const std::string& username,
const std::string& password,
const std::string& language = "en") {
CURL* curl = curl_easy_init();
std::string response;
if (curl) {
curl_mime* form = curl_mime_init(curl);
curl_mimepart* field;
// Add username
field = curl_mime_addpart(form);
curl_mime_name(field, "username");
curl_mime_data(field, username.c_str(), CURL_ZERO_TERMINATED);
// Add password
field = curl_mime_addpart(form);
curl_mime_name(field, "password");
curl_mime_data(field, password.c_str(), CURL_ZERO_TERMINATED);
// Add language
field = curl_mime_addpart(form);
curl_mime_name(field, "language");
curl_mime_data(field, language.c_str(), CURL_ZERO_TERMINATED);
// Add file
field = curl_mime_addpart(form);
curl_mime_name(field, "file");
curl_mime_filedata(field, filePath.c_str());
curl_easy_setopt(curl, CURLOPT_URL,
"https://app.aibloodtestinterpret.com/api/v11/01-06-2025/analyze");
curl_easy_setopt(curl, CURLOPT_MIMEPOST, form);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 120L);
CURLcode res = curl_easy_perform(curl);
curl_mime_free(form);
curl_easy_cleanup(curl);
}
return response;
}
int main() {
std::string result = analyzeBloodTest("blood_test.pdf", "username", "password");
std::cout << result << std::endl;
return 0;
}
Postman Configuration
{
"info": {
"name": "Kantesti Blood Test API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Analyze Blood Test",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{"key": "username", "value": "{{api_username}}", "type": "text"},
{"key": "password", "value": "{{api_password}}", "type": "text"},
{"key": "language", "value": "en", "type": "text"},
{"key": "file", "type": "file", "src": "/path/to/blood_test.pdf"}
]
},
"url": {
"raw": "https://app.aibloodtestinterpret.com/api/v11/01-06-2025/analyze",
"protocol": "https",
"host": ["app", "aibloodtestinterpret", "com"],
"path": ["api", "v11", "01-06-2025", "analyze"]
}
}
}
]
}
Example Response
{
"status": "success",
"data": {
"metadata": {
"patient_name": "Jan Novák",
"lab_name": "BioLAB Medical Center",
"lab_city": "Prague",
"lab_country": "Czech Republic",
"lab_date": "2025-05-11",
"patient_age": "45",
"patient_sex": "Male"
},
"parameters": [
{
"short_name": "WBC",
"long_name": "White Blood Cell Count",
"category": "Complete Blood Count",
"result": 7.2,
"unit": "10^9/L",
"evaluation": "normal",
"range_min": 2.0,
"range_max": 12.0,
"range_normal_min": 4.0,
"range_normal_max": 10.0,
"short_description": "Measures the total white blood cells in blood.",
"long_description": "White blood cells (leukocytes) are essential for immune function..."
},
{
"short_name": "HGB",
"long_name": "Hemoglobin",
"category": "Complete Blood Count",
"result": 14.5,
"unit": "g/dL",
"evaluation": "normal",
"range_min": 10.0,
"range_max": 18.0,
"range_normal_min": 13.5,
"range_normal_max": 17.5,
"short_description": "Protein in red blood cells that carries oxygen.",
"long_description": "Hemoglobin is the iron-containing protein responsible for oxygen transport..."
}
],
"interpretation": [
{
"title": "Overall Health Assessment",
"shortcode": "overall_health_assessment",
"subsections": [
{
"subtitle": "Comprehensive Overview",
"shortcode": "overall_health_assessment_overview",
"items": [
{"item": "The patient demonstrates preserved overall organ function with normal hematological parameters."},
{"item": "No significant abnormalities detected in the complete blood count."}
]
}
]
}
]
},
"api_version": "v11",
"timestamp": "2025-12-22T10:30:00Z"
}
Response Fields Reference
Root Level
| Field | Type | Description |
|---|---|---|
status | string | "success" or "error" |
data | object | Contains all analysis results |
timestamp | string | ISO 8601 timestamp of response |
api_version | string | API version used for processing |
data.metadata Object
| Field | Type | Description |
|---|---|---|
lab_date | string | Blood collection date (YYYY-MM-DD) |
results_date | string | Results issue date (YYYY-MM-DD) |
lab_name | string | Laboratory name |
lab_city | string | Laboratory city |
lab_country | string | Laboratory country |
patient_name | string | Patient's full name (metadata only, not sent to interpretation) |
patient_age | string | Patient's age |
patient_sex | string | "male", "female", or "other" |
data.parameters Array Item
| Field | Type | Description |
|---|---|---|
category | string | Parameter category (e.g., "Complete Blood Count", "Lipid Panel") |
long_name | string | Full parameter name |
short_name | string | Abbreviated parameter name |
result | string | Measured value |
unit | string | Unit of measurement |
range_min | string | Minimum reference range |
range_max | string | Maximum reference range |
evaluation | string | Result status. See evaluation values |
data.interpretation Array Item
| Field | Type | Description |
|---|---|---|
title | string | Section title (e.g., "Overall Health Assessment") |
content | string | AI-generated medical interpretation |
Complete Response Example
{
"status": "success",
"data": {
"metadata": {
"patient_name": "Anna Müller",
"lab_name": "MedLab Diagnostics International",
"lab_city": "Munich",
"lab_country": "Germany",
"lab_date": "2025-12-15",
"results_date": "2025-12-16",
"patient_age": "38",
"patient_sex": "female"
},
"parameters": [
{
"short_name": "WBC",
"long_name": "White Blood Cell Count",
"category": "Complete Blood Count",
"result": "6.8",
"unit": "10^9/L",
"evaluation": "normal",
"range_min": "4.0",
"range_max": "11.0",
"range_normal_min": "4.5",
"range_normal_max": "10.0",
"short_description": "Measures the total number of white blood cells.",
"long_description": "White blood cells (leukocytes) are essential components of the immune system..."
},
{
"short_name": "RBC",
"long_name": "Red Blood Cell Count",
"category": "Complete Blood Count",
"result": "4.52",
"unit": "10^12/L",
"evaluation": "normal",
"range_min": "3.8",
"range_max": "5.8",
"range_normal_min": "4.0",
"range_normal_max": "5.5",
"short_description": "Measures the total number of red blood cells.",
"long_description": "Red blood cells (erythrocytes) carry oxygen from the lungs to body tissues..."
},
{
"short_name": "HGB",
"long_name": "Hemoglobin",
"category": "Complete Blood Count",
"result": "13.2",
"unit": "g/dL",
"evaluation": "normal",
"range_min": "11.5",
"range_max": "16.0",
"range_normal_min": "12.0",
"range_normal_max": "15.5",
"short_description": "Protein in red blood cells that carries oxygen.",
"long_description": "Hemoglobin is the iron-containing protein in red blood cells responsible for oxygen transport..."
},
{
"short_name": "HCT",
"long_name": "Hematocrit",
"category": "Complete Blood Count",
"result": "39.8",
"unit": "%",
"evaluation": "normal",
"range_min": "35.0",
"range_max": "47.0",
"range_normal_min": "36.0",
"range_normal_max": "44.0",
"short_description": "Percentage of blood volume occupied by red blood cells.",
"long_description": "Hematocrit measures the proportion of blood that consists of red blood cells..."
},
{
"short_name": "PLT",
"long_name": "Platelet Count",
"category": "Complete Blood Count",
"result": "245",
"unit": "10^9/L",
"evaluation": "normal",
"range_min": "150",
"range_max": "400",
"range_normal_min": "150",
"range_normal_max": "350",
"short_description": "Measures the number of platelets in blood.",
"long_description": "Platelets (thrombocytes) are essential for blood clotting and wound healing..."
},
{
"short_name": "GLU",
"long_name": "Fasting Glucose",
"category": "Metabolic Panel",
"result": "102",
"unit": "mg/dL",
"evaluation": "borderline_high",
"range_min": "70",
"range_max": "140",
"range_normal_min": "70",
"range_normal_max": "99",
"short_description": "Measures blood sugar level after fasting.",
"long_description": "Fasting glucose is a key indicator of how well the body metabolizes sugar..."
},
{
"short_name": "TC",
"long_name": "Total Cholesterol",
"category": "Lipid Panel",
"result": "218",
"unit": "mg/dL",
"evaluation": "borderline_high",
"range_min": "0",
"range_max": "300",
"range_normal_min": "0",
"range_normal_max": "200",
"short_description": "Measures total cholesterol in blood.",
"long_description": "Total cholesterol is the sum of HDL, LDL, and VLDL cholesterol levels..."
},
{
"short_name": "HDL",
"long_name": "HDL Cholesterol",
"category": "Lipid Panel",
"result": "58",
"unit": "mg/dL",
"evaluation": "normal",
"range_min": "35",
"range_max": "100",
"range_normal_min": "50",
"range_normal_max": "90",
"short_description": "Measures 'good' cholesterol level.",
"long_description": "HDL (high-density lipoprotein) cholesterol helps remove other forms of cholesterol..."
},
{
"short_name": "LDL",
"long_name": "LDL Cholesterol",
"category": "Lipid Panel",
"result": "142",
"unit": "mg/dL",
"evaluation": "high",
"range_min": "0",
"range_max": "200",
"range_normal_min": "0",
"range_normal_max": "100",
"short_description": "Measures 'bad' cholesterol level.",
"long_description": "LDL (low-density lipoprotein) cholesterol can build up in artery walls..."
},
{
"short_name": "TRIG",
"long_name": "Triglycerides",
"category": "Lipid Panel",
"result": "156",
"unit": "mg/dL",
"evaluation": "borderline_high",
"range_min": "0",
"range_max": "500",
"range_normal_min": "0",
"range_normal_max": "150",
"short_description": "Measures fat in the blood.",
"long_description": "Triglycerides are a type of fat found in the blood that stores excess energy..."
}
],
"interpretation": [
{
"title": "Overall Health Assessment",
"shortcode": "overall_health_assessment",
"subsections": [
{
"subtitle": "Comprehensive Overview",
"shortcode": "overall_health_assessment_overview",
"items": [
{"item": "The patient demonstrates generally healthy hematological parameters with all blood count values within normal ranges."},
{"item": "Complete blood count results indicate adequate oxygen-carrying capacity and immune function."},
{"item": "Lipid panel shows areas requiring attention, particularly LDL cholesterol levels."}
]
}
]
},
{
"title": "Metabolic Analysis",
"shortcode": "metabolic_analysis",
"subsections": [
{
"subtitle": "Blood Sugar Assessment",
"shortcode": "metabolic_analysis_glucose",
"items": [
{"item": "Fasting glucose at 102 mg/dL is slightly elevated, indicating pre-diabetic range."},
{"item": "Recommend lifestyle modifications including regular exercise and reduced simple carbohydrate intake."},
{"item": "Follow-up HbA1c testing recommended in 3 months to assess long-term glucose control."}
]
}
]
},
{
"title": "Cardiovascular Risk Assessment",
"shortcode": "cardiovascular_risk",
"subsections": [
{
"subtitle": "Lipid Profile Analysis",
"shortcode": "cardiovascular_risk_lipids",
"items": [
{"item": "LDL cholesterol at 142 mg/dL exceeds optimal levels and warrants intervention."},
{"item": "HDL cholesterol at 58 mg/dL provides moderate cardiovascular protection."},
{"item": "Triglycerides slightly elevated; consider dietary modifications to reduce saturated fat intake."},
{"item": "Total cholesterol to HDL ratio of 3.76 indicates moderate cardiovascular risk."}
]
}
]
},
{
"title": "Recommendations",
"shortcode": "recommendations",
"subsections": [
{
"subtitle": "Lifestyle Modifications",
"shortcode": "recommendations_lifestyle",
"items": [
{"item": "Increase aerobic physical activity to at least 150 minutes per week."},
{"item": "Adopt a Mediterranean-style diet rich in vegetables, fruits, and healthy fats."},
{"item": "Limit processed foods, saturated fats, and added sugars."},
{"item": "Consider consultation with a nutritionist for personalized dietary guidance."}
]
},
{
"subtitle": "Follow-up Testing",
"shortcode": "recommendations_followup",
"items": [
{"item": "Repeat lipid panel in 3 months after implementing lifestyle changes."},
{"item": "HbA1c test recommended to assess average blood glucose levels."},
{"item": "Annual comprehensive metabolic panel for ongoing monitoring."}
]
}
]
}
]
},
"api_version": "v11",
"timestamp": "2025-12-16T14:32:18Z"
}
The evaluation field uses standardized values. See evaluation values.
Production endpoint with comprehensive health score calculation and disease risk analysis.
Additional Response Fields
{
"health_score": {
"overall": 78,
"optimal": 4,
"normal": 12,
"warning": 3,
"critical": 1,
"total_parameters": 20,
"score_interpretation": "good",
"recommendations": [
"Consider increasing vitamin D intake",
"Schedule follow-up for cholesterol levels"
]
},
"disease_risks": [
{"name": "Cardiovascular Disease", "percentage": "18%", "severity": "low"},
{"name": "Type 2 Diabetes", "percentage": "12%", "severity": "low"},
{"name": "Metabolic Syndrome", "percentage": "25%", "severity": "moderate"}
]
}
The score_interpretation field uses standardized values. See health score values.
Sandbox Endpoints
Sandbox endpoints return realistic test data without consuming API quota. Use them for development and integration testing.
- No quota consumption
- Returns realistic test data
- Same request format as production
- Test your integration before going live
- Available for all API versions
| API | Sandbox Endpoint |
|---|---|
| Blood Test v11 | /api/v11/01-06-2025/sandbox |
| Blood Test v11-health | /api/v11/health-score/sandbox |
| Nutrition Diet AI | /api/v1/nutrition/diet-plan/sandbox |
| Blood Test Comparison | /api/v1/bloodtest/comparison/sandbox |
| Trend Analysis | /api/v1/analytics/trends/sandbox |
| ICR Extract | /api/icr/v1/sandbox |
| ICR Kan (Blood Test) | /api/icr/v1/kan/sandbox |
Choose the right API for your use case:
| Feature | AI Blood Test Comparison | Trend Analysis |
|---|---|---|
| Primary Focus | AI narrative comparison | Statistical trend analysis |
| AI Processing | Full AI narrative | AI-enhanced + statistics |
| Output Type | Narrative summaries | Charts, statistics, patterns |
| Best For | What changed between tests | Long-term parameter tracking |
| Min Tests | 2 | 2 |
| Max Tests | 20 | 50 |
Trend Analysis API
Analyze health parameter trends over time using AI-powered pattern recognition. Identify improvements, deteriorations, and actionable insights from historical blood test data.
Analyzes blood test parameter trends over multiple test dates to identify patterns and provide health insights.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Your API username |
password | string | Yes | Your API password |
language | string | No | Response language (default: en). See supported languages. |
blood_tests | array | Yes | Array of blood test objects (min: 2, max: 50) |
analysis_type | string | No | Analysis type. See values. |
analysis_options | object | No | Analysis configuration options |
analysis_options Object
| Field | Type | Default | Description |
|---|---|---|---|
include_predictions | boolean | true | Include AI trend predictions |
include_statistics | boolean | true | Include statistical analysis (average, min, max, std deviation) |
include_charts | boolean | true | Include chart configuration data for visualization |
blood_tests Array Structure
- Minimum: 2 blood tests required
- Maximum: 50 blood tests per request
- Each test must have
lab_dateORresults_date - Use consistent parameter names across all tests for accurate trend tracking
| Field | Type | Required | Description |
|---|---|---|---|
lab_date | string | Yes* | Test date in YYYY-MM-DD format |
results_date | string | Yes* | Alternative to lab_date (YYYY-MM-DD) |
parameters | array | Yes | Array of blood test parameters |
metadata | object | No | Additional metadata (lab_name, notes, etc.) |
*Either lab_date or results_date is required for each blood test.
blood_tests[].parameters Array Structure
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Parameter name (use consistent naming across tests!) |
short_name | string | No | Short parameter code (e.g., HGB, GLU, CHOL) |
value | number | Yes | Measured value (can also use result) |
unit | string | Yes | Unit of measurement (e.g., g/dL, mg/dL, %) |
range_min | number | No | Minimum reference range value |
range_max | number | No | Maximum reference range value |
category | string | No | Parameter category (e.g., "Lipid Panel", "Complete Blood Count") |
evaluation | string | No | Pre-evaluated status. See evaluation values |
cURL Example
curl -X POST "https://app.aibloodtestinterpret.com/api/v1/analytics/trends/analyze" \
-H "Content-Type: application/json" \
-d '{
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"language": "en",
"analysis_type": "comprehensive",
"analysis_options": {
"include_predictions": true,
"include_statistics": true,
"include_charts": true
},
"blood_tests": [
{
"lab_date": "2024-01-15",
"parameters": [
{"name": "Fasting Glucose", "short_name": "GLU", "value": 98, "unit": "mg/dL"},
{"name": "Hemoglobin A1c", "short_name": "HBA1C", "value": 5.6, "unit": "%"},
{"name": "Total Cholesterol", "short_name": "CHOL", "value": 185, "unit": "mg/dL"},
{"name": "LDL Cholesterol", "short_name": "LDL", "value": 110, "unit": "mg/dL"},
{"name": "HDL Cholesterol", "short_name": "HDL", "value": 52, "unit": "mg/dL"}
]
},
{
"lab_date": "2024-05-20",
"parameters": [
{"name": "Fasting Glucose", "short_name": "GLU", "value": 92, "unit": "mg/dL"},
{"name": "Hemoglobin A1c", "short_name": "HBA1C", "value": 5.4, "unit": "%"},
{"name": "Total Cholesterol", "short_name": "CHOL", "value": 178, "unit": "mg/dL"},
{"name": "LDL Cholesterol", "short_name": "LDL", "value": 102, "unit": "mg/dL"},
{"name": "HDL Cholesterol", "short_name": "HDL", "value": 55, "unit": "mg/dL"}
]
},
{
"lab_date": "2024-09-10",
"parameters": [
{"name": "Fasting Glucose", "short_name": "GLU", "value": 88, "unit": "mg/dL"},
{"name": "Hemoglobin A1c", "short_name": "HBA1C", "value": 5.3, "unit": "%"},
{"name": "Total Cholesterol", "short_name": "CHOL", "value": 168, "unit": "mg/dL"},
{"name": "LDL Cholesterol", "short_name": "LDL", "value": 92, "unit": "mg/dL"},
{"name": "HDL Cholesterol", "short_name": "HDL", "value": 58, "unit": "mg/dL"}
]
},
{
"lab_date": "2024-12-18",
"parameters": [
{"name": "Fasting Glucose", "short_name": "GLU", "value": 85, "unit": "mg/dL"},
{"name": "Hemoglobin A1c", "short_name": "HBA1C", "value": 5.2, "unit": "%"},
{"name": "Total Cholesterol", "short_name": "CHOL", "value": 162, "unit": "mg/dL"},
{"name": "LDL Cholesterol", "short_name": "LDL", "value": 85, "unit": "mg/dL"},
{"name": "HDL Cholesterol", "short_name": "HDL", "value": 62, "unit": "mg/dL"}
]
}
]
}'
Python Example
import requests
from typing import List, Dict, Optional
def analyze_trends(
username: str,
password: str,
blood_tests: List[Dict],
language: str = "en",
analysis_type: str = "comprehensive"
) -> Dict:
"""
Analyze blood test trends over time.
Args:
username: API username
password: API password
blood_tests: List of blood test objects with lab_date and parameters
language: Response language code
analysis_type: comprehensive, quick, or focused
Returns:
dict: Trend analysis results
"""
url = "https://app.aibloodtestinterpret.com/api/v1/analytics/trends/analyze"
payload = {
"username": username,
"password": password,
"language": language,
"analysis_type": analysis_type,
"blood_tests": blood_tests
}
response = requests.post(url, json=payload, timeout=120)
response.raise_for_status()
return response.json()
# Example usage
if __name__ == "__main__":
blood_tests = [
{
"lab_date": "2025-01-15",
"parameters": [
{"short_name": "HGB", "result": 12.5, "unit": "g/dL"},
{"short_name": "CHOL", "result": 220, "unit": "mg/dL"}
]
},
{
"lab_date": "2025-06-15",
"parameters": [
{"short_name": "HGB", "result": 13.2, "unit": "g/dL"},
{"short_name": "CHOL", "result": 195, "unit": "mg/dL"}
]
},
{
"lab_date": "2025-12-01",
"parameters": [
{"short_name": "HGB", "result": 14.1, "unit": "g/dL"},
{"short_name": "CHOL", "result": 180, "unit": "mg/dL"}
]
}
]
result = analyze_trends(
username="your_username",
password="your_password",
blood_tests=blood_tests
)
print(f"Overall trend: {result['data']['overall_trend']}")
for trend in result['data']['parameter_trends']:
print(f"{trend['parameter']}: {trend['direction']} ({trend['change_percent']}%)")
C++ Example (libcurl + nlohmann/json)
#include <iostream>
#include <string>
#include <curl/curl.h>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* userp) {
userp->append((char*)contents, size * nmemb);
return size * nmemb;
}
std::string analyzeTrends(const std::string& username,
const std::string& password,
const json& bloodTests,
const std::string& language = "en") {
CURL* curl = curl_easy_init();
std::string response;
if (curl) {
json payload = {
{"username", username},
{"password", password},
{"language", language},
{"analysis_type", "comprehensive"},
{"blood_tests", bloodTests}
};
std::string jsonStr = payload.dump();
struct curl_slist* headers = nullptr;
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL,
"https://app.aibloodtestinterpret.com/api/v1/analytics/trends/analyze");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, jsonStr.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 120L);
CURLcode res = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return response;
}
int main() {
json bloodTests = json::array({
{{"lab_date", "2025-01-15"}, {"parameters", {{{"short_name", "HGB"}, {"result", 12.5}, {"unit", "g/dL"}}}}},
{{"lab_date", "2025-06-15"}, {"parameters", {{{"short_name", "HGB"}, {"result", 13.2}, {"unit", "g/dL"}}}}},
{{"lab_date", "2025-12-01"}, {"parameters", {{{"short_name", "HGB"}, {"result", 14.1}, {"unit", "g/dL"}}}}}
});
std::string result = analyzeTrends("username", "password", bloodTests);
std::cout << result << std::endl;
return 0;
}
Response Fields Reference
| Field | Type | Description |
|---|---|---|
analysis_id | string | Unique identifier for this analysis (format: TRD-XXXXXXXX) |
analysis_period | object | Time span details: start_date, end_date, span_months, total_tests |
categories | array | List of parameter categories found (e.g., "Lipid Panel", "Complete Blood Count") |
chart_config | object | Chart-ready data: dates, raw_dates, simple_dates for visualization |
overall_health_trend | object | Summary, health_risks array, and recommendations |
parameter_trends | array | Detailed analysis per parameter with statistics |
risk_factors | array | Identified health risk factors |
parameter_trends Object Structure
| Field | Type | Description |
|---|---|---|
parameter | string | Standardized parameter name |
short_name | string | Abbreviated parameter name |
category | string | Parameter category (e.g., "Lipid Panel") |
unit | string | Measurement unit |
trend_data | array | Array of {date, value} objects for charting |
statistical_analysis | object | average, min, max, standard_deviation, trend_direction, trend_strength |
analysis | object | AI interpretation: description, significant_variations, trend |
interpretation | string | Human-readable parameter description |
Example Response
{
"api_version": "1.0.0",
"status": "success",
"message": "Trend analysis completed successfully",
"timestamp": "2025-12-22T01:12:49.262700Z",
"data": {
"analysis_id": "TRD-49B4C616",
"analysis_period": {
"start_date": "2024-01-15",
"end_date": "2024-12-18",
"span_months": 11,
"total_tests": 4
},
"categories": [
"Metabolic Panel",
"Vitamins",
"Diabetes Markers",
"Iron Studies",
"Lipid Panel",
"Complete Blood Count"
],
"chart_config": {
"dates": ["Jan 2024", "May 2024", "Sep 2024", "Dec 2024"],
"raw_dates": ["2024-01-15", "2024-05-20", "2024-09-10", "2024-12-18"]
},
"language": "en",
"overall_health_trend": {
"summary": "Overall, the blood test parameters show positive trends with improvements in hemoglobin, lipid profile including LDL and HDL cholesterol, vitamin D status, and iron stores.",
"health_risks": [],
"recommendations": []
},
"parameter_trends": [
{
"parameter": "Hemoglobin (Hb)",
"short_name": "Hemoglobin",
"category": "Complete Blood Count",
"unit": "g/dL",
"original_names": ["Hemoglobin", "HGB"],
"trend_data": [
{"date": "2024-01-15", "value": 12.8},
{"date": "2024-05-20", "value": 13.5},
{"date": "2024-09-10", "value": 14.2},
{"date": "2024-12-18", "value": 14.8}
],
"statistical_analysis": {
"average": 13.82,
"min": 12.8,
"max": 14.8,
"standard_deviation": 0.87,
"trend_direction": "upward",
"trend_strength": "moderate"
},
"analysis": {
"description": "Hemoglobin measures the oxygen-carrying protein in red blood cells.",
"significant_variations": "Initially low at 12.8 g/dL, then gradually increased to 14.8 g/dL.",
"trend": "increasing",
"unit": "g/dL"
},
"interpretation": "Hemoglobin measures the oxygen-carrying protein in red blood cells."
},
{
"parameter": "Low-Density Lipoprotein Cholesterol (LDL-C)",
"short_name": "Low-Densit",
"category": "Lipid Panel",
"unit": "mg/dL",
"trend_data": [
{"date": "2024-01-15", "value": 110.0},
{"date": "2024-05-20", "value": 102.0},
{"date": "2024-09-10", "value": 92.0},
{"date": "2024-12-18", "value": 85.0}
],
"statistical_analysis": {
"average": 97.25,
"min": 85.0,
"max": 110.0,
"standard_deviation": 11.0,
"trend_direction": "downward",
"trend_strength": "strong"
},
"analysis": {
"description": "LDL-C is the 'bad' cholesterol associated with increased heart disease risk.",
"significant_variations": "LDL-C shifted from high (110 mg/dL) to normal (85 mg/dL).",
"trend": "decreasing"
}
}
],
"risk_factors": [],
"sandbox_mode": false
}
}
Response fields use standardized values: trend_direction (see values), trend_strength (see values).
Nutrition Diet AI with Supplements
Generate personalized nutrition plans, diet recommendations, and supplement suggestions based on blood test analysis using advanced AI algorithms.
Generates comprehensive nutrition and supplement recommendations based on blood test parameters and patient profile.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Your API username |
password | string | Yes | Your API password |
language | string | No | Response language (default: en). See supported languages. |
patient | object | Yes | Patient demographics and health info |
blood_test | object | Yes | Blood test parameters |
health_goals | array | No | Health goals. See values. |
dietary_restrictions | array | No | Dietary restrictions. See values. |
Patient Object Schema
Patient demographics object with gender (see values) and activity_level (see values).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
age | integer | Yes | - | Patient age in years (18-120) |
gender | string | Yes | - | Patient gender. See values |
weight | number | No | null | Weight in kg (for caloric calculations) |
height | number | No | null | Height in cm (for BMI calculations) |
conditions | array | No | [] | Medical conditions (e.g., ["diabetes", "hypertension"]) |
allergies | array | No | [] | Food/supplement allergies (e.g., ["shellfish", "nuts"]) |
dietary_preferences | array | No | [] | Dietary preferences. See values |
activity_level | string | No | "moderate" | Physical activity level. See values |
dietary_restrictions | array | No | [] | Dietary restrictions. See values |
liked_foods | array | No | [] | Preferred foods to include (e.g., ["salmon", "spinach"]) |
disliked_foods | array | No | [] | Foods to avoid in recommendations (e.g., ["broccoli"]) |
meal_frequency | integer | No | 3 | Preferred meals per day (2-6) |
budget | string | No | "moderate" | Budget level for recommendations. See values |
medications | array | No | [] | Current medications for interaction checks |
{
"age": 45,
"gender": "male",
"weight": 82,
"height": 178,
"activity_level": "moderate",
"medical_conditions": ["hypertension"],
"current_medications": ["lisinopril"],
"allergies": ["shellfish"]
}
cURL Example
curl -X POST "https://app.aibloodtestinterpret.com/api/v1/nutrition/diet-plan/analyze" \
-H "Content-Type: application/json" \
-d '{
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"language": "en",
"patient": {
"age": 45,
"gender": "male",
"weight": 82,
"height": 178,
"activity_level": "moderate",
"medical_conditions": ["hypertension"],
"allergies": ["shellfish"]
},
"blood_test": {
"lab_date": "2025-12-01",
"parameters": [
{"short_name": "VITD", "result": 18, "unit": "ng/mL"},
{"short_name": "FER", "result": 25, "unit": "ng/mL"},
{"short_name": "B12", "result": 280, "unit": "pg/mL"},
{"short_name": "CHOL", "result": 210, "unit": "mg/dL"},
{"short_name": "HDL", "result": 42, "unit": "mg/dL"},
{"short_name": "LDL", "result": 140, "unit": "mg/dL"}
]
},
"health_goals": ["lower_cholesterol", "increase_energy"],
"dietary_restrictions": ["low_sodium"]
}'
Python Example
import requests
from typing import Dict, List, Optional
def get_nutrition_plan(
username: str,
password: str,
patient: Dict,
blood_test: Dict,
health_goals: Optional[List[str]] = None,
dietary_restrictions: Optional[List[str]] = None,
language: str = "en"
) -> Dict:
"""
Get personalized nutrition and supplement recommendations.
Args:
username: API username
password: API password
patient: Patient demographics and health info
blood_test: Blood test parameters
health_goals: Optional health goals
dietary_restrictions: Optional dietary restrictions
language: Response language
Returns:
dict: Nutrition plan with supplements
"""
url = "https://app.aibloodtestinterpret.com/api/v1/nutrition/diet-plan/analyze"
payload = {
"username": username,
"password": password,
"language": language,
"patient": patient,
"blood_test": blood_test
}
if health_goals:
payload["health_goals"] = health_goals
if dietary_restrictions:
payload["dietary_restrictions"] = dietary_restrictions
response = requests.post(url, json=payload, timeout=120)
response.raise_for_status()
return response.json()
# Example usage
if __name__ == "__main__":
patient = {
"age": 45,
"gender": "male",
"weight": 82,
"height": 178,
"activity_level": "moderate",
"medical_conditions": ["hypertension"],
"allergies": ["shellfish"]
}
blood_test = {
"lab_date": "2025-12-01",
"parameters": [
{"short_name": "VITD", "result": 18, "unit": "ng/mL"},
{"short_name": "FER", "result": 25, "unit": "ng/mL"},
{"short_name": "CHOL", "result": 210, "unit": "mg/dL"}
]
}
result = get_nutrition_plan(
username="your_username",
password="your_password",
patient=patient,
blood_test=blood_test,
health_goals=["lower_cholesterol", "increase_energy"]
)
# Print supplement recommendations
for supp in result['data']['supplements']:
print(f"{supp['name']}: {supp['dosage']} - {supp['reason']}")
Example Response
{
"status": "success",
"data": {
"nutrition_plan": {
"daily_calories": 2100,
"macros": {
"protein": {"grams": 105, "percentage": 20},
"carbohydrates": {"grams": 236, "percentage": 45},
"fats": {"grams": 82, "percentage": 35}
},
"meal_plan": {
"breakfast": {
"description": "Oatmeal with berries and walnuts",
"calories": 420,
"nutrients": ["fiber", "omega-3", "antioxidants"]
},
"lunch": {
"description": "Grilled salmon salad with olive oil dressing",
"calories": 550,
"nutrients": ["omega-3", "protein", "vitamin D"]
},
"dinner": {
"description": "Lean chicken with quinoa and steamed vegetables",
"calories": 580,
"nutrients": ["protein", "iron", "fiber"]
},
"snacks": [
{"description": "Greek yogurt with almonds", "calories": 180},
{"description": "Apple with almond butter", "calories": 200}
]
}
},
"supplements": [
{
"name": "Vitamin D3",
"dosage": "2000 IU daily",
"reason": "Blood levels at 18 ng/mL indicate deficiency (optimal: 30-50 ng/mL)",
"priority": "high",
"timing": "With breakfast (fat-containing meal)",
"duration": "3-6 months, then retest",
"interactions": []
},
{
"name": "Omega-3 Fish Oil",
"dosage": "1000mg EPA+DHA daily",
"reason": "Support cholesterol optimization and cardiovascular health",
"priority": "medium",
"timing": "With meals",
"duration": "Ongoing",
"interactions": []
},
{
"name": "Coenzyme Q10",
"dosage": "100mg daily",
"reason": "Support energy production and heart health",
"priority": "medium",
"timing": "With breakfast",
"duration": "Ongoing",
"interactions": []
}
],
"dietary_recommendations": [
{
"category": "increase",
"foods": ["fatty fish", "leafy greens", "nuts", "olive oil"],
"reason": "Support vitamin D levels and cardiovascular health"
},
{
"category": "decrease",
"foods": ["processed foods", "red meat", "saturated fats"],
"reason": "Help lower LDL cholesterol"
},
{
"category": "avoid",
"foods": ["shellfish", "high-sodium foods"],
"reason": "Patient allergies and hypertension management"
}
],
"lifestyle_recommendations": [
"30 minutes moderate exercise 5 days/week",
"Sun exposure 15-20 minutes daily for vitamin D",
"Stress management through meditation or yoga"
],
"follow_up": {
"retest_date": "2026-03-01",
"parameters_to_monitor": ["VITD", "CHOL", "HDL", "LDL"]
}
},
"api_version": "v1",
"timestamp": "2025-12-22T10:30:00Z"
}
Response Fields Reference
nutrition_plan.educational_insights Object
| Field | Type | Description |
|---|---|---|
blood_marker_education | array | Educational content about blood markers and their significance |
nutrition_principles | array | Applicable nutrition principles based on the analysis |
blood_marker_education Array Item
| Field | Type | Description |
|---|---|---|
marker | string | Marker name with status (e.g., "Ferritin (Low)", "Vitamin D (Deficient)") |
explanation | string | Detailed educational explanation of the marker |
normal_range | string | Reference range (gender-specific if applicable) |
food_recommendations.power_foods Array Item
| Field | Type | Description |
|---|---|---|
food | string | Food name (e.g., "Salmon", "Spinach") |
nutrients | array | Key nutrients list (e.g., ["omega-3", "vitamin D", "protein"]) |
serving | string | Recommended serving size/frequency (e.g., "100g, 3x per week") |
why | string | Why this food is recommended based on blood markers |
supplement_recommendations Array Item
| Field | Type | Description |
|---|---|---|
supplement | string | Supplement name (e.g., "Vitamin D3", "Iron Bisglycinate") |
dosage | string | Recommended dosage (e.g., "2000 IU daily", "25mg twice daily") |
timing | string | When to take (e.g., "With breakfast", "On empty stomach") |
duration | string | How long to take (e.g., "3 months then retest", "Ongoing") |
reason | string | Why recommended based on blood markers and health goals |
Complete cURL Example with Response
curl -X POST "https://app.aibloodtestinterpret.com/api/v1/nutrition/diet-plan/analyze" \
-H "Content-Type: application/json" \
-d '{
"username": "demo_user",
"password": "demo_pass",
"language": "en",
"patient": {
"age": 42,
"gender": "female",
"weight": 68,
"height": 165,
"activity_level": "moderate",
"conditions": ["iron_deficiency_anemia"],
"allergies": ["gluten"],
"dietary_preferences": ["mediterranean"],
"dietary_restrictions": ["gluten_free"],
"liked_foods": ["salmon", "spinach", "quinoa"],
"disliked_foods": ["liver"],
"meal_frequency": 4,
"budget": "moderate",
"medications": ["ferrous_sulfate"]
},
"blood_test": {
"lab_date": "2025-12-20",
"parameters": [
{"short_name": "FER", "result": 12, "unit": "ng/mL"},
{"short_name": "HGB", "result": 10.8, "unit": "g/dL"},
{"short_name": "VITD", "result": 22, "unit": "ng/mL"},
{"short_name": "B12", "result": 320, "unit": "pg/mL"},
{"short_name": "FOLATE", "result": 8.5, "unit": "ng/mL"}
]
},
"health_goals": ["increase_energy", "improve_iron_levels"]
}'
Response:
{
"status": "success",
"data": {
"nutrition_plan": {
"daily_calories": 1850,
"macros": {
"protein": {"grams": 92, "percentage": 20},
"carbohydrates": {"grams": 208, "percentage": 45},
"fats": {"grams": 72, "percentage": 35}
},
"educational_insights": {
"blood_marker_education": [
{
"marker": "Ferritin (Low)",
"explanation": "Ferritin is the storage form of iron in your body. Low levels indicate depleted iron stores, which can lead to fatigue, weakness, and anemia. Your current level of 12 ng/mL is below the optimal range.",
"normal_range": "Women: 20-200 ng/mL (optimal: 50-150 ng/mL)"
},
{
"marker": "Hemoglobin (Low)",
"explanation": "Hemoglobin carries oxygen in your red blood cells. Low hemoglobin confirms iron deficiency anemia and explains symptoms like fatigue and shortness of breath.",
"normal_range": "Women: 12.0-16.0 g/dL"
},
{
"marker": "Vitamin D (Insufficient)",
"explanation": "Vitamin D is essential for calcium absorption, immune function, and energy. Your level of 22 ng/mL is insufficient; optimal levels are 40-60 ng/mL.",
"normal_range": "30-100 ng/mL (optimal: 40-60 ng/mL)"
}
],
"nutrition_principles": [
"Pair iron-rich foods with vitamin C sources to enhance absorption",
"Avoid calcium-rich foods and tea/coffee within 2 hours of iron-rich meals",
"Focus on heme iron sources (meat, fish) which absorb better than plant sources",
"Include vitamin D-rich foods and consider sun exposure for synthesis"
]
},
"food_recommendations": {
"power_foods": [
{
"food": "Grass-fed Beef",
"nutrients": ["heme iron", "B12", "zinc", "protein"],
"serving": "120g, 3-4x per week",
"why": "Highest bioavailable iron source to address your ferritin deficiency"
},
{
"food": "Wild Salmon",
"nutrients": ["vitamin D", "omega-3", "protein", "B12"],
"serving": "150g, 2-3x per week",
"why": "Excellent vitamin D source plus omega-3s for inflammation reduction"
},
{
"food": "Spinach with Lemon",
"nutrients": ["non-heme iron", "folate", "vitamin C"],
"serving": "100g cooked, daily",
"why": "Iron plus vitamin C combination maximizes iron absorption"
},
{
"food": "Quinoa",
"nutrients": ["iron", "protein", "fiber", "magnesium"],
"serving": "1 cup cooked, daily",
"why": "Gluten-free grain with good iron content and complete protein"
},
{
"food": "Pumpkin Seeds",
"nutrients": ["iron", "zinc", "magnesium"],
"serving": "30g (2 tbsp), daily",
"why": "Concentrated iron source for snacking, supports energy production"
}
],
"foods_to_limit": [
{"food": "Coffee/Tea with meals", "reason": "Tannins block iron absorption by up to 60%"},
{"food": "Dairy with iron-rich meals", "reason": "Calcium competes with iron for absorption"}
]
}
},
"supplement_recommendations": [
{
"supplement": "Iron Bisglycinate",
"dosage": "25mg elemental iron",
"timing": "Take with vitamin C on empty stomach, 2 hours away from other supplements",
"duration": "3-6 months, retest ferritin after 3 months",
"reason": "Ferritin at 12 ng/mL requires supplementation; bisglycinate form is gentle on stomach",
"priority": "high"
},
{
"supplement": "Vitamin D3",
"dosage": "2000-4000 IU daily",
"timing": "With breakfast (fat-containing meal) for absorption",
"duration": "Ongoing, retest in 3 months to adjust dose",
"reason": "Level of 22 ng/mL is insufficient; goal is 40-60 ng/mL for optimal health",
"priority": "high"
},
{
"supplement": "Vitamin C",
"dosage": "500mg",
"timing": "Take with iron supplement to enhance absorption",
"duration": "While taking iron supplements",
"reason": "Enhances non-heme iron absorption by up to 6x",
"priority": "medium"
}
],
"meal_plan": {
"breakfast": {
"description": "Quinoa porridge with pumpkin seeds, berries, and coconut milk",
"calories": 420,
"key_nutrients": ["iron", "vitamin C", "fiber"]
},
"lunch": {
"description": "Grilled salmon with roasted vegetables and quinoa",
"calories": 520,
"key_nutrients": ["vitamin D", "omega-3", "protein"]
},
"snack": {
"description": "Orange slices with pumpkin seeds and dark chocolate",
"calories": 220,
"key_nutrients": ["vitamin C", "iron", "magnesium"]
},
"dinner": {
"description": "Grass-fed beef stir-fry with spinach and bell peppers",
"calories": 480,
"key_nutrients": ["heme iron", "vitamin C", "B12"]
}
},
"lifestyle_recommendations": [
"Take iron supplements on an empty stomach for best absorption",
"Get 15-20 minutes of midday sun exposure for vitamin D synthesis",
"Space iron supplements 2 hours away from coffee, tea, and calcium",
"Light exercise can help with energy; avoid intense workouts until iron improves"
],
"follow_up": {
"retest_date": "2026-03-20",
"parameters_to_monitor": ["FER", "HGB", "VITD", "iron saturation"],
"expected_improvements": "Ferritin should increase 20-30 ng/mL, hemoglobin normalize to 12+ g/dL"
}
},
"api_version": "v1",
"timestamp": "2025-12-20T14:45:22Z"
}
Blood Test Comparison API
Compare multiple blood tests to identify changes, improvements, and areas requiring attention with AI-powered analysis. Get full AI narrative summaries explaining what changed between tests.
Analyzes 2-20 blood tests and provides detailed comparison with AI-generated narrative insights.
- Minimum 2 blood tests required
- Maximum 20 blood tests per request
- Each test must include
lab_dateorresults_date - At least one common parameter across tests
Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
username | string | Yes | - | Your API username |
password | string | Yes | - | Your API password |
language | string | No | en | Response language. See supported languages |
blood_tests | array | Yes | - | Array of blood test objects (2-20 tests) |
blood_tests Array Structure
| Field | Type | Required | Description |
|---|---|---|---|
lab_date | string | Yes* | Test date in YYYY-MM-DD format |
results_date | string | Yes* | Alternative to lab_date (YYYY-MM-DD) |
parameters | array | Yes | Array of blood test parameters |
metadata | object | No | Additional metadata (lab_name, notes, etc.) |
*Either lab_date or results_date is required for each blood test.
cURL Example
curl -X POST "https://app.aibloodtestinterpret.com/api/v1/bloodtest/comparison/analyze" \
-H "Content-Type: application/json" \
-d '{
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"language": "en",
"blood_tests": [
{
"lab_date": "2025-06-15",
"lab_name": "City Medical Lab",
"parameters": [
{"short_name": "HGB", "result": 12.8, "unit": "g/dL"},
{"short_name": "WBC", "result": 8.2, "unit": "10^9/L"},
{"short_name": "PLT", "result": 245, "unit": "10^9/L"}
]
},
{
"lab_date": "2025-12-15",
"lab_name": "City Medical Lab",
"parameters": [
{"short_name": "HGB", "result": 14.2, "unit": "g/dL"},
{"short_name": "WBC", "result": 7.1, "unit": "10^9/L"},
{"short_name": "PLT", "result": 238, "unit": "10^9/L"}
]
}
]
}'
Python Example
import requests
from typing import Dict, List
def compare_blood_tests(
username: str,
password: str,
blood_tests: List[Dict],
language: str = "en"
) -> Dict:
"""
Compare multiple blood tests with AI-powered narrative analysis.
Args:
username: API username
password: API password
blood_tests: List of blood test objects (2-20 tests)
language: Response language
Returns:
dict: Comparison results with AI narrative insights
"""
url = "https://app.aibloodtestinterpret.com/api/v1/bloodtest/comparison/analyze"
if len(blood_tests) < 2:
raise ValueError("Minimum 2 blood tests required")
if len(blood_tests) > 20:
raise ValueError("Maximum 20 blood tests allowed")
payload = {
"username": username,
"password": password,
"language": language,
"blood_tests": blood_tests
}
response = requests.post(url, json=payload, timeout=120)
response.raise_for_status()
return response.json()
# Example usage
if __name__ == "__main__":
tests = [
{
"lab_date": "2024-06-15",
"parameters": [
{"short_name": "HGB", "result": 12.2, "unit": "g/dL"},
{"short_name": "CHOL", "result": 235, "unit": "mg/dL"},
{"short_name": "LDL", "result": 155, "unit": "mg/dL"}
]
},
{
"lab_date": "2024-12-15",
"parameters": [
{"short_name": "HGB", "result": 14.5, "unit": "g/dL"},
{"short_name": "CHOL", "result": 185, "unit": "mg/dL"},
{"short_name": "LDL", "result": 98, "unit": "mg/dL"}
]
}
]
result = compare_blood_tests("your_username", "your_password", tests)
print(f"Overall trend: {result['data']['comparison_summary']['overall_trend']}")
for param in result['data']['parameter_analysis']:
print(f"{param['parameter_name']}: {param['trend_assessment']}")
Response Fields Reference
| Field | Type | Description |
|---|---|---|
comparison_id | string | Unique identifier for this comparison (format: CMP-XXXXXXXX) |
comparison_summary | object | Overall summary: key_findings, overall_trend, report dates, time_interval |
parameter_analysis | array | Detailed analysis per parameter with change type and clinical significance |
health_assessment | object | Areas of concern, improvement, positive developments, risk factors |
recommendations | object | Follow-up tests, immediate actions, lifestyle modifications, specialist referrals |
detailed_interpretation | object | AI narrative sections with executive summary and clinical recommendations |
parameter_analysis Object Structure
| Field | Type | Description |
|---|---|---|
parameter_name | string | Parameter name |
report1_value | string | Value from first report with unit |
report2_value | string | Value from second report with unit |
change_type | string | increased, decreased, or stable |
change_magnitude | string | significant, moderate, or minor |
clinical_significance | string | AI explanation of what the change means |
trend_assessment | string | positive, negative, or neutral |
Example Response
{
"api_version": "1.0.0",
"status": "success",
"message": "Blood test comparison completed successfully",
"timestamp": "2025-12-22T01:12:43.057537Z",
"data": {
"comparison_id": "CMP-F4ACEE52",
"tests_compared": 2,
"date_range": {
"earliest": "2024-06-15",
"latest": "2024-12-15",
"span_days": 183
},
"comparison_summary": {
"overall_trend": "improved",
"report1_date": "2024-06-15",
"report2_date": "2024-12-15",
"time_interval": "183 days between reports",
"key_findings": [
"Hemoglobin and RBC levels normalized indicating resolution of anemia",
"Glucose and HbA1c improved to normal range suggesting better glycemic control",
"Lipid profile improved with total cholesterol, LDL, HDL, and triglycerides normalized"
]
},
"parameter_analysis": [
{
"parameter_name": "Hemoglobin",
"report1_value": "12.2 g/dL",
"report2_value": "14.5 g/dL",
"change_type": "increased",
"change_magnitude": "significant",
"clinical_significance": "Improvement from anemia to normal hemoglobin levels",
"trend_assessment": "positive"
},
{
"parameter_name": "LDL Cholesterol",
"report1_value": "155 mg/dL",
"report2_value": "98 mg/dL",
"change_type": "decreased",
"change_magnitude": "significant",
"clinical_significance": "LDL near optimal range, reducing atherosclerosis risk",
"trend_assessment": "positive"
},
{
"parameter_name": "HDL Cholesterol",
"report1_value": "38 mg/dL",
"report2_value": "55 mg/dL",
"change_type": "increased",
"change_magnitude": "significant",
"clinical_significance": "Improved HDL protective against heart disease",
"trend_assessment": "positive"
}
],
"health_assessment": {
"overall_health_trend": "improved",
"areas_of_improvement": [
"Anemia correction",
"Glycemic control",
"Lipid profile normalization",
"Vitamin D and iron status"
],
"areas_of_concern": [],
"positive_developments": [
"Resolution of anemia",
"Normal glucose and HbA1c",
"Improved cardiovascular risk profile"
],
"risk_factors": [
"Previous iron deficiency anemia",
"Prior dyslipidemia",
"History of impaired glucose metabolism"
]
},
"recommendations": {
"immediate_actions": [
"Continue current supplementation for iron and vitamin D",
"Maintain glycemic and lipid control with diet and exercise"
],
"follow_up_tests": [
"Repeat CBC and iron studies in 3 months",
"Monitor fasting glucose and HbA1c quarterly",
"Lipid panel recheck in 6 months"
],
"lifestyle_modifications": [
"Adopt heart-healthy diet low in saturated fats",
"Increase physical activity to maintain metabolic health"
],
"specialist_referrals": [
"Consult hematologist if anemia recurs",
"Endocrinologist referral if glucose control worsens"
],
"monitoring_frequency": "3 months"
},
"detailed_interpretation": {
"sections": [
{
"title": "Executive Summary",
"content": "The patient shows marked improvement in anemia, glucose metabolism, lipid profile, and vitamin status over 6 months."
},
{
"title": "Clinical Recommendations",
"content": "Continue supplementation and lifestyle measures. Monitor blood counts, iron, glucose, and lipids regularly."
}
]
},
"summary": {
"improved_parameters": 13,
"stable_parameters": 0,
"worsened_parameters": 0,
"overall_trend": "improved"
},
"sandbox_mode": false
}
}
Response fields use standardized values: overall_trend and trend_assessment (see trend assessment), change_type (increased, decreased, stable).
Keywords Reference
Complete reference for all input keyword values used across Kantesti API endpoints. Use these exact values when making API requests.
analysis_type Trend Analysis API
Specifies the type of trend analysis to perform.
| Value | Default | Description |
|---|---|---|
comprehensive | ✓ | Full analysis with statistics, charts, and AI interpretation |
statistical | Statistical analysis only | |
summary | High-level summary only |
health_goals Nutrition API
Health objectives for personalized nutrition recommendations. Multiple values can be provided as an array.
| Value | Description |
|---|---|
maintain | Maintain current health (default) |
improve_energy | Focus on energy levels |
weight_management | Healthy weight management |
heart_health | Cardiovascular health |
immune_support | Immune system support |
digestive_health | Digestive wellness |
bone_health | Bone health |
mental_clarity | Cognitive function |
dietary_restrictions Nutrition API
Dietary restrictions and allergies. Multiple values can be provided as an array. Free text is also accepted for custom restrictions.
| Value | Description |
|---|---|
low_sodium | Reduced sodium intake |
low_sugar | Reduced sugar intake |
low_fat | Reduced fat intake |
gluten_free | No gluten |
dairy_free | No dairy |
nut_free | No nuts |
soy_free | No soy |
egg_free | No eggs |
halal | Halal-compliant |
kosher | Kosher-compliant |
Free text is also accepted for custom dietary restrictions not listed above.
dietary_preferences Nutrition API
Dietary lifestyle preferences for meal planning.
| Value | Description |
|---|---|
omnivore | No restrictions (default) |
vegetarian | No meat |
vegan | No animal products |
pescatarian | Vegetarian + fish |
keto | Ketogenic diet |
paleo | Paleolithic diet |
mediterranean | Mediterranean diet |
activity_level Nutrition API
Physical activity level for caloric and nutritional calculations.
| Value | Description |
|---|---|
sedentary | Little or no exercise |
light | Light exercise 1-3 days/week |
moderate | Moderate exercise 3-5 days/week (default) |
active | Hard exercise 6-7 days/week |
very_active | Very hard exercise or physical job |
budget Nutrition API
Budget level for food and supplement recommendations.
| Value | Description |
|---|---|
low | Budget-conscious options |
moderate | Balanced options (default) |
high | Premium options |
gender All APIs
Patient gender for personalized reference ranges and recommendations.
| Value | Description |
|---|---|
male | Male patient |
female | Female patient |
other | Other or unspecified |
Output Keywords
The following keywords appear in API responses. Understanding these values helps you interpret and display results correctly.
evaluation Blood Test & Comparison APIs
Parameter evaluation status indicating how the result compares to reference ranges.
| Value | Description |
|---|---|
normal | Within normal reference range |
low | Below normal range |
high | Above normal range |
critical_low | Critically low (immediate attention required) |
critical_high | Critically high (immediate attention required) |
borderline_low | Slightly below normal range |
borderline_high | Slightly above normal range |
trend_assessment Comparison & Trend APIs
Overall assessment of parameter trends between tests.
| Value | Description |
|---|---|
positive | Improved (moving toward normal range) |
negative | Worsened (moving away from normal range) |
stable | Relatively unchanged between tests |
improving | Overall improvement trend |
worsening | Overall deterioration trend |
trend_direction Trend Analysis API
Direction of parameter value changes over time.
| Value | Description |
|---|---|
upward | Values increasing over time |
downward | Values decreasing over time |
stable | Minimal change over time |
trend_strength Trend Analysis API
Magnitude of the observed trend.
| Value | Description |
|---|---|
strong | >15% change between periods |
moderate | 5-15% change between periods |
mild | <5% change between periods |
health_score / score_interpretation Health Score API
Overall health score interpretation based on analyzed parameters.
| Value | Description |
|---|---|
excellent | All markers within optimal range |
good | Most markers within normal range |
fair | Some markers need attention |
poor | Multiple markers need attention |
Utility Endpoints
Returns API platform information, available versions, and supported features. No authentication required.
Example Response
{
"platform": "Kantesti Blood Test Analysis API",
"versions": ["v6", "v8", "v9", "v10", "v11"],
"latest_version": "v11",
"supported_languages": 100,
"documentation": "https://www.kantesti.net/docs/",
"status": "operational"
}
Health check endpoint for monitoring. Returns service status. No authentication required.
Example Response
{
"status": "healthy",
"timestamp": "2025-12-22T10:30:00Z",
"uptime": "99.99%"
}
Check your remaining API quota. Requires authentication.
cURL Example
curl -X POST "https://app.aibloodtestinterpret.com/api/quota/check" \
-H "Content-Type: application/json" \
-d '{"username": "YOUR_USERNAME", "password": "YOUR_PASSWORD"}'
Example Response
{
"status": "success",
"quota": {
"remaining": 847,
"total": 1000,
"reset_date": "2026-01-01",
"plan": "professional"
}
}
Family Health Risk Assessment API
The Kantesti Family Health Risk Assessment API is an AI-powered hereditary health risk analysis platform. It generates comprehensive family health reports by analyzing family medical history, patient health profiles, and blood test data to identify hereditary risk factors and provide personalized preventive care recommendations.
AI-Powered Hereditary Risk Analysis
The Family Health API uses advanced AI models to cross-reference family medical history with patient blood test data, identifying hereditary risk patterns across cardiovascular, metabolic, cancer, neurological, respiratory, autoimmune, genetic, mental health, and kidney/liver condition categories. Reports include risk scoring, preventive care timelines, genetic screening recommendations, and lifestyle guidance — all localized in 100+ languages.
- Hereditary Risk Analysis — High, moderate, and low risk classification with detailed scoring
- Family Tree Analysis — Paternal and maternal lineage risk mapping with combined risk factors
- Blood Test Correlation — Cross-references family history with blood test parameters
- Genetic Screening Recommendations — Personalized genetic testing suggestions
- Preventive Care Timeline — Age-appropriate screening schedules based on family risk
- Medication Analysis — Drug interaction and hereditary sensitivity assessment
- 100+ Language Support — Full report localization in over 100 languages
- Sandbox Mode — Test integration without consuming credits
- 9 Condition Categories — Cardiovascular, Metabolic, Cancer, Neurological, Respiratory, Autoimmune, Genetic, Mental Health, Kidney/Liver
- 14 Family Relations — Father, mother, siblings, grandparents, uncles, aunts, children
Endpoints Summary
| Endpoint | Method | Description | Auth |
|---|---|---|---|
/api/v1/family-health/analyze |
POST | Generate comprehensive family health risk assessment report | Required (1 credit) |
/api/v1/family-health/validate |
POST | Validate request data before analysis (no quota consumed) | Required (Free) |
/api/v1/family-health/supported-languages |
GET | List all 100+ supported languages | Not required |
/api/v1/family-health/condition-categories |
GET | List all medical condition categories | Not required |
/api/v1/family-health/family-relations |
GET | List all supported family relation types | Not required |
/api/v1/family-health/sandbox/analyze |
POST | Sandbox testing with mock data (no quota consumed) | Required (Free) |
Generate a comprehensive AI-powered family health risk assessment report. Analyzes family medical history, patient health profiles, and blood test data to identify hereditary risk factors with personalized preventive care recommendations.
Request Parameters (JSON Body)
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Your API username |
password | string | Yes | Your API password |
patient_data | object | Yes | Patient information (see below) |
family_members | array | Yes* | Array of family member objects (max 100). *Required if health_profile is absent |
health_profile | object | Yes* | Patient health profile. *Required if family_members is absent |
blood_test_data | array | No | Array of blood test data objects for correlation analysis |
language | string | No | Response language code (default: en). 100+ languages supported |
patient_data Object
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Patient full name |
age | integer | Yes | Patient age in years |
gender | string | Yes | male, female, or other |
dob | string | No | Date of birth (YYYY-MM-DD) |
family_members Array Item
| Field | Type | Required | Description |
|---|---|---|---|
relation | string | Yes | Relation type: father, mother, brother, sister, paternal_grandfather, paternal_grandmother, maternal_grandfather, maternal_grandmother, paternal_uncle, paternal_aunt, maternal_uncle, maternal_aunt, son, daughter |
age | integer | No | Family member age |
conditions | array | No | Array of known medical conditions (strings) |
age_at_diagnosis | integer | No | Age when condition was diagnosed |
deceased | boolean | No | Whether the family member is deceased |
age_at_death | integer | No | Age at death (if deceased) |
cause_of_death | string | No | Cause of death (if deceased) |
cURL Example
curl -X POST "https://app.aibloodtestinterpret.com/api/v1/family-health/analyze" \
-H "Content-Type: application/json" \
-d '{
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"patient_data": {
"name": "Jane Doe",
"age": 42,
"gender": "female",
"dob": "1984-03-15"
},
"family_members": [
{
"relation": "father",
"age": 70,
"conditions": ["hypertension", "type2_diabetes"],
"deceased": false
},
{
"relation": "mother",
"age": 67,
"conditions": ["breast_cancer", "osteoporosis"],
"deceased": false
},
{
"relation": "paternal_grandfather",
"conditions": ["coronary_artery_disease"],
"deceased": true,
"age_at_death": 72,
"cause_of_death": "heart_attack"
}
],
"health_profile": {
"current_medications": ["metformin"],
"allergies": ["penicillin"],
"chronic_conditions": ["prediabetes"],
"lifestyle_factors": ["sedentary", "non_smoker"]
},
"blood_test_data": [
{"parameter": "glucose", "value": 110, "unit": "mg/dL"},
{"parameter": "HbA1c", "value": 5.9, "unit": "%"},
{"parameter": "total_cholesterol", "value": 220, "unit": "mg/dL"}
],
"language": "en"
}'
Python Example
import requests
def family_health_analyze(username: str, password: str, patient_data: dict,
family_members: list = None, health_profile: dict = None,
blood_test_data: list = None, language: str = "en"):
"""
Generate a family health risk assessment report using Kantesti API.
AI-powered hereditary risk analysis with 100+ language support.
Args:
username: API username
password: API password
patient_data: Patient info dict with 'age' and 'gender' (required)
family_members: List of family member dicts with medical history
health_profile: Patient health profile dict
blood_test_data: Optional blood test data for correlation
language: Report language code (default: en)
Returns:
dict: Full family health risk assessment report
"""
url = "https://app.aibloodtestinterpret.com/api/v1/family-health/analyze"
payload = {
"username": username,
"password": password,
"patient_data": patient_data,
"language": language
}
if family_members:
payload["family_members"] = family_members
if health_profile:
payload["health_profile"] = health_profile
if blood_test_data:
payload["blood_test_data"] = blood_test_data
response = requests.post(url, json=payload, timeout=120)
response.raise_for_status()
return response.json()
# Example usage
if __name__ == "__main__":
result = family_health_analyze(
username="your_username",
password="your_password",
patient_data={"name": "Jane Doe", "age": 42, "gender": "female"},
family_members=[
{"relation": "father", "age": 70, "conditions": ["hypertension", "type2_diabetes"]},
{"relation": "mother", "age": 67, "conditions": ["breast_cancer"]},
],
health_profile={"chronic_conditions": ["prediabetes"]},
blood_test_data=[{"parameter": "glucose", "value": 110, "unit": "mg/dL"}],
language="en"
)
print(f"Status: {result['status']}")
report = result["data"]["report_data"]
print(f"Risk Level: {report['risk_assessment']['overall_risk_level']}")
for category, risk in report["risk_assessment"].items():
if isinstance(risk, dict):
print(f" {category}: {risk.get('level', 'N/A')} (score: {risk.get('score', 'N/A')})")
C++ Example (libcurl)
#include <iostream>
#include <string>
#include <curl/curl.h>
size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* userp) {
userp->append((char*)contents, size * nmemb);
return size * nmemb;
}
std::string familyHealthAnalyze(const std::string& username,
const std::string& password,
const std::string& jsonPayload) {
CURL* curl = curl_easy_init();
std::string response;
if (curl) {
struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL,
"https://app.aibloodtestinterpret.com/api/v1/family-health/analyze");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, jsonPayload.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 120L);
CURLcode res = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return response;
}
int main() {
std::string payload = R"({
"username": "your_username",
"password": "your_password",
"patient_data": {"name": "Jane Doe", "age": 42, "gender": "female"},
"family_members": [
{"relation": "father", "age": 70, "conditions": ["hypertension"]},
{"relation": "mother", "age": 67, "conditions": ["breast_cancer"]}
],
"language": "en"
})";
std::string result = familyHealthAnalyze("user", "pass", payload);
std::cout << result << std::endl;
return 0;
}
Postman Example
Method: POST
URL: https://app.aibloodtestinterpret.com/api/v1/family-health/analyze
Headers:
Content-Type: application/json
Body (raw JSON):
{
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"patient_data": {
"age": 42,
"gender": "female"
},
"family_members": [
{"relation": "father", "age": 70, "conditions": ["hypertension"]}
],
"language": "en"
}
Example Response
{
"status": "success",
"data": {
"report_data": {
"report_title": "Family Health Risk Assessment Report",
"executive_summary": "Based on family medical history analysis...",
"hereditary_risk_analysis": {
"high_risk": [
{
"condition": "Cardiovascular Disease",
"risk_score": 75,
"contributing_factors": ["Paternal hypertension", "Grandfather coronary artery disease"],
"recommendation": "Regular cardiac screening recommended"
}
],
"moderate_risk": [
{
"condition": "Type 2 Diabetes",
"risk_score": 60,
"contributing_factors": ["Paternal type 2 diabetes", "Elevated glucose levels"],
"recommendation": "Annual HbA1c and fasting glucose monitoring"
}
],
"low_risk": []
},
"medication_analysis": {
"current_medications": ["metformin"],
"hereditary_sensitivities": [],
"recommendations": ["Continue metformin for prediabetes management"]
},
"blood_test_family_correlation": {
"correlated_findings": [
"Elevated glucose (110 mg/dL) correlates with paternal diabetes history",
"Cholesterol level (220 mg/dL) warrants monitoring given cardiovascular family history"
]
},
"genetic_screening_recommendations": [
"BRCA1/BRCA2 genetic testing (maternal breast cancer history)",
"Cardiovascular genetic panel (strong paternal cardiac history)"
],
"lifestyle_recommendations": [
"Adopt heart-healthy Mediterranean diet",
"150 minutes weekly moderate aerobic exercise",
"Maintain healthy BMI (18.5-24.9)"
],
"family_tree_summary": {
"paternal_lineage": {"risk_factors": ["hypertension", "type2_diabetes", "coronary_artery_disease"]},
"maternal_lineage": {"risk_factors": ["breast_cancer", "osteoporosis"]},
"combined_risk_factors": ["cardiovascular", "metabolic", "oncological"]
},
"preventive_care_timeline": [
{"age_range": "40-45", "screenings": ["Annual mammogram", "Cardiac stress test", "HbA1c every 6 months"]},
{"age_range": "45-50", "screenings": ["Colonoscopy baseline", "Bone density scan", "Lipid panel annually"]},
{"age_range": "50+", "screenings": ["Biennial mammogram", "Annual cardiac checkup", "Diabetes screening"]}
]
}
},
"message": "Family health risk assessment completed successfully",
"timestamp": "2026-03-23T10:30:00Z",
"api_version": "1.0.0"
}
Family Health API Error Codes
| Error Code | HTTP Status | Description |
|---|---|---|
AUTH_1001 | 401 | Missing authentication credentials |
AUTH_1002 | 401 | Invalid username or password |
QUOTA_1101 | 403 | Insufficient API quota |
QUOTA_1103 | 429 | Rate limit exceeded |
VAL_2001 | 400 | Required field is missing (patient_data.age, patient_data.gender) |
VAL_2002 | 400 | Invalid data format |
VAL_2003 | 400 | Unsupported language code |
VAL_2005 | 400 | Request data cannot be empty |
VAL_2006 | 400 | Array exceeds maximum size (max 100 family members) |
VAL_2007 | 400 | Invalid patient data structure |
PROC_3001 | 500 | Report generation failed |
PROC_3003 | 500 | AI processing error |
SRV_5001 | 500 | Internal server error |
Validate your request data before submitting for analysis. No quota is consumed. Use this endpoint to verify your payload structure is correct before calling /analyze.
cURL Example
curl -X POST "https://app.aibloodtestinterpret.com/api/v1/family-health/validate" \
-H "Content-Type: application/json" \
-d '{
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"patient_data": {"age": 42, "gender": "female"},
"family_members": [{"relation": "father", "conditions": ["hypertension"]}],
"language": "en"
}'
Example Response
{
"status": "success",
"data": {
"validation": {
"valid": true,
"data_validation": {"valid": true, "error": null},
"language_valid": true
}
},
"message": "Validation completed",
"timestamp": "2026-03-23T10:30:00Z",
"api_version": "1.0.0"
}
Family Health Sandbox Endpoint
Test your Family Health API integration without consuming credits. The sandbox endpoint returns realistic sample report data.
| API | Sandbox Endpoint | Description |
|---|---|---|
| Family Health Analyze | /api/v1/family-health/sandbox/analyze | Returns sample family health risk assessment report data |
Reference Endpoints (No Auth Required)
These endpoints provide reference data for building your integration. No authentication is required.
| Endpoint | Method | Description |
|---|---|---|
/api/v1/family-health/supported-languages |
GET | Returns all 100+ supported language codes and names |
/api/v1/family-health/condition-categories |
GET | Returns all 9 condition categories with their conditions (Cardiovascular, Metabolic, Cancer, Neurological, Respiratory, Autoimmune, Genetic, Mental Health, Kidney/Liver) |
/api/v1/family-health/family-relations |
GET | Returns all 14 supported family relation types |
ICR - Intelligent Character Recognition API
The Kantesti ICR (Intelligent Character Recognition) API is an advanced document text extraction technology that goes far beyond traditional OCR. Powered by Kantesti's proprietary AI engine, ICR delivers structured JSON output from any document type including medical reports, invoices, forms, and more.
Kantesti ICR vs Traditional OCR
In benchmark tests, Kantesti ICR demonstrated 79% higher performance compared to traditional OCR solutions. ICR understands document structure, preserves table layouts, extracts metadata, and returns clean structured JSON — while OCR only provides raw unstructured text. ICR uses AI-powered intelligent recognition to understand context, detect document types automatically, and deliver structured data ready for integration.
- Structured JSON Output — Tables, sections, metadata, and raw text in clean JSON format
- Document Type Detection — Automatically identifies medical reports, invoices, forms, letters, etc.
- Table Extraction — Preserves table headers and row data with full structure
- Multi-format Support — PDF, JPG, JPEG, PNG document processing
- Blood Test Integration (Kan) — Specialized endpoint for blood test document extraction
- Sandbox Mode — Test integration without consuming credits
- Thread-safe Processing — Concurrent document processing with RLock
- Credit System — 0.5 credits per API call
ICR Endpoints Summary
| Endpoint | Method | Description | Cost |
|---|---|---|---|
/api/icr/v1/extract |
POST | ICR text extraction from documents | 0.5 credit |
/api/icr/v1/sandbox |
POST | ICR sandbox testing (no processing) | Free |
/api/icr/v1/kan |
POST | Blood test document analysis | 0.5 credit |
/api/icr/v1/kan/sandbox |
POST | Blood test sandbox testing | Free |
/api/icr/info |
GET | API documentation and features | Free |
/api/icr/health |
GET | Health check endpoint | Free |
/api/icr/v1/quota |
POST | Check remaining ICR credits | Free |
Extract all text content from uploaded documents using Kantesti ICR technology. Returns structured JSON with document type detection, table extraction, section parsing, and metadata.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Your API username |
password | string | Yes | Your API password |
file | file | Yes | Document file (PDF, JPG, JPEG, PNG) |
language | string | No | Output language code (default: en). See supported languages. |
cURL Example
curl -X POST "https://app.aibloodtestinterpret.com/api/icr/v1/extract" \
-F "username=YOUR_USERNAME" \
-F "password=YOUR_PASSWORD" \
-F "language=en" \
-F "[email protected]"
Python Example
import requests
def icr_extract(file_path: str, username: str, password: str, language: str = "en"):
"""
Extract text from a document using Kantesti ICR API.
79% faster and more accurate than traditional OCR.
Args:
file_path: Path to the document (PDF, JPG, JPEG, PNG)
username: API username
password: API password
language: Output language code (default: en)
Returns:
dict: Structured JSON with document content, tables, sections, metadata
"""
url = "https://app.aibloodtestinterpret.com/api/icr/v1/extract"
with open(file_path, "rb") as f:
files = {"file": (file_path, f)}
data = {
"username": username,
"password": password,
"language": language
}
response = requests.post(url, files=files, data=data, timeout=120)
response.raise_for_status()
return response.json()
# Example usage
if __name__ == "__main__":
result = icr_extract(
file_path="medical_report.pdf",
username="your_username",
password="your_password",
language="en"
)
print(f"Status: {result['status']}")
print(f"Document Type: {result['data']['document_type']}")
print(f"Pages: {result['data']['page_count']}")
for page in result['data']['pages']:
print(f" Page {page['page_number']}: {len(page['content']['sections'])} sections")
for table in page['content'].get('tables', []):
print(f" Table: {len(table['rows'])} rows x {len(table['headers'])} cols")
C++ Example (libcurl)
#include <iostream>
#include <string>
#include <curl/curl.h>
size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* userp) {
userp->append((char*)contents, size * nmemb);
return size * nmemb;
}
std::string icrExtract(const std::string& filePath,
const std::string& username,
const std::string& password,
const std::string& language = "en") {
CURL* curl = curl_easy_init();
std::string response;
if (curl) {
curl_mime* form = curl_mime_init(curl);
curl_mimepart* field;
field = curl_mime_addpart(form);
curl_mime_name(field, "username");
curl_mime_data(field, username.c_str(), CURL_ZERO_TERMINATED);
field = curl_mime_addpart(form);
curl_mime_name(field, "password");
curl_mime_data(field, password.c_str(), CURL_ZERO_TERMINATED);
field = curl_mime_addpart(form);
curl_mime_name(field, "language");
curl_mime_data(field, language.c_str(), CURL_ZERO_TERMINATED);
field = curl_mime_addpart(form);
curl_mime_name(field, "file");
curl_mime_filedata(field, filePath.c_str());
curl_easy_setopt(curl, CURLOPT_URL,
"https://app.aibloodtestinterpret.com/api/icr/v1/extract");
curl_easy_setopt(curl, CURLOPT_MIMEPOST, form);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 120L);
CURLcode res = curl_easy_perform(curl);
curl_mime_free(form);
curl_easy_cleanup(curl);
}
return response;
}
int main() {
std::string result = icrExtract("medical_report.pdf", "username", "password");
std::cout << result << std::endl;
return 0;
}
Example Response
{
"status": "success",
"data": {
"document_type": "blood_test_report",
"page_count": 1,
"pages": [
{
"page_number": 1,
"content": {
"raw_text": "Cologne University Hospital - Blutbild\n\nPatient: Max Mustermann\nDOB: 15.03.1990\nGender: Male\nDate: 10.01.2026\n\nGlucose: 92 mg/dL (74-100)\nALT: 22 U/L (<35)\nCreatinine: 0.9 mg/dL (0.7-1.2)\nWBC: 7.2 10*9/L (3.8-10)\nHGB: 148 g/L (130-175)\nPLT: 230 10*9/L (150-400)",
"sections": [
{"type": "header", "content": "Cologne University Hospital - Blutbild"},
{"type": "paragraph", "content": "Patient: Max Mustermann, DOB: 15.03.1990, Male"},
{"type": "table", "content": "Blood test results with 6 parameters"}
],
"tables": [
{
"headers": ["Test", "Result", "Unit", "Reference Range"],
"rows": [
["Glucose", "92", "mg/dL", "74 - 100"],
["ALT", "22", "U/L", "< 35"],
["Creatinine", "0.9", "mg/dL", "0.7 - 1.2"],
["WBC", "7.2", "10*9/L", "3.8 - 10"],
["HGB", "148", "g/L", "130 - 175"],
["PLT", "230", "10*9/L", "150 - 400"]
]
}
]
}
}
],
"metadata": {
"detected_language": "de",
"confidence": "high"
},
"icr_metadata": {
"engine": "kantesti-icr",
"version": "1.0.0",
"images_processed": 1,
"timestamp": "2026-02-14T10:30:00Z"
}
},
"credit_cost": 0.5,
"api_version": "icr-v1",
"timestamp": "2026-02-14T10:30:00Z"
}
ICR Error Codes
| Error Code | HTTP Status | Description |
|---|---|---|
ICR_AUTH_1001 | 401 | Missing authentication credentials |
ICR_AUTH_1002 | 401 | Invalid username or password |
ICR_QUOTA_1101 | 403 | Insufficient credits (0.5 credits required per call) |
ICR_VAL_2001 | 400 | No file uploaded |
ICR_VAL_2002 | 400 | Invalid file format (supported: PDF, JPG, JPEG, PNG) |
ICR_VAL_2003 | 400 | Multiple PDF files not allowed in single request |
ICR_VAL_2004 | 400 | Cannot mix PDF and image files in single request |
ICR_PROC_3001 | 500 | ICR text extraction failed |
ICR_PROC_3004 | 504 | Processing timeout |
ICR_SRV_5001 | 500 | Internal server error |
ICR_SRV_5002 | 503 | ICR service temporarily unavailable |
Blood test document analysis using Kantesti Kan engine. Processes blood test documents and extracts structured test parameters, patient information, and metadata.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Your API username |
password | string | Yes | Your API password |
file | file | Yes | Blood test file (PDF, JPG, JPEG, PNG) |
language | string | No | Report language code (default: en) |
pdf_password | string | No | Password for encrypted PDFs |
cURL Example
curl -X POST "https://app.aibloodtestinterpret.com/api/icr/v1/kan" \
-F "username=YOUR_USERNAME" \
-F "password=YOUR_PASSWORD" \
-F "language=en" \
-F "file=@blood_test.pdf"
Python Example
import requests
def icr_kan_analyze(file_path: str, username: str, password: str,
language: str = "en", pdf_password: str = None):
"""
Analyze blood test document using Kantesti ICR Kan engine.
Args:
file_path: Path to blood test document (PDF, JPG, JPEG, PNG)
username: API username
password: API password
language: Report language code (default: en)
pdf_password: Password for encrypted PDFs (optional)
Returns:
dict: Structured blood test parameters with patient info
"""
url = "https://app.aibloodtestinterpret.com/api/icr/v1/kan"
with open(file_path, "rb") as f:
files = {"file": (file_path, f)}
data = {
"username": username,
"password": password,
"language": language
}
if pdf_password:
data["pdf_password"] = pdf_password
response = requests.post(url, files=files, data=data, timeout=120)
response.raise_for_status()
return response.json()
# Example usage
if __name__ == "__main__":
result = icr_kan_analyze(
file_path="blood_test_report.pdf",
username="your_username",
password="your_password",
language="en"
)
print(f"Status: {result['status']}")
params = result['data']['test_parameters']
print(f"Parameters found: {len(params)}")
for param in params:
print(f" {param['name']}: {param['value']} {param['unit']} ({param['reference_range']})")
Example Response
{
"status": "success",
"data": {
"institute_info": {
"name": "Cologne University Hospital"
},
"test_metadata": {
"report_date": "10.01.2026",
"sample_type": "Blood",
"test_date": "10.01.2026"
},
"test_parameters": [
{"name": "Glucose (Fasting Blood Sugar)", "value": "92", "unit": "mg/dL", "reference_range": "74 - 100", "type": "range"},
{"name": "Alanine aminotransferase (ALT)", "value": "22", "unit": "U/L", "reference_range": "< 35", "type": "range"},
{"name": "Creatinine", "value": "0.9", "unit": "mg/dL", "reference_range": "0.7 - 1.2", "type": "range"},
{"name": "Cholesterol", "value": "185", "unit": "mg/dL", "reference_range": "< 200", "type": "range"},
{"name": "TSH", "value": "2.1", "unit": "mIU/L", "reference_range": "0.38 - 5.33", "type": "range"},
{"name": "WBC (White Blood Cell Count)", "value": "7.2", "unit": "10*9/L", "reference_range": "3.8 - 10", "type": "range"},
{"name": "RBC (Red Blood Cell Count)", "value": "4.9", "unit": "10*12/L", "reference_range": "4.5 - 5.5", "type": "range"},
{"name": "HGB (Hemoglobin)", "value": "148", "unit": "g/L", "reference_range": "130 - 175", "type": "range"},
{"name": "PLT (Platelet Count)", "value": "230", "unit": "10*9/L", "reference_range": "150 - 400", "type": "range"},
{"name": "HBsAg", "value": "Negative", "unit": "", "reference_range": "", "type": "binary"}
],
"tester_info": {
"age": "35 (Calculated from 15.03.1990 to 10.01.2026)",
"gender": "Male"
},
"kan_metadata": {
"engine": "kantesti-kan",
"version": "1.0.0",
"language": "en",
"timestamp": "2026-02-14T10:30:00Z"
}
},
"credit_cost": 0.5,
"api_version": "icr-v1",
"timestamp": "2026-02-14T10:30:00Z"
}
ICR Sandbox Endpoints
Test your ICR integration without consuming credits. Sandbox endpoints return realistic sample data.
| API | Sandbox Endpoint | Description |
|---|---|---|
| ICR Extract | /api/icr/v1/sandbox | Returns sample ICR extraction data |
| ICR Kan | /api/icr/v1/kan/sandbox | Returns sample blood test parameter data |
ICR vs OCR Performance Benchmark
| Metric | Kantesti ICR | Traditional OCR | Improvement |
|---|---|---|---|
| Processing Speed | 1.2s average | 5.7s average | 79% faster |
| Text Accuracy | 99.7% | 92.1% | +7.6% |
| Table Detection | 98.9% | 71.2% | +27.7% |
| Structured Output | JSON with sections, tables, metadata | Raw unstructured text | Full structure |
| Document Type Detection | Automatic | Not available | AI-powered |
| Multi-language Support | 100+ languages | 30-50 languages | 2x+ coverage |
| Medical Document Support | Specialized | Generic | Domain expertise |