MAGENT

Lipids · LIVE

SCORE2-Diabetes 10-year CVD risk

Compute the ESC 2023 SCORE2-Diabetes 10-year fatal plus non-fatal CVD percent for adults aged 40-79 with type 2 diabetes from sex, current smoking, systolic blood pressure, total and HDL cholesterol, age at diabetes diagnosis, IFCC HbA1c, eGFR, and European geographic risk region.

LIVE $0.005 USDC GET /api/calc/score2_diabetes

Markdown: /docs/score2-diabetes.md · Canonical: https://magentlab.com/docs/score2-diabetes

Not a medical device. Not a diagnosis, dose, or listing recommendation.

What it computes

Compute the ESC 2023 SCORE2-Diabetes 10-year fatal plus non-fatal CVD percent for adults aged 40-79 with type 2 diabetes from sex, current smoking, systolic blood pressure, total and HDL cholesterol, age at diabetes diagnosis, IFCC HbA1c, eGFR, and European geographic risk region.

When to use

When an agent already has those SCORE2-Diabetes 2023 predictors for a person aged 40-79 with type 2 diabetes and no prior CVD and needs that paper's region-calibrated 10-year CVD percent. Not a diagnosis, statin order, SCORE2, or SCORE2-OP.

When not to use

  • Not a medical device. Not a diagnosis of cardiovascular disease. Not a statin order or treatment recommendation.
  • SCORE2-Diabetes 2023 for type 2 diabetes, ages 40-79 only. Not SCORE2 (no diabetes-specific labs). Not SCORE2-OP. Not intended for people without diabetes or with prior CVD.
  • european_risk_region is the paper's geographic calibration (low, moderate, high, very_high), not race or ethnicity.
  • HbA1c is IFCC mmol/mol, not % DCCT. Caller assigns age, sex, smoking, blood pressure, lipids, diagnosis age, HbA1c, eGFR, and European risk region. magent does not assay lipids, HbA1c, or eGFR and does not measure blood pressure.

Formula

10-year fatal+non-fatal CVD % = 100*(1-exp(-exp(scale1+scale2*ln(-ln(1-uncal))))); uncal=1-S0^exp(lp); cage=(age-60)/5; csbp=(SBP-120)/20; ctc=(TC-6)/1; chdl=(HDL-1.3)/0.5; cdiabage=(age_at_dx-50)/5; chba1c=(HbA1c_mmol_mol-31)/9.34; cegfr=(ln(eGFR)-4.5)/0.15; diabetes=1; men S0=0.9605 lp=0.5368*cage+0.4774*smoke+0.1322*csbp+0.6457*diabetes+0.1102*ctc-0.1087*chdl-0.0672*cage*smoke-0.0268*cage*csbp-0.0983*cage*diabetes-0.0181*cage*ctc+0.0095*cage*chdl-0.0998*diabetes*cdiabage+0.0955*chba1c-0.0591*cegfr+0.0058*cegfr^2-0.0134*cage*chba1c+0.0115*cage*cegfr; women S0=0.9776 lp=0.6624*cage+0.6139*smoke+0.1421*csbp+0.8096*diabetes+0.1127*ctc-0.1568*chdl-0.1122*cage*smoke-0.0167*cage*csbp-0.1272*cage*diabetes-0.0200*cage*ctc+0.0186*cage*chdl-0.118*diabetes*cdiabage+0.1173*chba1c-0.0640*cegfr+0.0062*cegfr^2-0.0196*cage*chba1c+0.0169*cage*cegfr; region scale1/scale2 SCORE2 age<70 and SCORE2-OP age 70-79; age 40-79; type 2 diabetes only; geographic region not race; not SCORE2; not SCORE2-OP

Citation

Title
SCORE2-Diabetes: 10-year cardiovascular risk estimation in type 2 diabetes in Europe
Authors
SCORE2-Diabetes working group and ESC Cardiovascular risk collaboration
Source
Eur Heart J. 2023;44(28):2544-2556
DOI
10.1093/eurheartj/ehad260

Worked example

Moderate-risk region, male, age 60, nonsmoker, SBP 140, TC 5.5, HDL 1.3, HbA1c 50, eGFR 90, diagnosis age 60

Given: age=60age_at_diabetes_diagnosis=60egfr_ml_min_1_73m2=90european_risk_region=moderatehba1c_mmol_mol=50hdl_mmol_l=1.3sbp_mm_hg=140sex=malesmoker=falsetotal_cholesterol_mmol_l=5.5

  1. cage=0; csbp=1; ctc=-0.5; chdl=0; smoke=0; diabetes=1; cdiabage=2; chba1c=(50-31)/9.34; cegfr=0
  2. men lp = 0.7175
  3. uncal = 1-0.9605^exp(lp); moderate men scale1=-0.1565 scale2=0.8009
  4. risk_10y_percent 11.0 (paper prints 11.0% for this man)

Same man with adverse diabetes factors (HbA1c 70, eGFR 60, diagnosis age 50)

Given: age=60age_at_diabetes_diagnosis=50egfr_ml_min_1_73m2=60european_risk_region=moderatehba1c_mmol_mol=70hdl_mmol_l=1.3sbp_mm_hg=140sex=malesmoker=falsetotal_cholesterol_mmol_l=5.5

  1. cdiabage=0; chba1c=(70-31)/9.34; cegfr=(ln(60)-4.5)/0.15
  2. men lp = 1.3238
  3. risk_10y_percent 17.2 (paper prints 17.2%)

Same two profiles, woman, moderate-risk region

Given: age=60age_at_diabetes_diagnosis=60egfr_ml_min_1_73m2=90european_risk_region=moderatehba1c_mmol_mol=50hdl_mmol_l=1.3sbp_mm_hg=140sex=femalesmoker=falsetotal_cholesterol_mmol_l=5.5

  1. women S0=0.9776; typical lp 0.8981 risk_10y_percent 7.6
  2. adverse lp 1.6036 risk_10y_percent 12.7 (paper prints 12.7%)

Adverse-diabetes man in low and very-high regions

Given: age=60age_at_diabetes_diagnosis=50egfr_ml_min_1_73m2=60european_risk_region=lowhba1c_mmol_mol=70hdl_mmol_l=1.3sbp_mm_hg=140sex=malesmoker=falsetotal_cholesterol_mmol_l=5.5

  1. Same lp 1.3238; low men scale1=-0.5699 scale2=0.7476 risk_10y_percent 12.9 (paper 12.9%)
  2. very_high men scale1=0.5836 scale2=0.8294 risk_10y_percent 31.2 (paper 31.2%)

Also searched as

  • SCORE2-Diabetes
  • ESC 2023 diabetes CVD risk
  • 10-year CVD risk type 2 diabetes
  • European risk region diabetes
  • HbA1c eGFR cardiovascular risk
  • SCORE2 diabetes age 40-79
  • fatal and non-fatal CVD diabetes

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/api/calc/score2_diabetes?age=60&sex=male&smoker=false&sbp_mm_hg=140&total_cholesterol_mmol_l=5.5&hdl_mmol_l=1.3&age_at_diabetes_diagnosis=60&hba1c_mmol_mol=50&egfr_ml_min_1_73m2=90&european_risk_region=moderate

Full URL: https://api.magentlab.com/api/calc/score2_diabetes?age=60&sex=male&smoker=false&sbp_mm_hg=140&total_cholesterol_mmol_l=5.5&hdl_mmol_l=1.3&age_at_diabetes_diagnosis=60&hba1c_mmol_mol=50&egfr_ml_min_1_73m2=90&european_risk_region=moderate

Call

Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params return HTTP 400 before any quote or charge.

curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/score2_diabetes?age=60&sex=male&smoker=false&sbp_mm_hg=140&total_cholesterol_mmol_l=5.5&hdl_mmol_l=1.3&age_at_diabetes_diagnosis=60&hba1c_mmol_mol=50&egfr_ml_min_1_73m2=90&european_risk_region=moderate"

Parameters

Name Type Required Description
age integer required Age in years (integer 40-79). SCORE2-Diabetes 2023 is for ages 40-79. Not SCORE2 (40-69 without diabetes labs). Not SCORE2-OP.
sex string required · female, male Sex used by the sex-specific SCORE2-Diabetes 2023 coefficients (female or male).
smoker boolean required Current cigarette smoking as assigned by the caller (true or false). magent does not take a smoking history.
sbp_mm_hg number required Systolic blood pressure in mm Hg (50-250). Enters as (SBP-120)/20. magent does not measure blood pressure.
total_cholesterol_mmol_l number required Total cholesterol in mmol/L (1.5-15). Enters as (TC-6). magent does not assay lipids.
hdl_mmol_l number required HDL cholesterol in mmol/L (0.4-4). Enters as (HDL-1.3)/0.5. magent does not assay lipids.
age_at_diabetes_diagnosis integer required Age at type 2 diabetes diagnosis in years (integer 1-79, not after current age). Enters as (age_at_dx-50)/5. Patient is assumed to have type 2 diabetes.
hba1c_mmol_mol number required HbA1c in IFCC mmol/mol (20-195), not % DCCT. Enters as (HbA1c-31)/9.34. magent does not assay HbA1c.
egfr_ml_min_1_73m2 number required Caller-assigned eGFR in mL/min/1.73 m² (5-200). Enters as (ln(eGFR)-4.5)/0.15 plus the squared term. magent does not compute CKD-EPI.
european_risk_region string required · low, moderate, high, very_high Geographic SCORE2/SCORE2-OP calibration region (low, moderate, high, or very_high) as printed for SCORE2-Diabetes. Not race. Not ethnicity.

Bulk (POST)

POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.

POST /api/calc/score2_diabetes Max 25 unit_amount + extra_item_amount * (n - 1) extra $0.002 PREVIEW

  • 1 to 25 items. Each item uses the same keys as the GET query parameters.
  • POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
  • The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
  • HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
  • Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
  • x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.

Example request (fixture)

{
  "items": [
    {
      "age": "60",
      "age_at_diabetes_diagnosis": "60",
      "egfr_ml_min_1_73m2": "90",
      "european_risk_region": "moderate",
      "hba1c_mmol_mol": "50",
      "hdl_mmol_l": "1.3",
      "sbp_mm_hg": "140",
      "sex": "male",
      "smoker": "false",
      "total_cholesterol_mmol_l": "5.5"
    },
    {
      "age": "60",
      "age_at_diabetes_diagnosis": "60",
      "egfr_ml_min_1_73m2": "90",
      "european_risk_region": "moderate",
      "hba1c_mmol_mol": "50",
      "hdl_mmol_l": "1.3",
      "sbp_mm_hg": "140",
      "sex": "male",
      "smoker": "false",
      "total_cholesterol_mmol_l": "5.5"
    }
  ]
}

Open bulk paywall →

Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.

Example 200 (fixture)

{
  "count": 2,
  "path": "/api/calc/score2_diabetes",
  "items": [
    {
      "age": 60,
      "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "SCORE2-Diabetes working group and ESC Cardiovascular risk collaboration",
        "doi": "10.1093/eurheartj/ehad260",
        "id": "score2-diabetes-2023",
        "pmid": "37247330",
        "source": "Eur Heart J. 2023;44(28):2544-2556",
        "title": "SCORE2-Diabetes: 10-year cardiovascular risk estimation in type 2 diabetes in Europe"
      },
      "formula": "score2_diabetes",
      "formula_expression": "10-year fatal+non-fatal CVD % = 100*(1-exp(-exp(scale1+scale2*ln(-ln(1-uncal))))); uncal=1-S0^exp(lp); cage=(age-60)/5; csbp=(SBP-120)/20; ctc=(TC-6)/1; chdl=(HDL-1.3)/0.5; cdiabage=(age_at_dx-50)/5; chba1c=(HbA1c_mmol_mol-31)/9.34; cegfr=(ln(eGFR)-4.5)/0.15; diabetes=1; men S0=0.9605 lp=0.5368*cage+0.4774*smoke+0.1322*csbp+0.6457*diabetes+0.1102*ctc-0.1087*chdl-0.0672*cage*smoke-0.0268*cage*csbp-0.0983*cage*diabetes-0.0181*cage*ctc+0.0095*cage*chdl-0.0998*diabetes*cdiabage+0.0955*chba1c-0.0591*cegfr+0.0058*cegfr^2-0.0134*cage*chba1c+0.0115*cage*cegfr; women S0=0.9776 lp=0.6624*cage+0.6139*smoke+0.1421*csbp+0.8096*diabetes+0.1127*ctc-0.1568*chdl-0.1122*cage*smoke-0.0167*cage*csbp-0.1272*cage*diabetes-0.0200*cage*ctc+0.0186*cage*chdl-0.118*diabetes*cdiabage+0.1173*chba1c-0.0640*cegfr+0.0062*cegfr^2-0.0196*cage*chba1c+0.0169*cage*cegfr; region scale1/scale2 SCORE2 age<70 and SCORE2-OP age 70-79; age 40-79; type 2 diabetes only; geographic region not race; not SCORE2; not SCORE2-OP",
      "sex": "male",
      "linear_predictor": 0.7175,
      "egfr_ml_min_1_73m2": 90.0,
      "sbp_mm_hg": 140.0,
      "smoker": false,
      "risk_10y_percent": 11.0,
      "european_risk_region": "moderate",
      "hdl_mmol_l": 1.3,
      "total_cholesterol_mmol_l": 5.5,
      "age_at_diabetes_diagnosis": 60,
      "hba1c_mmol_mol": 50.0
    },
    {
      "age": 60,
      "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "SCORE2-Diabetes working group and ESC Cardiovascular risk collaboration",
        "doi": "10.1093/eurheartj/ehad260",
        "id": "score2-diabetes-2023",
        "pmid": "37247330",
        "source": "Eur Heart J. 2023;44(28):2544-2556",
        "title": "SCORE2-Diabetes: 10-year cardiovascular risk estimation in type 2 diabetes in Europe"
      },
      "formula": "score2_diabetes",
      "formula_expression": "10-year fatal+non-fatal CVD % = 100*(1-exp(-exp(scale1+scale2*ln(-ln(1-uncal))))); uncal=1-S0^exp(lp); cage=(age-60)/5; csbp=(SBP-120)/20; ctc=(TC-6)/1; chdl=(HDL-1.3)/0.5; cdiabage=(age_at_dx-50)/5; chba1c=(HbA1c_mmol_mol-31)/9.34; cegfr=(ln(eGFR)-4.5)/0.15; diabetes=1; men S0=0.9605 lp=0.5368*cage+0.4774*smoke+0.1322*csbp+0.6457*diabetes+0.1102*ctc-0.1087*chdl-0.0672*cage*smoke-0.0268*cage*csbp-0.0983*cage*diabetes-0.0181*cage*ctc+0.0095*cage*chdl-0.0998*diabetes*cdiabage+0.0955*chba1c-0.0591*cegfr+0.0058*cegfr^2-0.0134*cage*chba1c+0.0115*cage*cegfr; women S0=0.9776 lp=0.6624*cage+0.6139*smoke+0.1421*csbp+0.8096*diabetes+0.1127*ctc-0.1568*chdl-0.1122*cage*smoke-0.0167*cage*csbp-0.1272*cage*diabetes-0.0200*cage*ctc+0.0186*cage*chdl-0.118*diabetes*cdiabage+0.1173*chba1c-0.0640*cegfr+0.0062*cegfr^2-0.0196*cage*chba1c+0.0169*cage*cegfr; region scale1/scale2 SCORE2 age<70 and SCORE2-OP age 70-79; age 40-79; type 2 diabetes only; geographic region not race; not SCORE2; not SCORE2-OP",
      "sex": "male",
      "linear_predictor": 0.7175,
      "egfr_ml_min_1_73m2": 90.0,
      "sbp_mm_hg": 140.0,
      "smoker": false,
      "risk_10y_percent": 11.0,
      "european_risk_region": "moderate",
      "hdl_mmol_l": 1.3,
      "total_cholesterol_mmol_l": 5.5,
      "age_at_diabetes_diagnosis": 60,
      "hba1c_mmol_mol": 50.0
    }
  ]
}

Response

Field Type Description
formula string score2_diabetes
formula_expression string SCORE2-Diabetes 2023 sex-specific coefficients and region scale1/scale2
age integer Age in years used (40-79)
sex string female or male used
smoker boolean Caller-assigned current smoking used
sbp_mm_hg number Systolic BP used, mm Hg
total_cholesterol_mmol_l number Total cholesterol used, mmol/L
hdl_mmol_l number HDL cholesterol used, mmol/L
age_at_diabetes_diagnosis integer Age at type 2 diabetes diagnosis used
hba1c_mmol_mol number HbA1c used, IFCC mmol/mol
egfr_ml_min_1_73m2 number Caller-assigned eGFR used, mL/min/1.73 m²
european_risk_region string Geographic calibration region used
linear_predictor number Sex-specific linear predictor lp, 4 decimals
risk_10y_percent number Calibrated 10-year fatal+non-fatal CVD risk percent, 1 decimal
citation object SCORE2-Diabetes working group Eur Heart J 2023 citation
disclaimer string Not-a-device notice

Example JSON

Machine form of the same example. Frozen fixture. Not a live lookup.

{
  "age": 60,
  "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
  "citation": {
    "authors": "SCORE2-Diabetes working group and ESC Cardiovascular risk collaboration",
    "doi": "10.1093/eurheartj/ehad260",
    "id": "score2-diabetes-2023",
    "pmid": "37247330",
    "source": "Eur Heart J. 2023;44(28):2544-2556",
    "title": "SCORE2-Diabetes: 10-year cardiovascular risk estimation in type 2 diabetes in Europe"
  },
  "formula": "score2_diabetes",
  "formula_expression": "10-year fatal+non-fatal CVD % = 100*(1-exp(-exp(scale1+scale2*ln(-ln(1-uncal))))); uncal=1-S0^exp(lp); cage=(age-60)/5; csbp=(SBP-120)/20; ctc=(TC-6)/1; chdl=(HDL-1.3)/0.5; cdiabage=(age_at_dx-50)/5; chba1c=(HbA1c_mmol_mol-31)/9.34; cegfr=(ln(eGFR)-4.5)/0.15; diabetes=1; men S0=0.9605 lp=0.5368*cage+0.4774*smoke+0.1322*csbp+0.6457*diabetes+0.1102*ctc-0.1087*chdl-0.0672*cage*smoke-0.0268*cage*csbp-0.0983*cage*diabetes-0.0181*cage*ctc+0.0095*cage*chdl-0.0998*diabetes*cdiabage+0.0955*chba1c-0.0591*cegfr+0.0058*cegfr^2-0.0134*cage*chba1c+0.0115*cage*cegfr; women S0=0.9776 lp=0.6624*cage+0.6139*smoke+0.1421*csbp+0.8096*diabetes+0.1127*ctc-0.1568*chdl-0.1122*cage*smoke-0.0167*cage*csbp-0.1272*cage*diabetes-0.0200*cage*ctc+0.0186*cage*chdl-0.118*diabetes*cdiabage+0.1173*chba1c-0.0640*cegfr+0.0062*cegfr^2-0.0196*cage*chba1c+0.0169*cage*cegfr; region scale1/scale2 SCORE2 age<70 and SCORE2-OP age 70-79; age 40-79; type 2 diabetes only; geographic region not race; not SCORE2; not SCORE2-OP",
  "sex": "male",
  "linear_predictor": 0.7175,
  "egfr_ml_min_1_73m2": 90.0,
  "sbp_mm_hg": 140.0,
  "smoker": false,
  "risk_10y_percent": 11.0,
  "european_risk_region": "moderate",
  "hdl_mmol_l": 1.3,
  "total_cholesterol_mmol_l": 5.5,
  "age_at_diabetes_diagnosis": 60,
  "hba1c_mmol_mol": 50.0
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_age age must be an integer from 18 to 120 Returned before settlement; you are not charged.
400 invalid_sex sex must be female or male Returned before settlement; you are not charged.
400 invalid_systolic_bp systolic_mm_hg or systolic_bp_mm_hg must be a number from 50 to 250. Returned before settlement; you are not charged.
400 invalid_score2_region european_risk_region must be low, moderate, high, or very_high as printed in SCORE2 2021 (geographic calibration, not race). Returned before settlement; you are not charged.
400 invalid_hba1c_mmol_mol hba1c_mmol_mol must be a number in the range used by SCORE2-Diabetes 2023 (IFCC mmol/mol, not % DCCT). Returned before settlement; you are not charged.
400 invalid_egfr egfr_ml_min_1_73m2 must be a number from 5 to 200 (caller-assigned eGFR; magent does not compute MDRD or CKD-EPI). Returned before settlement; you are not charged.
400 invalid_score2_diabetes SCORE2-Diabetes 2023 inputs must match that paper's age, sex, smoking, systolic BP, total and HDL cholesterol, age at diabetes diagnosis, HbA1c, eGFR, and European risk region. Returned before settlement; you are not charged.
400 invalid_items POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
400 invalid_item_count items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
400 invalid_item each items entry must be a JSON object Returned before settlement; you are not charged.

Related tools

  • SCORE2 10-year CVD risk — Compute the ESC 2021 SCORE2 10-year fatal plus non-fatal CVD percent for adults aged 40-69 from sex, current smoking, systolic blood pressure, non-HDL cholesterol, and European geographic risk region.
  • FINDRISC — Sum the original Lindström 2003 seven-item Finnish diabetes risk score (FINDRISC, 0–20) and return at_risk when the total is ≥9.
  • Bang diabetes screening — Sum the Bang 2009 Table 2 development screening score for undiagnosed diabetes and return high_risk when the total is ≥5.

Payment

Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s. Unpaid valid requests return HTTP 402 with a base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake and shared payment errors: Payments. Stdio MCP: /docs/mcp.

Guarantees

  • HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
  • exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
  • HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
  • Execution is timeout-bounded and concurrency-capped.
  • Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.