How does the new Mental Health API work?

Generated on 8/5/2024

1 search

The new Mental Health API, introduced in the session Explore wellbeing APIs in HealthKit, allows developers to integrate mental health features into their apps using HealthKit. Here are the key points about how it works:

  1. Logging State of Mind: Users can log their state of mind from their Apple Watch or the Health app, making it easy to check in at any point in the day. This helps users keep track of their mental wellbeing.

  2. Standardized Questionnaires: The API supports standardized questionnaires like the GAD-7 for anxiety and the PHQ-9 for depression. These questionnaires are widely used by clinicians for mental health screening. Developers can read and write the results of these questionnaires, allowing users to track the efficacy of treatments or save results from their doctor's office.

  3. State of Mind API: This API includes four parameters:

    • Feeling Kind: Represents either a daily mood or a momentary emotion.
    • Valence: A self-reported measure of how good or bad someone is feeling, on a scale from -1 (very poor) to +1 (very good).
    • Labels: Descriptive terms like "passionate," "overwhelmed," and "relieved" to fully represent someone's state of mind.
    • Associations: Describes the cause of a feeling, with options like "family," "identity," and "work."
  4. Integration and Use Cases: The API is designed to be integrated into various types of apps, not just those focused on mental wellbeing. For example, it can be used in journaling apps to provide personalized state of mind suggestions or in apps that visualize how someone spends their time, associating events with how they felt during those times.

For a detailed dive into the API, you can watch the session Explore wellbeing APIs in HealthKit.