Lincoln Cannon LLC

Biometric Calculator

Calculate precise age metrics and biological age assessments using advanced algorithms from Lincoln Cannon LLC. Our Biometric Calculator API provides both chronological age calculations and PhenoAge biological age assessments based on comprehensive biometric data. Built on AWS infrastructure, the API ensures high availability, security, and scalability for health and wellness applications.

Table of Contents

Overview

The Biometric Calculator API offers two primary calculation types designed for health and wellness applications:

Key Features

Feature Description
Precise Age Calculation Accurate chronological age with detailed breakdowns
Biological Age Assessment PhenoAge algorithms for health status evaluation
Multiple Time Units Results in years, months, weeks, and days
Statistical Adjustments Compensates for sparse data in older populations
Comprehensive Biometrics Nine key health markers for biological age calculation
RESTful API Simple POST requests with JSON responses
AWS Infrastructure High availability, security, and scalability
Enterprise Ready Suitable for both small-scale and large enterprise solutions

Use Cases

The API is ideal for developers and businesses in the health and wellness industry:

API Endpoints

Base URL

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

Method

Headers

Header Value Description
Content-Type application/json Request body format
Origin [your scheme, hostname, and optional port] Your application’s origin
x-api-key [your API key] Authentication key

ChronoAge

ChronoAge is designed to calculate an individual’s chronological age based on their birth and test dates. This API provides detailed age metrics in years, months, weeks, and days, offering a comprehensive view of age progression.

Request Parameters

Parameter Type Required Description
TestType string Yes Must be set to “ChronoAge”
BirthDate string Yes Birth date in YYYY-MM-DD format
TestDate string No Test date in YYYY-MM-DD format (defaults to current date)

Response Structure

Field Type Description
function string Name of the executed function
result object Contains calculated age metrics
result.days number Total number of days
result.months number Total number of months
result.weeks number Total number of weeks
result.years number Total number of years
result.monthsWeeksDays object Detailed breakdown in months, weeks, and days
result.weeksDays object Detailed breakdown in weeks and days
result.yearsMonthsWeeksDays object Detailed breakdown in years, months, weeks, and days
message string Descriptive summary of results

Example Request

{
  "TestType": "ChronoAge",
  "BirthDate": "1974-12-01",
  "TestDate": "2024-01-31"
}

Example Response

{
  "function": "LincolnCannonLLCBiometric-prod-calculate",
  "result": {
    "days": 17958,
    "months": 590,
    "monthsWeeksDays": {
      "months": 589,
      "weeks": 4,
      "days": 2
    },
    "weeks": 2565.43,
    "weeksDays": {
      "weeks": 2565,
      "days": 3
    },
    "years": 49.17,
    "yearsMonthsWeeksDays": {
      "years": 49,
      "months": 1,
      "weeks": 4,
      "days": 2
    }
  },
  "message": "For a person with the specified birth and calculation dates, we calculated a chronological age of 49 years, 1 months, 4 weeks, and 2 days. This is the equivalent of 49.17 years, or 590 months, or 2565.43 weeks, or 17958 days."
}

PhenoAge

PhenoAge is designed to calculate an individual’s biological age based on various biometric inputs. This API provides insights into a person’s health status by comparing their biological age to their chronological age.

Scientific Foundation

The PhenoAge algorithms implemented in this API are based on peer-reviewed scientific research by Dr. Morgan Levine and colleagues. These algorithms have been validated across diverse populations and are widely used in clinical research, population studies, and preventive medicine.

Key Publications

PhenoAge1 Algorithm:

PhenoAge2 Algorithm:

Statistical Adjustments:

Request Parameters

Parameter Type Required Description
TestType string Yes Must be set to “PhenoAge”
BirthDate string Yes Birth date in YYYY-MM-DD format
TestDate string No Test date in YYYY-MM-DD format (defaults to current date)
Albumin number Yes Albumin level in g/dL
ALP number Yes Alkaline phosphatase level in U/L
Creatinine number Yes Creatinine level in mg/dL
CRP number Yes C-reactive protein level in mg/dL
Glucose number Yes Glucose level in mg/dL
Lymph number Yes Lymphocyte percentage in %
MCV number Yes Mean corpuscular volume in fL
RDW number Yes Red cell distribution width in %
WBC number Yes White blood cell count in 1000/uL

Response Structure

Field Type Description
function string Name of the executed function
result object Contains calculated ages
result.biological number Calculated biological age (adjustedPhenoAge2)
result.chronological number Chronological age based on birth and test dates
result.difference number Difference between biological and chronological ages
result.PhenoAge1 number Biological age using PhenoAge1 algorithm
result.adjustedPhenoAge1 number PhenoAge1 with statistical adjustment for older persons
result.PhenoAge2 number Biological age using PhenoAge2 algorithm
result.adjustedPhenoAge2 number PhenoAge2 with statistical adjustment for older persons
message string Descriptive summary of results

Example Request

{
  "TestType": "PhenoAge",
  "BirthDate": "1974-12-01",
  "TestDate": "2024-01-31",
  "Albumin": 4.5,
  "ALP": 85,
  "Creatinine": 1.11,
  "CRP": 0.88,
  "Glucose": 92,
  "Lymph": 36,
  "MCV": 90,
  "RDW": 12.9,
  "WBC": 5.1
}

Example Response

{
  "function": "LincolnCannonLLCBiometric-prod-calculate",
  "result": {
    "biological": 42.92,
    "chronological": 49.17,
    "difference": -6.25,
    "PhenoAge1": 41.7651318173571,
    "adjustedPhenoAge1": 41.34673188557684,
    "PhenoAge2": 43.38113049985819,
    "adjustedPhenoAge2": 42.92193734280278
  },
  "message": "For a person with the specified biometrics and test date, we calculated a chronological age of 49.17 years and an estimated biological age of 42.92 years, which differ by -6.25 years."
}

Infrastructure & Reliability

AWS Infrastructure

The Biometric Calculator API is built on AWS infrastructure, providing enterprise-grade reliability and performance:

Infrastructure Feature Benefit
High Availability 99.9% uptime with automatic failover
Scalability Handles high volumes of requests for both small and large applications
Security Enterprise-grade security with encrypted data transmission
Performance Optimized for fast response times and low latency
Reliability Robust error handling and graceful degradation

Architecture Benefits

Data Processing

The API efficiently processes comprehensive biometric inputs including:

Authentication

API Key Requirements

All requests to the Biometric Calculator 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
  3. Origin Validation: Ensure your origin domain is registered with our system

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

Error Handling

Common Error Responses

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

Error Response Format

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid birth date format. Expected YYYY-MM-DD",
    "details": {
      "field": "BirthDate",
      "value": "1974/12/01"
    }
  }
}

Implementation Examples

JavaScript Implementation

// ChronoAge calculation
async function calculateChronoAge(birthDate, testDate = null) {
    const requestBody = {
        TestType: "ChronoAge",
        BirthDate: birthDate,
        ...(testDate && { TestDate: testDate })
    };

    try {
        const response = await fetch('https://api.lincolncannon.co/biometric/calculate', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                'Origin': window.location.origin,
                '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 ChronoAge:', error);
        throw error;
    }
}

// PhenoAge calculation
async function calculatePhenoAge(biometricData) {
    const requestBody = {
        TestType: "PhenoAge",
        ...biometricData
    };

    try {
        const response = await fetch('https://api.lincolncannon.co/biometric/calculate', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                'Origin': window.location.origin,
                '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 PhenoAge:', error);
        throw error;
    }
}

// Usage examples
const chronoAgeResult = await calculateChronoAge('1974-12-01', '2024-01-31');
console.log('Chronological Age:', chronoAgeResult.result.years);

const phenoAgeData = {
    BirthDate: '1974-12-01',
    TestDate: '2024-01-31',
    Albumin: 4.5,
    ALP: 85,
    Creatinine: 1.11,
    CRP: 0.88,
    Glucose: 92,
    Lymph: 36,
    MCV: 90,
    RDW: 12.9,
    WBC: 5.1
};

const phenoAgeResult = await calculatePhenoAge(phenoAgeData);
console.log('Biological Age:', phenoAgeResult.result.biological);
console.log('Age Difference:', phenoAgeResult.result.difference);

Python Implementation

import requests
import os
from datetime import datetime

class BiometricCalculator:
    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',
            'Origin': 'https://yourdomain.com',
            'x-api-key': api_key
        }

    def calculate_chrono_age(self, birth_date, test_date=None):
        """Calculate chronological age"""
        request_body = {
            "TestType": "ChronoAge",
            "BirthDate": birth_date
        }
        
        if test_date:
            request_body["TestDate"] = test_date

        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 ChronoAge: {e}")
            raise

    def calculate_pheno_age(self, biometric_data):
        """Calculate biological age using PhenoAge"""
        request_body = {
            "TestType": "PhenoAge",
            **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 PhenoAge: {e}")
            raise

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

# ChronoAge calculation
chrono_result = calculator.calculate_chrono_age('1974-12-01', '2024-01-31')
print(f"Chronological Age: {chrono_result['result']['years']} years")

# PhenoAge calculation
pheno_data = {
    'BirthDate': '1974-12-01',
    'TestDate': '2024-01-31',
    'Albumin': 4.5,
    'ALP': 85,
    'Creatinine': 1.11,
    'CRP': 0.88,
    'Glucose': 92,
    'Lymph': 36,
    'MCV': 90,
    'RDW': 12.9,
    'WBC': 5.1
}

pheno_result = calculator.calculate_pheno_age(pheno_data)
print(f"Biological Age: {pheno_result['result']['biological']} years")
print(f"Age Difference: {pheno_result['result']['difference']} years")

Healthcare Application Integration

<!DOCTYPE html>
<html>
<head>
    <title>Health Assessment Platform</title>
</head>
<body>
    <header>
        <h1>Biometric Age Assessment</h1>
        <nav>
            <a href="/dashboard">Dashboard</a>
            <a href="/assessments">Assessments</a>
            <a href="/reports">Reports</a>
        </nav>
    </header>
    
    <main>
        <section class="assessment-form">
            <h2>Biological Age Calculator</h2>
            <form id="phenoAgeForm">
                <div class="form-group">
                    <label for="birthDate">Birth Date:</label>
                    <input type="date" id="birthDate" required>
                </div>
                
                <div class="form-group">
                    <label for="albumin">Albumin (g/dL):</label>
                    <input type="number" id="albumin" step="0.1" required>
                </div>
                
                <div class="form-group">
                    <label for="alp">Alkaline Phosphatase (U/L):</label>
                    <input type="number" id="alp" required>
                </div>
                
                <!-- Additional biometric fields -->
                
                <button type="submit">Calculate Biological Age</button>
            </form>
            
            <div id="results" class="results-section" style="display: none;">
                <h3>Assessment Results</h3>
                <div id="resultContent"></div>
            </div>
        </section>
    </main>
    
    <script>
        document.getElementById('phenoAgeForm').addEventListener('submit', async function(e) {
            e.preventDefault();
            
            const formData = {
                TestType: "PhenoAge",
                BirthDate: document.getElementById('birthDate').value,
                TestDate: new Date().toISOString().split('T')[0],
                Albumin: parseFloat(document.getElementById('albumin').value),
                ALP: parseInt(document.getElementById('alp').value),
                // Add other biometric fields
            };
            
            try {
                const response = await fetch('https://api.lincolncannon.co/biometric/calculate', {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json',
                        'Origin': window.location.origin,
                        'x-api-key': process.env.API_KEY
                    },
                    body: JSON.stringify(formData)
                });
                
                if (!response.ok) {
                    throw new Error(`HTTP error! status: ${response.status}`);
                }
                
                const data = await response.json();
                displayResults(data);
            } catch (error) {
                console.error('Error:', error);
                alert('Error calculating biological age. Please try again.');
            }
        });
        
        function displayResults(data) {
            const resultsDiv = document.getElementById('results');
            const contentDiv = document.getElementById('resultContent');
            
            contentDiv.innerHTML = `
                <div class="result-item">
                    <strong>Chronological Age:</strong> ${data.result.chronological.toFixed(1)} years
                </div>
                <div class="result-item">
                    <strong>Biological Age:</strong> ${data.result.biological.toFixed(1)} years
                </div>
                <div class="result-item">
                    <strong>Age Difference:</strong> ${data.result.difference.toFixed(1)} years
                </div>
                <div class="result-item">
                    <strong>Health Status:</strong> ${getHealthStatus(data.result.difference)}
                </div>
            `;
            
            resultsDiv.style.display = 'block';
        }
        
        function getHealthStatus(difference) {
            if (difference < -5) return 'Excellent - Younger biological age';
            if (difference < -2) return 'Good - Slightly younger biological age';
            if (difference < 2) return 'Normal - Age-appropriate biological age';
            if (difference < 5) return 'Fair - Slightly older biological age';
            return 'Poor - Significantly older biological age';
        }
    </script>
</body>
</html>

Support & Troubleshooting

Common Issues

Issue Solution
Invalid date format Ensure dates are in YYYY-MM-DD format
Missing required fields Verify all required parameters are included
API key authentication Check that your API key is valid and included in headers
Origin validation Ensure your domain is registered with Lincoln Cannon LLC
Biometric value ranges Verify biometric values are within expected ranges

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. Test Both Endpoints: Test both ChronoAge and PhenoAge calculations
  4. Error Handling: Implement proper error handling for API responses

Debug Mode

Enable detailed logging for troubleshooting:

// Enable detailed logging
const debugMode = true;

async function calculateAge(data) {
    if (debugMode) {
        console.log('Request data:', data);
    }
    
    try {
        const response = await fetch('https://api.lincolncannon.co/biometric/calculate', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                'Origin': window.location.origin,
                'x-api-key': process.env.API_KEY
            },
            body: JSON.stringify(data)
        });
        
        if (debugMode) {
            console.log('Response status:', response.status);
        }
        
        const result = await response.json();
        
        if (debugMode) {
            console.log('Response data:', result);
        }
        
        return result;
    } catch (error) {
        console.error('API Error:', error);
        throw error;
    }
}

Getting Help

If you encounter issues with the Biometric Calculator 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

Performance Considerations

Need Professional Assistance?

Lincoln Cannon LLC provides custom biometric analysis solutions and integration services. Contact us to discuss your specific requirements and get expert guidance for your implementation.