Apple Health + AI: Chat With Your Health Data (Local API)
Turn years of Apple Health exports into targeted queries (sleep, steps, workouts, heart rate) that Claude, OpenAI, or Gemini can analyze-without uploading a 1GB file.
Export → AirDrop → Analyze with Claude, ChatGPT, or any AI.
Prerequisite: to use this API, you need the Mac app installed (Mac Health Analyzer / Health Data Export AI Analyzer). The API runs locally while the app is running.
The core idea: LLMs are great at reasoning, but they’re not built to ingest your entire Apple Health export. A local API lets you fetch only the metric slice you need (date range + aggregation), then send that small result to your model.
- Base URL:
http://127.0.0.1:8765 - Auth header (most routes):
X-Health-Analyzer-Token: <token> - Token file path: returned by
GET /status
Start here: Apple Health Local API
Pick your integration
Best for tool-use workflows and iterative analysis.
Best for function calling + structured outputs.
Best for recurring weekly/monthly reports.
Automate daily briefs and health workflows (read-only endpoints).
Why a local API beats uploading an export
Apple Health exports are time-series heavy: heart rate samples, sleep stages, workouts, steps, glucose, and more. That means tons of rows and a file that quickly becomes too big for an LLM context window.
Instead of "upload everything", do:
- Ask a question (e.g., "How did my resting HR trend over the last 90 days?")
- Call a single API endpoint for the metric + date range
- Send the compact JSON to the model for analysis
Useful endpoints (examples)
GET /metrics- available metric typesGET /summary?start=YYYY-MM-DD&end=YYYY-MM-DD- compact overall summaryGET /steps/daily?start=YYYY-MM-DD&end=YYYY-MM-DDGET /sleep/summary?start=YYYY-MM-DD&end=YYYY-MM-DDGET /workouts/summary?start=YYYY-MM-DD&end=YYYY-MM-DDGET /heart-rate/trends?start=YYYY-MM-DD&end=YYYY-MM-DDGET /blood-glucose/summary?start=YYYY-MM-DD&end=YYYY-MM-DD
Security model
Most routes require:
X-Health-Analyzer-Token: <token>
You can discover the token file path via GET /status.
OpenClaw-specific routes are read-only and do not require the token:
GET /openclaw/statusGET /openclaw/daily-brief?date=YYYY-MM-DD
Compatibility routes
Compatibility endpoints also exist under /health/*, for example:
/health/status/health/sleep/health/workouts/health/blood-glucose
Want to talk to your health data?
Start with the Local API docs, then pick your AI integration.