Apple won't give you an API for your Health data. A free Shortcut will (here's the whole pipeline)
Описание и применение
Пользователь создал автоматический поток, который ежедневно извлекает данные Apple Health через Shortcut и отправляет их на бесплатный Cloudflare Worker, где они сохраняются в SQLite и доступны через GET /days.
Задача
Apple Health data cannot be exported via a public API; existing export apps are paid or subscription-based.
Результат
The pipeline delivers raw health metrics (steps, heart rate, sleep stages) to a private Cloudflare Worker, stores them in a SQLite database, and exposes daily totals via a GET /days endpoint, all for free.
Рабочий процесс
- Create a Cloudflare project and D1 database
- Configure wrangler.toml with database binding
- Define SQL schema with a UNIQUE constraint to avoid duplicates
- Implement Worker handler to authenticate requests and insert samples
- Set up a Shortcuts automation to read HealthKit data and POST to the Worker
- Schedule the Shortcut to run twice a day
Доказательства
There's no web API. HealthKit only works inside an iOS app.
I built it with what's already on the phone: one free Shortcut + one free Cloudflare Worker.
That UNIQUE line is the most important line in the project.
- Дата записи: 2026-10-11T09:56:14.641Z