← All posts
tutorialwellness

How to build a wellness app: mood tracking, stress scoring, and sleep quality

Mahesh Naidu·5 min read

/wellness has 21 endpoints, and three of them — mood, stress, and sleep — cover the core daily-check-in loop most wellness apps are built around.

Mood tracking — more than a single number

/mood-tracker takes a mood_score (1-10), an array of emotions, an array of activities_today, plus sleep_hours and exercise_mins:

fetch("https://aplicious.com/api/v1/wellness/mood-tracker", {
  method: "POST",
  headers: { "X-API-Key": "lapi_live_••••", "Content-Type": "application/json" },
  body: JSON.stringify({
    mood_score: 6,
    emotions: ["anxious", "hopeful"],
    activities_today: ["work", "exercise", "socializing"],
    sleep_hours: 6.5,
    exercise_mins: 30,
  }),
});

The response doesn't just echo the score back — it analyses which activities correlate with the mood entered, surfaces a sleep-mood correlation and an exercise effect estimate, and generates CBT-style cognitive reframes when negative emotions are present. That last part is what makes this a mental-health tool rather than a mood diary — it's actively suggesting a different way to think about the day, not just logging it.

Stress score — six factors, not a guess

/stress takes sleep_hours, exercise_days_week, work_hours_day, social_score, nutrition_score, and optionally hrv (heart rate variability, if the user has a wearable), and returns a composite stress/recovery/resilience score with a per-factor breakdown showing which inputs are dragging the score down.

fetch("https://aplicious.com/api/v1/wellness/stress?sleep_hours=6&exercise_days_week=2&work_hours_day=9&social_score=5&nutrition_score=6", {
  headers: { "X-API-Key": "lapi_live_••••" },
});

Sleep quality

/sleep-quality takes bedtime, wake time, number of interruptions, age, and optional free-text sleep notes, and returns a quality assessment — age matters here because recommended sleep duration genuinely differs by age bracket, not just by individual preference.

Putting together a daily check-in

async function dailyCheckIn(entry: { mood_score: number; emotions: string[]; activities_today: string[]; sleep_hours: number; exercise_mins: number }) {
  const res = await fetch("https://aplicious.com/api/v1/wellness/mood-tracker", {
    method: "POST",
    headers: { "X-API-Key": process.env.APLICIOUS_KEY!, "Content-Type": "application/json" },
    body: JSON.stringify(entry),
  });
  return (await res.json()).data;
}
Try APlicious free
One key. 34 live namespaces. 500 free calls per month — no credit card required.
Get your free API key →
← Back to all posts