Skip to content

Shortcuts & App Intents

Export Yesterday's Health Data

Zero-parameter shortcut. The fast path for "just export yesterday's data and shut up about it." Same engine as the manual export. Optional Profile parameter (see Export profiles).

Export Health Data for a Date

Single Date parameter. Time-of-day is ignored. Useful in calendar-driven automations. Optional Profile parameter.

Export Health Data for Date Range

Start Date and End Date parameters, inclusive on both ends. Use for backfills. Optional Profile parameter.

Export Last N Days of Health Data

Number of Days parameter, from 1 to 366. Ends yesterday. Default 7. Use it for automations such as "every Sunday, export the last 7 days." Optional Profile parameter.

Get Health Summary for a Date

Returns a structured snapshot, steps, active calories, sleep, heart rate, without writing anything to the vault. Use this in Shortcuts to feed values into other apps.

Get Last Export Status

Returns the timestamp, success state, day count, and any failure reason from the most recent recorded export. A locked-device request remains pending until retried, so it is not returned as the current status while pending.

Turn Scheduled Export On or Off

Boolean parameter. Use to suspend the schedule (e.g. on vacation Focus) and resume it later.

Create and manage saved export profiles in Health.md on iPhone or Android. Apple profile management is currently documented for iPhone only. IPad and macOS management availability is not claimed.

All four export intents accept an optional Profile parameter. If profiles exist, an empty parameter uses the active profile. In legacy zero-profile mode, it uses the current in-app export settings. Pass a saved profile name to use its frozen configuration. This includes its metric selection, formats, and destination, regardless of the settings that the app shows.

Heads-up for existing zero-parameter shortcuts.

After you create your first export profile, a shortcut with no Profile uses the active profile's saved settings. It does not use the app's live settings. If you rely on the old behavior, pin the shortcut to a specific profile or keep zero profiles. A profile name that no longer exists returns a clear error. It does not export the wrong profile.

Open the Shortcuts app on iOS or macOS. Tap the + button to create a new shortcut, search for "Health.md" or any of the intent titles above. They live under the Health category.

Most intents have openAppWhenRun = false, so they execute headlessly, no app launch, no UI flash. They work from automations, Focus filters, the Hey Siri handoff, and the Action Button.

Running while locked does not unlock HealthKit.

Apple protects HealthKit data while the iPhone is locked and relinquishes app access about ten minutes after locking. Allow Running When Locked lets Shortcuts start the action, but it does not override HealthKit data protection. The Health.md app-content permission in Shortcuts does not override it either.

If HealthKit is unavailable, Health.md preserves the requested dates as pending and posts a Health Export Needs Attention notification. Unlock the iPhone, then tap the notification or open Health.md to retry. A fully unattended export cannot be guaranteed while the phone remains locked.

  1. Personal AutomationTime of Day → choose a time when you normally use your unlocked iPhone, such as 8:00 AM.
  2. Export Yesterday's Health Data intent.
  3. Get Last Export Status intent.
  4. Show Notification with the result.

Pending-status note: Get Last Export Status reads the most recent recorded export-history entry. If this run encountered locked HealthKit data, it may still show the previous export until you retry the pending request. Health.md's own recovery notification is the authoritative signal for pending work.

  1. Create a shortcut.
  2. Export Health Data for Date Range with start = 2024-01-01, end = 2024-12-31.
  3. Run from Shortcuts. Walks the year, writes one file per day. May take a few minutes for full years.
  1. Focus filter: when Vacation Focus turns on, run Turn Scheduled Export On or Off with Enabled = false.
  2. When Focus turns off, run again with Enabled = true.
Authorization required.

Intents inherit your in-app HealthKit permission and vault selection. They will fail with a clear error if the app has not been opened-and-set-up at least once on this device.