Claude + Local API

Apple Health + Claude (via a Local API)

Claude can reason extremely well—but it can’t (and shouldn’t) ingest your full Apple Health export. Query the exact metric slice locally, then send a compact result for analysis.

Export → AirDrop → Analyze with Claude, ChatGPT, or any AI.

Prerequisite: you must install the Mac app (it hosts the local API on your machine). No Mac app → no API.

  • Base URL: http://127.0.0.1:8765
  • Auth header (most routes): X-Health-Analyzer-Token: <token>
  • Token file path: returned by GET /status

Docs: Apple Health Local API · Hub: Apple Health + AI

What Claude is great at (once it has the right slice)

Quickstart

  1. Confirm the app is running: GET http://127.0.0.1:8765/status
  2. Read the token file path from /status, load the token
  3. Call a summary endpoint with X-Health-Analyzer-Token
  4. Paste the JSON into Claude (or wire it up via tools/function calling)

Example Claude prompts (copy/paste)

Prompt 1 — Weekly review

Analyze the JSON below for the last 30 days.

1) 5-bullet executive summary
2) Biggest week-over-week deltas
3) 2 hypotheses for what caused the change
4) The next 3 API queries I should run (endpoint + date range)

Return concise bullet points.

Prompt 2 — Recovery signal check

Based on these heart-rate trends and sleep summaries:

- Do you see signs of overreaching, stress, or illness?
- What signals are most predictive here?
- What would you track next to increase confidence?

Be explicit about confidence and alternative explanations.

Example API calls (minimal data in)

Discover metrics:

curl -s \
  -H "X-Health-Analyzer-Token: $TOKEN" \
  "http://127.0.0.1:8765/metrics"

Sleep summary (date range):

curl -s \
  -H "X-Health-Analyzer-Token: $TOKEN" \
  "http://127.0.0.1:8765/sleep/summary?start=2026-02-25&end=2026-03-27"

Heart-rate trends (date range):

curl -s \
  -H "X-Health-Analyzer-Token: $TOKEN" \
  "http://127.0.0.1:8765/heart-rate/trends?start=2026-02-25&end=2026-03-27"

Privacy & security notes

Compatibility routes

Compatibility endpoints also exist under /health/*, for example /health/sleep and /health/workouts.

Ready to query your data?

Start with the Local API docs, then build your Claude workflow.