Skip to Content
⚠️ Under construction.

Longevity Assessment Quickstart

ℹ️

In order to follow this tutorial, we assume that you have:

  • completed first tutorial API Quickstart and that you have:
  • access token stored in ACCESS_TOKEN environment variable

Preparing Lifestyle Assessment Request Data

Providing only required attributes

{ "profile": { "gender": "male", "height": 180, "weight": 80, "age": 40 } }

You can send this request using the following command:

curl --request POST \ --url https://myportal.lifenome.com/api/core-api/ax-services/longevity-assessment-v2/ \ --header "Content-Type: application/json" \ --header "Authorization: Bearer ${ACCESS_TOKEN}" \ --data "${REQUEST_DATA}"

This operation will return a successful response with a JSON object containing the longevity assessment results.

{ "bmi": 24.691358024691358, "standard_life_expectancy": { "age": 40, "lifespan": 78.8, "remaining_lifespan": 38.8, "healthspan": 65.22, "remaining_healthspan": 25.22 }, "personalized_life_expectancy": { "lifespan": 82.098, "remaining_lifespan": 42.098, "healthspan": 67.95, "remaining_healthspan": 27.950000000000003, "lifespan_population_percentile": 0.6253456221198157, "healthspan_population_percentile": 0.6562790697674421 }, "dna_impact": { "diet-and-metabolism": { "impact": 0.0, "traits": {} }, "micronutrient": { "impact": 0.0, "traits": {} }, ... "lifespan_impact": 0.0 }, "lifestyle_impact": { "diet": { "quality": 0, "habits": 0, "total": 0 }, "smoking": 0, "alcohol": 0, "physical_activity": { "duration": 0, "intensity": 0, "heart_health": 0 }, "mental_wellbeing": 0, "sleep": { "duration": 0, "quality": 0, "total": 0 }, "lifespan_impact": 0 }, "improvements": { "socioeconomic": { "lifespan": 0, "healthspan": 0.0 }, "external_factors": { "details": { "future_improvements": 6.208, "pandemics": -2.91 }, "lifespan": 3.298, "healthspan": 2.73 }, "bmi": { "lifespan": 0.0, "healthspan": 0.0 }, "health_conditions": { "lifespan": 0, "healthspan": 0.0 }, "lifestyle": { "lifespan": 0, "healthspan": 0.0 }, "dna": { "lifespan": 0.0, "healthspan": 0.0 }, "biological_age": { "lifespan": 0.0, "healthspan": 0.0 } }, "improvement_potentials": { "nutrition_and_diet": { "lifespan": 6.126315789473684, "healthspan": 5.070537002404488 }, "fitness": { "lifespan": 8.232236842105262, "healthspan": 6.813534096981031 }, "sleep": { "lifespan": 4.977631578947368, "healthspan": 4.119811314453647 }, "mental_wellbeing": { "lifespan": 5.743421052631579, "healthspan": 4.753628439754208 }, "total": { "lifespan": 19.501999999999995, "healthspan": 16.141122335025376 } } }

The main properties of the response are:

  • standard_life_expectancy: standard life expectancy assessment based on part of user profile (gender and age)
  • personalized_life_expectancy: personalized life expectancy assessment based on user profile, positive impact of predicted future improvements in medical care, and negative impact of possible future pandemics

Adding socioeconomic attributes and health history

We can add additional socioeconomic attributes to the request:

  • Education level (education):
    • 1: Up to Secondary Education,
    • 2: High School,
    • 3: Some College,
    • 4: College Graduate,
    • 5: Graduate School
  • Income level (income):
    • 1: Very Low Income,
    • 2: Low Income,
    • 3: Medium Income,
    • 4: High Income,
    • 5: Very High Income
  • Location (location_type):
    • 1: Large Urban,
    • 2: Medium-size Urban,
    • 3: Small Town,
    • 4: Suburban,
    • 5: Rural

Optionally, we can add attributes related to health history (health_history):

  • Personal health history (health_history.personal_history):
    • diabetes_type_1
    • diabetes_type_2
    • hypertension
    • heart_disease
    • … (Full list of health conditions can be found in the Longevity API documentation.)
  • Family health history (health_history.family_history):
    • diabetes
    • cardiovascular
    • cancer

Here is an example of a request which includes socioeconomic attributes and health history:

{ "profile": { "gender": "male", "height": 180, "weight": 80, "age": 40, "socioeconomic": { "education": 4, "income": 3, "location_type": 3 }, "health_history": { "personal_history": { "diabetes_type_1": false, "diabetes_type_2": true, "hypertension": false, "heart_disease": false }, "family_history": { "diabetes": true, "cardiovascular": false, "cancer": false } } } }

Longevity assessment for the request above will be similar to the one shown above, but it will include additional socioeconomic and health history inputs in computing more precise personalized life expectancy.

{ "bmi": 24.691358024691358, "standard_life_expectancy": { "age": 40, "lifespan": 78.8, "remaining_lifespan": 38.8, "healthspan": 65.22, "remaining_healthspan": 25.22 }, "personalized_life_expectancy": { "lifespan": 83.374, "remaining_lifespan": 43.373999999999995, "healthspan": 69.006, "remaining_healthspan": 29.006, "lifespan_population_percentile": 0.6687278092866694, "healthspan_population_percentile": 0.7088395504378405 }, "dna_impact": { ... }, "lifestyle_impact": { ... }, "improvements": { "socioeconomic": { "lifespan": 3.701, "healthspan": 3.063 }, "external_factors": { "details": { "future_improvements": 6.208, "pandemics": -2.91 }, "lifespan": 3.298, "healthspan": 2.73 }, "bmi": { "lifespan": 0.0, "healthspan": 0.0 }, "health_conditions": { "lifespan": -2.425, "healthspan": -2.007 }, "lifestyle": { "lifespan": 0, "healthspan": 0.0 }, "dna": { "lifespan": 0.0, "healthspan": 0.0 }, "biological_age": { "lifespan": 0.0, "healthspan": 0.0 } }, "improvement_potentials": { "nutrition_and_diet": { "lifespan": 7.8238157894736835, "healthspan": 6.4754982968207315 }, "fitness": { "lifespan": 8.232236842105262, "healthspan": 6.813534096981031 }, "sleep": { "lifespan": 4.977631578947368, "healthspan": 4.119811314453647 }, "mental_wellbeing": { "lifespan": 5.743421052631579, "healthspan": 4.753628439754208 }, "total": { "lifespan": 18.226, "healthspan": 15.085021827411166 } } }

Notes:

  • dna_impact and lifestyle_impact will stay the same as in the previous example, since we did not include relevant attributes into the request (they are not affected by socioeconomic attributes and health history)

Adding Lifestyle Attributes Assessments

Longevity assessment request can also include lifestyle input arguments. Lifestyle arguments reflects how particular lifestyle habit impacts overall health and longevity.

Unlike profile attributes, lifestyle habits can’t be directly measured, but they can be assessed using a scoring system. Lifestyle Assessment Scores are normalized to a range of 1-5, where 1 is minimal and 5 is maximal impact on health and longevity.

Lifestyle assessments arguments are:

  • smoking
  • alcohol consumption
  • diet
    • diet quality
    • diet habits
  • physical activity
    • duration
    • intensity
    • heart health points
  • sleeping habits
    • sleep duration
    • sleep quality
  • mental wellbeing

Here is an example that includes lifestyle_assessments input argument:

{ "profile": { "gender": "male", "height": 180, "weight": 80, "age": 40, "socioeconomic": { "education": 4, "income": 3, "location_type": 3 }, "health_history": { "personal_history": { "diabetes_type_1": false, "diabetes_type_2": true, "hypertension": false, "heart_disease": false }, "family_history": { "diabetes": true, "cardiovascular": false, "cancer": false } } }, "lifestyle_assessments": { "smoking": 1, "alcohol": 1, "diet": { "quality": 2, "habits": 2 }, "physical_activity": { "duration": 3, "intensity": 3, "heart_health": 3 }, "sleep": { "duration": 3, "quality": 3 }, "mental_wellbeing": 3 } }

Adding DNA Trait Assessments

If you want to include DNA Trait Assessments in the request, you can do so by adding dna_trait_assessments input argument. The dna_trait_assessments input argument is a map of trait codes to trait assessment levels.

Trait assessments for existing samples can be fetched using the following command:

curl --request GET \ --url "https://myportal.lifenome.com/api/core-api/samples/${SAMPLE_ID}/traits/" \ --header "Content-Type: application/json" \ --header "Authorization: Bearer ${ACCESS_TOKEN}"

More details about fetching trait assessments can be found on the DNA Trait Assessments Quickstart page.

The response will contain a list of trait assessment objects that needs to be converted to a map of trait codes to trait assessment levels.

Here is an example of valid trait_assessments input:

{ "dna_traits": { "low-resting-metabolic-rate": 0, "high-resting-metabolic-rate": 1, "vitaminB12-deficiency": 1, "vitaminD-deficiency": 1, "calcium-deficiency": 1, "iron-deficiency": 1, "joint-injury-risk": 2, "muscle-damage-risk": 1 } }

End here is an example of complete Longevity Assessment Request that includes DNA trait assessments:

{ "profile": { "gender": "male", "height": 180, "weight": 80, "age": 40, "socioeconomic": { "education": 4, "income": 3, "location_type": 3 }, "health_history": { "personal_history": { "diabetes_type_1": false, "diabetes_type_2": true, "hypertension": false, "heart_disease": false }, "family_history": { "diabetes": true, "cardiovascular": false, "cancer": false } } }, "lifestyle_assessments": { "smoking": 1, "alcohol": 1, "diet": { "quality": 2, "habits": 2 }, "physical_activity": { "duration": 3, "intensity": 3, "heart_health": 3 }, "sleep": { "duration": 3, "quality": 3 }, "mental_wellbeing": 3 }, "dna_traits": { "low-resting-metabolic-rate": 0, "high-resting-metabolic-rate": 1, "vitaminB12-deficiency": 1, "vitaminD-deficiency": 1, "calcium-deficiency": 1, "iron-deficiency": 1, "joint-injury-risk": 2, "muscle-damage-risk": 1 } }

Longevity assessment for the request above will be similar to the one shown above, but it will include additional DNA trait assessments in computing more precise personalized life expectancy.

{ "bmi": 24.691358024691358, "dna_impact": { "diet-and-metabolism": { "impact": 0.0, "traits": {} }, "micronutrient": { "impact": -0.4786184210526315, "traits": { "vitaminB12-deficiency": -0.25, "vitaminD-deficiency": -0.25, "calcium-deficiency": -0.15, "iron-deficiency": -0.1 } }, "exercise": { "impact": 0.0, "traits": {} }, "injury": { "impact": -0.2233552631578947, "traits": { "joint-injury-risk": -0.3, "muscle-damage-risk": -0.05 } }, "heart-health": { "impact": 0.0, "traits": {} }, "metabolic-health": { "impact": 0.0, "traits": {} }, "mental-health": { "impact": 0.0, "traits": {} }, "cancer": { "impact": 0.0, "traits": {} }, "sleep": { "impact": 0.0, "traits": {} }, "lifespan_impact": -0.7019736842105262 }, "lifestyle_impact": { "diet": { "quality": -3.7, "habits": -2.1, "total": -5.800000000000001 }, "smoking": null, "alcohol": null, "physical_activity": { "intensity": -0.06381578947368398, "duration": 0.47223684210526296, "heart_health": 1.276315789473684, "total": 1.684736842105263 }, "mental_wellbeing": 1.276315789473684, "sleep": { "duration": 0.255263157894737, "quality": 0.0, "total": 0.255263157894737 }, "lifespan_impact": -2.5836842105263167 }, "standard_life_expectancy": { "age": 40, "lifespan": 78.8, "remaining_lifespan": 38.8, "healthspan": 65.22, "remaining_healthspan": 25.22 }, "improvements": { "socioeconomic": { "lifespan": 3.701, "healthspan": 3.063 }, "external_factors": { "details": { "future_improvements": 6.208, "pandemics": -2.91 }, "lifespan": 3.298, "healthspan": 2.73 }, "bmi": { "lifespan": 0.0, "healthspan": 0.0 }, "health_conditions": { "lifespan": -2.425, "healthspan": -2.007 }, "lifestyle": { "lifespan": -2.584, "healthspan": -2.138 }, "dna": { "lifespan": -0.702, "healthspan": -0.581 }, "biological_age": { "lifespan": 0.0, "healthspan": 0.0 } }, "personalized_life_expectancy": { "lifespan": 80.088, "remaining_lifespan": 40.087999999999994, "healthspan": 66.287, "remaining_healthspan": 26.287000000000006, "lifespan_population_percentile": 0.5514069048094191, "healthspan_population_percentile": 0.5649446494464949 }, "improvement_potentials": { "nutrition_and_diet": { "lifespan": 14.102434210526315, "healthspan": 11.67209085292546 }, "fitness": { "lifespan": 5.815592105263157, "healthspan": 4.81336189219877 }, "sleep": { "lifespan": 4.72236842105263, "healthspan": 3.9085389393534586 }, "mental_wellbeing": { "lifespan": 4.467105263157895, "healthspan": 3.697266564253273 }, "total": { "lifespan": 20.043999999999997, "healthspan": 16.589716751269034 } } }

Adding BioAge Assessments

Finally, we can add BioAge assessments to the request. BioAge assessments are biological age assessments based on blood biomarkers and/or epigenetic data.

{ "profile": { "gender": "male", "height": 180, "weight": 80, "age": 40, "socioeconomic": { "education": 4, "income": 3, "location_type": 3 }, "health_history": { "personal_history": { "diabetes_type_1": false, "diabetes_type_2": true, "hypertension": false, "heart_disease": false }, "family_history": { "diabetes": true, "cardiovascular": false, "cancer": false } } }, "lifestyle_assessments": { "smoking": 1, "alcohol": 1, "diet": { "quality": 2, "habits": 2 }, "physical_activity": { "duration": 3, "intensity": 3, "heart_health": 3 }, "sleep": { "duration": 3, "quality": 3 }, "mental_wellbeing": 3 }, "dna_traits": { "low-resting-metabolic-rate": 0, "high-resting-metabolic-rate": 1, "vitaminB12-deficiency": 1, "vitaminD-deficiency": 1, "calcium-deficiency": 1, "iron-deficiency": 1, "joint-injury-risk": 2, "muscle-damage-risk": 1 }, "bioage_assessments": { "blood_biomarkers": 38, "methylation": 41 } }

The example above includes BioAge assessments for blood biomarkers and methylation (lines: 54-57).

The response will include additional information about the impact of biological age on life expectancy (lines: 108-111):

{ "bmi": 24.691358024691358, "dna_impact": { "diet-and-metabolism": { "impact": 0.0, "traits": {} }, "micronutrient": { "impact": -0.4786184210526315, "traits": { "vitaminB12-deficiency": -0.25, "vitaminD-deficiency": -0.25, "calcium-deficiency": -0.15, "iron-deficiency": -0.1 } }, "exercise": { "impact": 0.0, "traits": {} }, "injury": { "impact": -0.2233552631578947, "traits": { "joint-injury-risk": -0.3, "muscle-damage-risk": -0.05 } }, "heart-health": { "impact": 0.0, "traits": {} }, "metabolic-health": { "impact": 0.0, "traits": {} }, "mental-health": { "impact": 0.0, "traits": {} }, "cancer": { "impact": 0.0, "traits": {} }, "sleep": { "impact": 0.0, "traits": {} }, "lifespan_impact": -0.7019736842105262 }, "lifestyle_impact": { "diet": { "quality": -3.7, "habits": -2.1, "total": -5.800000000000001 }, "smoking": null, "alcohol": null, "physical_activity": { "intensity": -0.06381578947368398, "duration": 0.47223684210526296, "heart_health": 1.276315789473684, "total": 1.684736842105263 }, "mental_wellbeing": 1.276315789473684, "sleep": { "duration": 0.255263157894737, "quality": 0.0, "total": 0.255263157894737 }, "lifespan_impact": -2.5836842105263167 }, "standard_life_expectancy": { "age": 40, "lifespan": 78.8, "remaining_lifespan": 38.8, "healthspan": 65.22, "remaining_healthspan": 25.22 }, "improvements": { "socioeconomic": { "lifespan": 3.701, "healthspan": 3.063 }, "external_factors": { "details": { "future_improvements": 6.208, "pandemics": -2.91 }, "lifespan": 3.298, "healthspan": 2.73 }, "bmi": { "lifespan": 0.0, "healthspan": 0.0 }, "health_conditions": { "lifespan": -2.425, "healthspan": -2.007 }, "lifestyle": { "lifespan": -2.584, "healthspan": -2.138 }, "dna": { "lifespan": -0.702, "healthspan": -0.581 }, "biological_age": { "lifespan": 0.985, "healthspan": 0.815 } }, "personalized_life_expectancy": { "lifespan": 81.073, "remaining_lifespan": 41.07299999999999, "healthspan": 67.102, "remaining_healthspan": 27.102000000000004, "lifespan_population_percentile": 0.5885447861125312, "healthspan_population_percentile": 0.6111061914249873 }, "improvement_potentials": { "nutrition_and_diet": { "lifespan": 14.102434210526315, "healthspan": 11.67209085292546 }, "fitness": { "lifespan": 5.815592105263157, "healthspan": 4.81336189219877 }, "sleep": { "lifespan": 4.72236842105263, "healthspan": 3.9085389393534586 }, "mental_wellbeing": { "lifespan": 4.467105263157895, "healthspan": 3.697266564253273 }, "total": { "lifespan": 20.527, "healthspan": 16.989478934010155 } } }