REST · JSON · POST

Lab results trend API and blood test comparison API

Send a series of dated blood tests and get the direction and strength of every parameter over time, chart-ready data, and a written comparison of what changed.

POST /api/v1/analytics/trends/analyze

Trend comparison

Key capabilities

Two endpoints cover results over time. The Trend Analysis AI API takes 2 to 50 dated tests and returns a trend per parameter with statistics and chart configuration. The Blood Test Comparison API takes 2 to 20 tests that share at least one parameter and explains the changes between them in a narrative. Both answer in the language you request.

  • Structured JSON

    Stable English keys and codes, with text in the language you request.

  • Free sandbox

    The sandbox endpoint returns a sample response in the shape of the live one and uses no credits.

  • One credit per call

    A successful analyze call uses one credit. Sandbox calls are free.

  • API key authentication

    Send your key as a Bearer token in the Authorization header. Never put a key in a URL.

Diagram: How it works (Trend comparison) – Two or more reports → Kantesti API → Changes over time → Your app
How it works: Two or more reports → Kantesti API → Changes over time → Your app.

Example request and response

POST /api/v1/analytics/trends/analyze Live

POST /api/v1/analytics/trends/sandbox Sandbox

POST /api/v1/bloodtest/comparison/analyze Live

POST /api/v1/bloodtest/comparison/sandbox Sandbox

Endpoint reference

curl -X POST "https://app.aibloodtestinterpret.com/api/v1/analytics/trends/sandbox" \
  -H "Authorization: Bearer kt_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"language":"en"}'
import requests

resp = requests.post(
    "https://app.aibloodtestinterpret.com/api/v1/analytics/trends/sandbox",
    headers={"Authorization": "Bearer kt_live_YOUR_API_KEY"},
    json={"language": "en"},
    timeout=60,
)
print(resp.json())
const resp = await fetch("https://app.aibloodtestinterpret.com/api/v1/analytics/trends/sandbox", {
  method: "POST",
  headers: {
    Authorization: "Bearer kt_live_YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"language":"en"}),
});
console.log(await resp.json());
<?php
$ch = curl_init('https://app.aibloodtestinterpret.com/api/v1/analytics/trends/sandbox');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer kt_live_YOUR_API_KEY',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => json_encode(['language' => 'en']),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($result);
Response Sandbox
{
  "status": "success",
  "data": {
    "analysis_id": "TRD-SANDBOX0",
    "generated_at": "2026-11-30T12:00:00.000000Z",
    "analysis_period": {
      "start_date": "2024-01-15",
      "end_date": "2024-12-18",
      "total_tests": 4,
      "span_months": 11
    },
    "report_count": 4,
    "categories": [
      "Iron Studies",
      "… +5"
    ],
    "chart_config": {
      "dates": [
        "Jan 2024",
        "… +3"
      ],
      "raw_dates": [
        "2024-01-15",
        "… +3"
      ],
      "simple_dates": [
        "2024-01-15",
        "… +3"
      ]
    },
    "overall_health_trend": {
      "summary": "The data reveals overall improvement and stabilization in key blood parameters, with normalization …",
      "health_risks": [],
      "recommendations": []
    },
    "parameter_trends": [
      {
        "parameter": "Hemoglobin (Hb)",
        "short_name": "Hemoglobin",
        "original_names": [
          "…"
        ],
        "category": "Complete Blood Count",
        "unit": "g/dL",
        "trend_data": [
          "…"
        ],
        "statistical_analysis": {
          "…": "…"
        },
        "analysis": {
          "…": "…"
        },
        "interpretation": "Hemoglobin measures the amount of oxygen-carrying protein in red blood cells, important for oxygen …"
      },
      "… +11"
    ],
    "risk_factors": [],
    "language": "en",
    "…": "+1"
  },
  "timestamp": "2026-11-30T12:00:00.000000Z",
  "api_version": "1.0.0",
  "sandbox": true,
  "sandbox_notice": "This is sandbox test data. No actual processing was performed."
}

Sandbox response, shortened for this page. The playground shows the full body. Sample data only. No real patient data is sent or stored.

Inputs and outputs

  • Request

    What you send

    JSON with a blood_tests array. Each test needs lab_date or results_date (YYYY-MM-DD) and a parameters array with name, value and unit; reference range, category and evaluation are optional. Use the same parameter names across tests. Trend analysis also accepts analysis_type and analysis_options (include_predictions, include_statistics, include_charts).

  • Response

    What you get back

    Trend analysis: analysis_period, parameter_trends (trend data points, average, min, max, standard deviation, trend_direction, trend_strength, a written interpretation), chart_config, overall_health_trend and risk_factors. Comparison: comparison_summary, parameter_analysis (change_type, change_magnitude, trend_assessment), health_assessment, recommendations and detailed_interpretation.

Diagram: Changes over time – LDL-C, HbA1c, VIT D, Reference range
Changes over time. Changes between two or more reports.

Use cases

  • Draw parameter charts in a patient portal from chart_config and trend_data.

  • Summarise for a clinician what changed since the last visit.

  • Follow a patient with repeated panels, for example lipids or HbA1c over several months.

  • Combine with the blood test API: extract each report, then send the series here.

Who uses this API

Sectors that typically integrate this module.

All solutions

Questions

How many blood tests can I send in one request?

Trend analysis accepts 2 to 50 tests per request, comparison 2 to 20. Every test needs a lab date or a results date.

What is the difference between trend analysis and comparison?

Trend analysis returns statistics, direction and strength per parameter and chart data over many dates. Comparison returns a narrative of what changed between reports, with change type and magnitude per parameter.

Do I have to normalise parameter names?

Use consistent names across the tests you send so a parameter can be followed over time. The blood test API returns structured names you can reuse.

Does the lab trend API predict disease?

No. It describes how measured values moved and gives educational context. It is not a diagnosis and does not replace a physician.

Other API modules

Start building

Free sandbox access. Buy credits only when you go live.

Kantesti® API illustration: Lab results trend API and blood test comparison API
Lab results trend API: send 2 to 50 dated blood tests and get per-parameter trends, statistics and chart data, or a narrative comparison of reports.