Lincoln Cannon LLC

LinAge Calculator API

LinAge Calculator API

Calculate biological age using our LinAge API. This endpoint provides biological age assessments using advanced algorithms based on comprehensive biometric markers, offering insights into health status by comparing biological age to chronological age.

For practical use cases, read more about our LinAge Calculator. For clinical studies and scientific details, see the LinAge scientific foundation. Or read about our entire Biometric Calculator suite.

API Endpoint

Base URL

https://api.lincolncannon.co/biometric/calculate

Method

Headers

Header Value Description
Content-Type application/json Request body format
x-api-key [your API key] Authentication key

Request Parameters

Parameter Type Required Description Unit Validation
TestType string Yes Must be set to “LinAge” - Must equal “LinAge”
BirthDate string Yes Birth date in YYYY-MM-DD format - Valid date format
TestDate string No Test date in YYYY-MM-DD format (defaults to current date) - Valid date format
SEX string Yes Biological sex: “male” or “female” - Must be “male” or “female”
ALB number No Albumin g/dL Positive number
ALB_CR_RATIO_URINE number No Albumin creatinine ratio (urine) mg/g Positive number
ALP number No Alkaline phosphatase U/L Positive number
ALT number No Alanine aminotransferase U/L Positive number
AST number No Aspartate aminotransferase U/L Positive number
B12 number No Vitamin B12 pg/mL Positive number
B9 number No Vitamin B9 (Folate) ng/mL Positive number
BASO number No Basophil count K/uL Positive number
BASO_PERCENT number No Basophil percent % Positive number
BILI number No Bilirubin mg/dL Positive number
BMI number No Body mass index kg/m² Positive number
BUN number No Blood urea nitrogen mg/dL Positive number
CA number No Calcium mg/dL Positive number
CHOL number No Cholesterol mg/dL Positive number
CL number No Chloride mEq/L Positive number
CO2 number No Carbon dioxide mEq/L Positive number
COT number No Cotinine ng/mL Positive number
CR number No Creatinine mg/dL Positive number
CRP number No C-reactive protein mg/L Number (can be negative)
DBP number No Diastolic blood pressure mmHg Positive number
EOS_PERCENT number No Eosinophil percent % Positive number
FE number No Iron ug/dL Positive number
FER number No Ferritin ug/L Positive number
FIB number No Fibrinogen g/L Positive number
GGT number No Gamma-glutamyl transferase U/L Positive number
GLOB number No Globulin g/dL Positive number
GLU number No Glucose mg/dL Positive number
HBA1C number No Hemoglobin A1c % Positive number
HCT number No Hematocrit % Positive number
HDL number No High density lipoprotein mg/dL Positive number
HGB number No Hemoglobin g/dL Positive number
HR number No Heart rate bpm Positive number
K number No Potassium mEq/L Positive number
LDH number No Lactic acid dehydrogenase U/L Positive number
LDL number No Low density lipoprotein mg/dL Positive number
LinAgeCI number No LinAge Comorbidity Index (0-1) % Number between 0-1
LinAgeHUI number No LinAge Healthcare Use Index - Positive number
LinAgeSHI number No LinAge Self-Health Index - Positive number
LYMPH number No Lymphocyte count K/uL Positive number
LYMPH_PERCENT number No Lymphocyte percent % Positive number
MCH number No Mean corpuscular hemoglobin pg Positive number
MCHC number No Mean corpuscular hemoglobin concentration g/dL Positive number
MCV number No Mean corpuscular volume fL Positive number
MONO number No Monocyte count K/uL Positive number
MONO_PERCENT number No Monocyte percent % Positive number
MPV number No Mean platelet volume fL Positive number
NA number No Sodium mEq/L Positive number
NEUT number No Neutrophil count K/uL Positive number
NEUT_PERCENT number No Neutrophil percent % Positive number
NTPROBNP number No N-terminal pro-brain natriuretic peptide pg/mL Positive number
PHOS number No Phosphorus mg/dL Positive number
PLT number No Platelet count K/uL Positive number
PROT number No Protein g/dL Positive number
RBC number No Red blood cell count M/uL Positive number
RDW number No Red cell distribution width % Positive number
SBP number No Systolic blood pressure mmHg Positive number
TG number No Triglyceride mg/dL Positive number
TIBC number No Total iron binding capacity umol/L Positive number
TSAT number No Transferrin saturation % Positive number
UA number No Uric acid mg/dL Positive number
WBC number No White blood cell count K/uL Positive number
AN_DX boolean No Anemia diagnosis flag - true/false
AP_DX boolean No Angina diagnosis flag - true/false
AR_DX boolean No Arthritis diagnosis flag - true/false
AS_DX boolean No Asthma diagnosis flag - true/false
CA_DX boolean No Malignancy diagnosis flag - true/false
CB_DX boolean No Chronic bronchitis diagnosis flag - true/false
CHD_DX boolean No Coronary heart disease diagnosis flag - true/false
CI_DX boolean No Cognitive impairment diagnosis flag - true/false
DM_DX boolean No Diabetes mellitus diagnosis flag - true/false
EMPH_DX boolean No Emphysema diagnosis flag - true/false
HTN_DX boolean No Hypertension diagnosis flag - true/false
LD_DX boolean No Liver disease diagnosis flag - true/false
OB_DX boolean No Obesity diagnosis flag - true/false
OP_DX boolean No Osteoporosis diagnosis flag - true/false
PHF_DX boolean No Previous hip fracture diagnosis flag - true/false
PMI_DX boolean No Previous myocardial infarction diagnosis flag - true/false
POH_DX boolean No Previous overnight hospitalization diagnosis flag - true/false
PS_DX boolean No Previous stroke diagnosis flag - true/false
PSF_DX boolean No Previous spine fracture diagnosis flag - true/false
PWF_DX boolean No Previous wrist fracture diagnosis flag - true/false
RI_DX boolean No Renal impairment diagnosis flag - true/false
TD_DX boolean No Thyroid disease diagnosis flag - true/false
CH_DX string No Current health: “better”, “same”, or “worse” - Must be one of allowed values
GH_DX string No General health: “good”, “fair”, or “poor” - Must be one of allowed values

Parameter Notes

Response Structure

Field Type Description
function string Name of the executed function
result object Contains calculated ages
result.biological number Calculated biological age (LinAge)
result.chronological number Chronological age based on birth and test dates
result.difference number Difference between biological and chronological ages
result.LinAge number Raw LinAge value before rounding
message string Descriptive summary of results

Example Request

{
  "TestType": "LinAge",
  "BirthDate": "1974-12-01",
  "TestDate": "2018-02-01",
  "SEX": "male",
  "ALB": 4.2,
  "ALB_CR_RATIO_URINE": 3.978506488,
  "ALP": 86,
  "ALT": 20,
  "AST": 26,
  "B12": 382.0,
  "B9": 13.51,
  "BASO": 0,
  "BASO_PERCENT": 1,
  "BILI": 0.3976,
  "BMI": 30.94,
  "BUN": 12.89,
  "CA": 9.42,
  "CHOL": 139.97,
  "CL": 106.3,
  "CO2": 21,
  "COT": 200,
  "CR": 0.90,
  "CRP": -21.20,
  "DBP": 95,
  "EOS_PERCENT": 3.4,
  "FE": 83.0,
  "FER": 32,
  "FIB": 3.13,
  "GGT": 25,
  "GLOB": 3.4,
  "GLU": 87.0,
  "HBA1C": 5.5,
  "HCT": 46.2,
  "HDL": 50.65,
  "HGB": 15.4,
  "HR": 58,
  "K": 4.28,
  "LDH": 201,
  "LDL": 85.65,
  "LYMPH": 1.9,
  "LYMPH_PERCENT": 41.3,
  "MCH": 30.9,
  "MCHC": 33.5,
  "MCV": 92.3,
  "MONO": 0.5,
  "MONO_PERCENT": 10.5,
  "MPV": 9.4,
  "NA": 140.9,
  "NEUT": 2,
  "NEUT_PERCENT": 43.8,
  "NTPROBNP": 3.670715483,
  "PHOS": 3.0,
  "PLT": 167,
  "PROT": 7.6,
  "RBC": 5,
  "RDW": 13.7,
  "SBP": 142,
  "TG": 41.98,
  "TIBC": 52.98,
  "TSAT": 28,
  "UA": 6.0,
  "WBC": 4.6,
  "AN_DX": false,
  "AP_DX": false,
  "AR_DX": false,
  "AS_DX": false,
  "CA_DX": false,
  "CB_DX": false,
  "CHD_DX": false,
  "CI_DX": false,
  "DM_DX": false,
  "EMPH_DX": false,
  "HTN_DX": true,
  "LD_DX": false,
  "OB_DX": true,
  "OP_DX": false,
  "PHF_DX": false,
  "PMI_DX": false,
  "POH_DX": false,
  "PS_DX": false,
  "PSF_DX": false,
  "PWF_DX": false,
  "RI_DX": false,
  "TD_DX": false,
  "CH_DX": "same",
  "GH_DX": "good"
}

Example Response

{
  "function": "LincolnCannonLLCBiometric-prod-calculate",
  "result": {
    "biological": 48.54,
    "chronological": 43.17,
    "difference": 5.37,
    "LinAge": 48.53706559
  },
  "message": "For a person with the specified biometrics and test date, we calculated a chronological age of 43.17 years and an estimated biological age of 48.54 years, which differ by 5.37 years."
}

Implementation Examples

JavaScript Implementation

async function calculateLinAge(biometricData) {
    const requestBody = {
        TestType: "LinAge",
        ...biometricData
    };

    try {
        const response = await fetch('https://api.lincolncannon.co/biometric/calculate', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                'x-api-key': process.env.API_KEY
            },
            body: JSON.stringify(requestBody)
        });

        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }

        const data = await response.json();
        return data;
    } catch (error) {
        console.error('Error calculating LinAge:', error);
        throw error;
    }
}

// Usage example
const linAgeData = {
    BirthDate: '1974-12-01',
    TestDate: '2018-02-01',
    ALT: 20,
    ALB: 4.2,
    ALP: 86,
    // ... other biometrics ...
    SEX: 'male'
};

const linAgeResult = await calculateLinAge(linAgeData);
console.log('Biological Age:', linAgeResult.result.biological);
console.log('Age Difference:', linAgeResult.result.difference);

Python Implementation

import requests
import os

class LinAgeCalculator:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = "https://api.lincolncannon.co/biometric/calculate"
        self.headers = {
            'Content-Type': 'application/json',
            'x-api-key': api_key
        }

    def calculate_linage(self, biometric_data):
        """Calculate biological age using LinAge"""
        request_body = {
            "TestType": "LinAge",
            **biometric_data
        }

        try:
            response = requests.post(
                self.base_url,
                headers=self.headers,
                json=request_body
            )
            response.raise_for_status()
            return response.json()
        except requests.exceptions.RequestException as e:
            print(f"Error calculating LinAge: {e}")
            raise

# Usage example
calculator = LinAgeCalculator(os.getenv('API_KEY'))

linage_data = {
    'BirthDate': '1974-12-01',
    'TestDate': '2018-02-01',
    'ALT': 20,
    'ALB': 4.2,
    'ALP': 86,
    # ... other biometrics ...
    'SEX': 'male'
}

linage_result = calculator.calculate_linage(linage_data)
print(f"Biological Age: {linage_result['result']['biological']} years")
print(f"Age Difference: {linage_result['result']['difference']} years")

Error Handling

Common Error Responses

HTTP Status Error Code Description
400 INVALID_REQUEST Missing or invalid parameters
401 UNAUTHORIZED Invalid or missing API key
422 VALIDATION_ERROR Invalid date format or biometric values
500 INTERNAL_ERROR Server processing error

Error Response Format

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "BirthDate Is Invalid: BirthDate Is Required",
    "details": {
      "field": "BirthDate",
      "value": null
    }
  }
}

Specific Validation Errors

Error Type Description Common Causes
[Parameter] Is Required Missing required parameter Parameter not included in request
[Parameter] Is Invalid number Invalid numeric value Non-numeric or infinite values
[Parameter] Has Invalid Value Value outside acceptable range Negative or zero values for biometrics
Calculated biological age is null Algorithm cannot process inputs Extreme or invalid biometric combinations
Calculated biological age is negative Algorithm produced negative result Invalid biometric combinations

Authentication

API Key Requirements

All requests to the LinAge API require authentication using an API key:

  1. Obtain API Key: Contact Lincoln Cannon LLC to receive your API key
  2. Include in Headers: Add your API key to the x-api-key header

Security Best Practices

Practice Description
Secure Storage Store API keys securely, never in client-side code
Environment Variables Use environment variables for API key storage
HTTPS Only Always use HTTPS for API communications
Key Rotation Regularly rotate API keys for enhanced security

Support & Troubleshooting

Common Issues

Issue Solution
Invalid date format Ensure dates are in YYYY-MM-DD format
Missing required fields Verify all required biometric parameters are included
API key authentication Check that your API key is valid and included in headers
Biometric value ranges Verify biometric values are within expected ranges
Unit confusion Use correct units for all biometrics (see parameter table)

Testing Your Integration

  1. Validate Date Formats: Ensure all dates use YYYY-MM-DD format
  2. Check Biometric Ranges: Verify biometric values are realistic and within expected ranges
  3. Error Handling: Implement proper error handling for API responses
  4. Unit Verification: Confirm all biometric values use the correct units

Getting Help

If you encounter issues with the LinAge API:

  1. Check Documentation: Review this guide for parameter requirements
  2. Validate Input Data: Ensure all required fields are provided with correct formats
  3. Test with Sample Data: Use the provided examples to verify your implementation
  4. Contact Support: Reach out to Lincoln Cannon LLC for technical assistance