Read-only localhost API

Apple Health Local API for OpenClaw, Claude Code, and Mac Workflows

Health Data AI Analyzer on Mac exposes a read-only localhost API so you can build Apple Health daily briefs, trend summaries, and automation workflows without uploading your health data to the cloud.

Automate daily health briefs on your Mac — no cloud required.

Base URL

http://127.0.0.1:8765

Best for

  • OpenClaw daily health briefs
  • Claude Code and developer workflows
  • Local scripts and automation
  • Private Apple Health summaries on Mac

How the Local API Works

The Mac app reads your imported Apple Health dataset and serves compact summaries over 127.0.0.1. The API is designed for read-only integrations, which means tools can query your health summaries but do not write, delete, or modify your data.

The API uses the app’s selected integration dataset. Once you import data or choose Use for Integrations on a saved analysis, the dataset stays available across app relaunches.

Authentication

Two routes are public on loopback and do not require a token:

All other routes require the X-Health-Analyzer-Token header. The token file path is exposed in the app and by GET /status.

Stable Public Endpoints

GET /openclaw/status

Readiness endpoint for OpenClaw and local AI integrations. Returns app version, whether a dataset is loaded, last import and sync timestamps, and available metrics.

curl http://127.0.0.1:8765/openclaw/status

GET /openclaw/daily-brief?date=YYYY-MM-DD

Compact Apple Health daily summary for AI assistants and scripts. Returns steps, sleep, workouts, heart rate, HRV, signals, sync metadata, and a human-readable context summary.

curl "http://127.0.0.1:8765/openclaw/daily-brief?date=2026-03-19"

GET /status

General local API status endpoint for host tools and debugging. Returns app and server version, dataset state, import/sync timestamps, and the token path for protected endpoints.

curl http://127.0.0.1:8765/status

GET /summary

Compact human-readable summary of the selected integration dataset.

GET /steps/daily?start=YYYY-MM-DD&end=YYYY-MM-DD

Normalized daily step counts for a date range.

GET /sleep/summary?start=YYYY-MM-DD&end=YYYY-MM-DD

Normalized daily sleep summaries for a date range.

GET /workouts/summary?start=YYYY-MM-DD&end=YYYY-MM-DD

Workout totals, minutes, and per-session summaries.

GET /heart-rate/trends?start=YYYY-MM-DD&end=YYYY-MM-DD

Average heart rate, resting heart rate, and HRV day series for a date range.

Daily Brief Example

{
  "ok": true,
  "success": true,
  "summary": "Daily Apple Health brief from Health Data AI Analyzer.",
  "data": {
    "date": "2026-03-19",
    "steps": {
      "value": 2444,
      "baseline_7d": 10004.57,
      "delta_vs_baseline": -7560.57
    },
    "sleep": {
      "hours": null,
      "baseline_7d": 6.47
    },
    "workouts": {
      "count": 0,
      "total_minutes": 0
    },
    "signals": ["activity_below_baseline"],
    "context_summary": "Daily brief for 2026-03-19, steps 2444"
  }
}

Compatibility Endpoints

Older routes remain available for scripts and internal compatibility. Where possible, they read from the persisted integration snapshot first and fall back to live in-memory analysis data.

Why This Matters

This local API makes the app useful beyond charts and exports. It gives you a clean bridge for OpenClaw health check-ins, Claude Code workflows, private daily brief generation, and local developer tooling built on top of Apple Health data.

Want the OpenClaw setup guide?

See the OpenClaw Apple Health integration page for prompts, setup steps, and a walkthrough of daily health briefs on Mac.