API Endpoints

Complete reference for all Kantesti Blood Test API endpoints with code examples in multiple languages.

Base URL
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.

APIEndpointStatus
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

DateVersionChanges
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.

VersionEndpointStatus
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
Note

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).

Default Language

If no language parameter is provided, the API returns responses in English (en).

Major World Languages

CodeLanguageNative Name
enEnglishEnglish
zhChinese中文
esSpanishEspañol
arArabicالعربية
hiHindiहिन्दी
ptPortuguesePortuguês
ruRussianРусский
jaJapanese日本語
frFrenchFrançais
deGermanDeutsch
koKorean한국어
trTurkishTürkçe

European Languages

CodeLanguageNative Name
itItalianItaliano
nlDutchNederlands
plPolishPolski
elGreekΕλληνικά
svSwedishSvenska
noNorwegianNorsk
daDanishDansk
fiFinnishSuomi
csCzechČeština
ukUkrainianУкраїнська
roRomanianRomână
huHungarianMagyar
bgBulgarianБългарски
hrCroatianHrvatski
skSlovakSlovenčina
slSlovenianSlovenščina
srSerbianСрпски
ltLithuanianLietuvių
lvLatvianLatviešu
etEstonianEesti
caCatalanCatalà
euBasqueEuskara
glGalicianGalego
cyWelshCymraeg
gaIrishGaeilge
isIcelandicÍslenska
mtMalteseMalti
sqAlbanianShqip
mkMacedonianМакедонски
bsBosnianBosanski
lbLuxembourgishLëtzebuergesch
beBelarusianБеларуская

Middle Eastern & Central Asian Languages

CodeLanguageNative Name
heHebrewעברית
faPersianفارسی
azAzerbaijaniAzərbaycan
kaGeorgianქართული
hyArmenianՀայերdelays
kkKazakhҚазақша
uzUzbekOʻzbek
tgTajikТоҷикӣ
kyKyrgyzКыргызча
tkTurkmenTürkmen
mnMongolianМонгол
psPashtoپښتو
kuKurdishKurdî

South Asian Languages

CodeLanguageNative Name
bnBengaliবাংলা
taTamilதமிழ்
teTeluguతెలుగు
mrMarathiमराठी
guGujaratiગુજરાતી
knKannadaಕನ್ನಡ
mlMalayalamമലയാളം
paPunjabiਪੰਜਾਬੀ
urUrduاردو
neNepaliनेपाली
siSinhalaසිංහල
sdSindhiسنڌي
asAssameseঅসমীয়া
orOdiaଓଡ଼ିଆ

Southeast Asian Languages

CodeLanguageNative Name
idIndonesianBahasa Indonesia
thThaiไทย
viVietnameseTiếng Việt
msMalayBahasa Melayu
myMyanmar (Burmese)မြန်မာ
kmKhmerភាសាខ្មែរ
loLaoລາວ
filFilipinoFilipino
tlTagalogTagalog
jvJavaneseBasa Jawa
suSundaneseBasa Sunda

African Languages

CodeLanguageNative Name
afAfrikaansAfrikaans
swSwahiliKiswahili
amAmharicአማርኛ
haHausaHausa
yoYorubaYorùbá
igIgboIgbo
zuZuluisiZulu
xhXhosaisiXhosa
soSomaliSoomaali
mgMalagasyMalagasy

Other Languages

CodeLanguageNative Name
laLatinLatina
eoEsperantoEsperanto
yiYiddishייִדיש
htHaitian CreoleKreyòl Ayisyen
miMaoriTe Reo Māori
smSamoanGagana Samoa
toTonganLea Faka-Tonga
hawHawaiianʻŌlelo Hawaiʻi

Blood Test Analysis API

Analyze blood test images or PDFs using AI to extract parameters and generate comprehensive medical interpretations.

POST /api/v11/01-06-2025/analyze Latest

Production endpoint for blood test analysis. Consumes 1 credit per request.

Request Parameters

ParameterTypeRequiredDescription
usernamestringYesYour API username
passwordstringYesYour API password
filefileYesBlood test image (PNG, JPG, WEBP) or PDF. Max 20MB.
languagestringNoResponse 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
FieldTypeDescription
statusstring"success" or "error"
dataobjectContains all analysis results
timestampstringISO 8601 timestamp of response
api_versionstringAPI version used for processing
data.metadata Object
FieldTypeDescription
lab_datestringBlood collection date (YYYY-MM-DD)
results_datestringResults issue date (YYYY-MM-DD)
lab_namestringLaboratory name
lab_citystringLaboratory city
lab_countrystringLaboratory country
patient_namestringPatient's full name (metadata only, not sent to interpretation)
patient_agestringPatient's age
patient_sexstring"male", "female", or "other"
data.parameters Array Item
FieldTypeDescription
categorystringParameter category (e.g., "Complete Blood Count", "Lipid Panel")
long_namestringFull parameter name
short_namestringAbbreviated parameter name
resultstringMeasured value
unitstringUnit of measurement
range_minstringMinimum reference range
range_maxstringMaximum reference range
evaluationstringResult status. See evaluation values
data.interpretation Array Item
FieldTypeDescription
titlestringSection title (e.g., "Overall Health Assessment")
contentstringAI-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"
}
Response Keywords

The evaluation field uses standardized values. See evaluation values.

POST /api/v11/health-score/analyze Latest

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"}
  ]
}
Response Keywords

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.

Sandbox Benefits
  • No quota consumption
  • Returns realistic test data
  • Same request format as production
  • Test your integration before going live
  • Available for all API versions
APISandbox 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
Comparison API vs Trend Analysis API

Choose the right API for your use case:

FeatureAI Blood Test ComparisonTrend Analysis
Primary FocusAI narrative comparisonStatistical trend analysis
AI ProcessingFull AI narrativeAI-enhanced + statistics
Output TypeNarrative summariesCharts, statistics, patterns
Best ForWhat changed between testsLong-term parameter tracking
Min Tests22
Max Tests2050

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.

Nutrition Diet AI with Supplements

Generate personalized nutrition plans, diet recommendations, and supplement suggestions based on blood test analysis using advanced AI algorithms.

POST /api/v1/nutrition/diet-plan/analyze New

Generates comprehensive nutrition and supplement recommendations based on blood test parameters and patient profile.

Request Parameters

ParameterTypeRequiredDescription
usernamestringYesYour API username
passwordstringYesYour API password
languagestringNoResponse language (default: en). See supported languages.
patientobjectYesPatient demographics and health info
blood_testobjectYesBlood test parameters
health_goalsarrayNoHealth goals. See values.
dietary_restrictionsarrayNoDietary restrictions. See values.

Patient Object Schema

Patient demographics object with gender (see values) and activity_level (see values).

FieldTypeRequiredDefaultDescription
ageintegerYes-Patient age in years (18-120)
genderstringYes-Patient gender. See values
weightnumberNonullWeight in kg (for caloric calculations)
heightnumberNonullHeight in cm (for BMI calculations)
conditionsarrayNo[]Medical conditions (e.g., ["diabetes", "hypertension"])
allergiesarrayNo[]Food/supplement allergies (e.g., ["shellfish", "nuts"])
dietary_preferencesarrayNo[]Dietary preferences. See values
activity_levelstringNo"moderate"Physical activity level. See values
dietary_restrictionsarrayNo[]Dietary restrictions. See values
liked_foodsarrayNo[]Preferred foods to include (e.g., ["salmon", "spinach"])
disliked_foodsarrayNo[]Foods to avoid in recommendations (e.g., ["broccoli"])
meal_frequencyintegerNo3Preferred meals per day (2-6)
budgetstringNo"moderate"Budget level for recommendations. See values
medicationsarrayNo[]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
FieldTypeDescription
blood_marker_educationarrayEducational content about blood markers and their significance
nutrition_principlesarrayApplicable nutrition principles based on the analysis
blood_marker_education Array Item
FieldTypeDescription
markerstringMarker name with status (e.g., "Ferritin (Low)", "Vitamin D (Deficient)")
explanationstringDetailed educational explanation of the marker
normal_rangestringReference range (gender-specific if applicable)
food_recommendations.power_foods Array Item
FieldTypeDescription
foodstringFood name (e.g., "Salmon", "Spinach")
nutrientsarrayKey nutrients list (e.g., ["omega-3", "vitamin D", "protein"])
servingstringRecommended serving size/frequency (e.g., "100g, 3x per week")
whystringWhy this food is recommended based on blood markers
supplement_recommendations Array Item
FieldTypeDescription
supplementstringSupplement name (e.g., "Vitamin D3", "Iron Bisglycinate")
dosagestringRecommended dosage (e.g., "2000 IU daily", "25mg twice daily")
timingstringWhen to take (e.g., "With breakfast", "On empty stomach")
durationstringHow long to take (e.g., "3 months then retest", "Ongoing")
reasonstringWhy 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.

POST /api/v1/bloodtest/comparison/analyze

Analyzes 2-20 blood tests and provides detailed comparison with AI-generated narrative insights.

Requirements
  • Minimum 2 blood tests required
  • Maximum 20 blood tests per request
  • Each test must include lab_date or results_date
  • At least one common parameter across tests

Request Parameters

ParameterTypeRequiredDefaultDescription
usernamestringYes-Your API username
passwordstringYes-Your API password
languagestringNoenResponse language. See supported languages
blood_testsarrayYes-Array of blood test objects (2-20 tests)

blood_tests Array Structure

FieldTypeRequiredDescription
lab_datestringYes*Test date in YYYY-MM-DD format
results_datestringYes*Alternative to lab_date (YYYY-MM-DD)
parametersarrayYesArray of blood test parameters
metadataobjectNoAdditional 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

FieldTypeDescription
comparison_idstringUnique identifier for this comparison (format: CMP-XXXXXXXX)
comparison_summaryobjectOverall summary: key_findings, overall_trend, report dates, time_interval
parameter_analysisarrayDetailed analysis per parameter with change type and clinical significance
health_assessmentobjectAreas of concern, improvement, positive developments, risk factors
recommendationsobjectFollow-up tests, immediate actions, lifestyle modifications, specialist referrals
detailed_interpretationobjectAI narrative sections with executive summary and clinical recommendations

parameter_analysis Object Structure

FieldTypeDescription
parameter_namestringParameter name
report1_valuestringValue from first report with unit
report2_valuestringValue from second report with unit
change_typestringincreased, decreased, or stable
change_magnitudestringsignificant, moderate, or minor
clinical_significancestringAI explanation of what the change means
trend_assessmentstringpositive, 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 Keywords

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.

ValueDefaultDescription
comprehensiveFull analysis with statistics, charts, and AI interpretation
statisticalStatistical analysis only
summaryHigh-level summary only

health_goals Nutrition API

Health objectives for personalized nutrition recommendations. Multiple values can be provided as an array.

ValueDescription
maintainMaintain current health (default)
improve_energyFocus on energy levels
weight_managementHealthy weight management
heart_healthCardiovascular health
immune_supportImmune system support
digestive_healthDigestive wellness
bone_healthBone health
mental_clarityCognitive 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.

ValueDescription
low_sodiumReduced sodium intake
low_sugarReduced sugar intake
low_fatReduced fat intake
gluten_freeNo gluten
dairy_freeNo dairy
nut_freeNo nuts
soy_freeNo soy
egg_freeNo eggs
halalHalal-compliant
kosherKosher-compliant
Note

Free text is also accepted for custom dietary restrictions not listed above.

dietary_preferences Nutrition API

Dietary lifestyle preferences for meal planning.

ValueDescription
omnivoreNo restrictions (default)
vegetarianNo meat
veganNo animal products
pescatarianVegetarian + fish
ketoKetogenic diet
paleoPaleolithic diet
mediterraneanMediterranean diet

activity_level Nutrition API

Physical activity level for caloric and nutritional calculations.

ValueDescription
sedentaryLittle or no exercise
lightLight exercise 1-3 days/week
moderateModerate exercise 3-5 days/week (default)
activeHard exercise 6-7 days/week
very_activeVery hard exercise or physical job

budget Nutrition API

Budget level for food and supplement recommendations.

ValueDescription
lowBudget-conscious options
moderateBalanced options (default)
highPremium options

gender All APIs

Patient gender for personalized reference ranges and recommendations.

ValueDescription
maleMale patient
femaleFemale patient
otherOther 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.

ValueDescription
normalWithin normal reference range
lowBelow normal range
highAbove normal range
critical_lowCritically low (immediate attention required)
critical_highCritically high (immediate attention required)
borderline_lowSlightly below normal range
borderline_highSlightly above normal range

trend_assessment Comparison & Trend APIs

Overall assessment of parameter trends between tests.

ValueDescription
positiveImproved (moving toward normal range)
negativeWorsened (moving away from normal range)
stableRelatively unchanged between tests
improvingOverall improvement trend
worseningOverall deterioration trend

trend_direction Trend Analysis API

Direction of parameter value changes over time.

ValueDescription
upwardValues increasing over time
downwardValues decreasing over time
stableMinimal change over time

trend_strength Trend Analysis API

Magnitude of the observed trend.

ValueDescription
strong>15% change between periods
moderate5-15% change between periods
mild<5% change between periods

health_score / score_interpretation Health Score API

Overall health score interpretation based on analyzed parameters.

ValueDescription
excellentAll markers within optimal range
goodMost markers within normal range
fairSome markers need attention
poorMultiple markers need attention

Utility Endpoints

GET /api/info

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"
}
GET /api/health

Health check endpoint for monitoring. Returns service status. No authentication required.

Example Response

{
  "status": "healthy",
  "timestamp": "2025-12-22T10:30:00Z",
  "uptime": "99.99%"
}
POST /api/quota/check

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

Released: March 23, 2026

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.

100+
Languages
9
Condition Categories
14
Family Relations

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.

Key Features
  • 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

EndpointMethodDescriptionAuth
/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)
POST /api/v1/family-health/analyze Released 23.03.2026

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)

ParameterTypeRequiredDescription
usernamestringYesYour API username
passwordstringYesYour API password
patient_dataobjectYesPatient information (see below)
family_membersarrayYes*Array of family member objects (max 100). *Required if health_profile is absent
health_profileobjectYes*Patient health profile. *Required if family_members is absent
blood_test_dataarrayNoArray of blood test data objects for correlation analysis
languagestringNoResponse language code (default: en). 100+ languages supported

patient_data Object

FieldTypeRequiredDescription
namestringNoPatient full name
ageintegerYesPatient age in years
genderstringYesmale, female, or other
dobstringNoDate of birth (YYYY-MM-DD)

family_members Array Item

FieldTypeRequiredDescription
relationstringYesRelation type: father, mother, brother, sister, paternal_grandfather, paternal_grandmother, maternal_grandfather, maternal_grandmother, paternal_uncle, paternal_aunt, maternal_uncle, maternal_aunt, son, daughter
ageintegerNoFamily member age
conditionsarrayNoArray of known medical conditions (strings)
age_at_diagnosisintegerNoAge when condition was diagnosed
deceasedbooleanNoWhether the family member is deceased
age_at_deathintegerNoAge at death (if deceased)
cause_of_deathstringNoCause 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 CodeHTTP StatusDescription
AUTH_1001401Missing authentication credentials
AUTH_1002401Invalid username or password
QUOTA_1101403Insufficient API quota
QUOTA_1103429Rate limit exceeded
VAL_2001400Required field is missing (patient_data.age, patient_data.gender)
VAL_2002400Invalid data format
VAL_2003400Unsupported language code
VAL_2005400Request data cannot be empty
VAL_2006400Array exceeds maximum size (max 100 family members)
VAL_2007400Invalid patient data structure
PROC_3001500Report generation failed
PROC_3003500AI processing error
SRV_5001500Internal server error
POST /api/v1/family-health/validate

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.

APISandbox EndpointDescription
Family Health Analyze/api/v1/family-health/sandbox/analyzeReturns 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.

EndpointMethodDescription
/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

Released: February 14, 2026

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.

79%
Faster than OCR
99.7%
Accuracy Rate
100+
Languages

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.

ICR Key Features
  • 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

EndpointMethodDescriptionCost
/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
POST /api/icr/v1/extract Released 14.02.2026

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

ParameterTypeRequiredDescription
usernamestringYesYour API username
passwordstringYesYour API password
filefileYesDocument file (PDF, JPG, JPEG, PNG)
languagestringNoOutput 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 CodeHTTP StatusDescription
ICR_AUTH_1001401Missing authentication credentials
ICR_AUTH_1002401Invalid username or password
ICR_QUOTA_1101403Insufficient credits (0.5 credits required per call)
ICR_VAL_2001400No file uploaded
ICR_VAL_2002400Invalid file format (supported: PDF, JPG, JPEG, PNG)
ICR_VAL_2003400Multiple PDF files not allowed in single request
ICR_VAL_2004400Cannot mix PDF and image files in single request
ICR_PROC_3001500ICR text extraction failed
ICR_PROC_3004504Processing timeout
ICR_SRV_5001500Internal server error
ICR_SRV_5002503ICR service temporarily unavailable
POST /api/icr/v1/kan Released 14.02.2026

Blood test document analysis using Kantesti Kan engine. Processes blood test documents and extracts structured test parameters, patient information, and metadata.

Request Parameters

ParameterTypeRequiredDescription
usernamestringYesYour API username
passwordstringYesYour API password
filefileYesBlood test file (PDF, JPG, JPEG, PNG)
languagestringNoReport language code (default: en)
pdf_passwordstringNoPassword 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.

APISandbox EndpointDescription
ICR Extract/api/icr/v1/sandboxReturns sample ICR extraction data
ICR Kan/api/icr/v1/kan/sandboxReturns sample blood test parameter data

ICR vs OCR Performance Benchmark

Benchmark Results — Kantesti ICR vs Traditional OCR
MetricKantesti ICRTraditional OCRImprovement
Processing Speed1.2s average5.7s average79% faster
Text Accuracy99.7%92.1%+7.6%
Table Detection98.9%71.2%+27.7%
Structured OutputJSON with sections, tables, metadataRaw unstructured textFull structure
Document Type DetectionAutomaticNot availableAI-powered
Multi-language Support100+ languages30-50 languages2x+ coverage
Medical Document SupportSpecializedGenericDomain expertise