Glucose prediction
glucose.predict predicts the glucose curve for a meal from the foods eaten, the time, and a user profile. It needs the glucose:read scope. Each food is a FoodSelection from Food details and portions, and the client's timezone (User identity and timezone) is sent with the prediction.
Glucose predictions and profile inputs are health data. Keep request and response values out of analytics, crash reports, and general-purpose logs.
const { prediction, impact, chart } = await january.glucose.predict({
foods: [selection],
startTime: new Date().toISOString(),
userProfile: {
age: 38,
sex: 'female',
height: { unit: 'in', value: feet * 12 + inches },
weight: { unit: 'kg', value: 67 },
activityLevel: 'moderately_active',
healthConditions: [],
},
});ageis in whole years.Height (
inorcm) and weight (lborkg) units are independent. Show imperial height as feet plus inches, and sendfeet * 12 + inches.
prediction
The curve at 15-minute intervals: minutes after startTime and value in mg/dL
impact
low, medium, or high; may be absent
chart.min, chart.max
Suggested y-axis bounds in mg/dL, not the curve's lowest and highest values; may be absent
Last updated
Was this helpful?