Does Apple Health have an API?

Updated

Only on the device: HealthKit is Apple's API for Health data, and it works inside apps on iPhone, iPad, Apple Watch and Vision Pro, with the person's permission for each type of data. There is no web or cloud API for Health data, and on a Mac, HealthKit cannot read it (Apple developer documentation, as of November 2026).

So any program off the phone, such as a script, a server or an AI agent on your computer, gets Health data only through an iPhone app that sends it out. HealthSQL is an iPhone app and a command-line tool that copy your whole Apple Health record into a local SQLite database on your computer, so AI agents can query it with SQL or MCP. That makes a local API out of your own record: SQL from a shell, or two MCP tools.

What HealthKit is

Which route fits what you need

You wantRoute
Your own data, for your AI agents or SQL on your MacAn iPhone app that exports it to you, such as HealthSQL: local SQLite, SQL and MCP
A one-time look at your whole historyHealth's Export All Health Data, an XML file (Apple)
Health data from many users, in your own productYour own iOS app with HealthKit, or a health-data company's SDK inside it. Terra, for one, starts at $399 a month on a yearly plan (pricing, November 2026)

HealthSQL as your local Health API

After setup, these are the calls:

healthsql                              # what the database holds: views, columns, metrics, date ranges
healthsql query "SELECT ..."           # rows as JSON, read-only, at most 2000
healthsql status                       # is the feed alive, and what clears it if not
healthsql mcp                          # the same, as an MCP server over stdio

A query answers in JSON:

{"rows": [{"day": "2026-11-29", "steps": 8412.0, "resting_hr": 58.0}], "truncated": false, "phone_synced": "2026-11-30T07:41:09-08:00"}

The numbers above are made up. phone_synced is when the iPhone last exported; when something is wrong, the answer adds a problem line with the act that clears it. The views and columns are in the schema reference; the MCP tools in the MCP guide.

Questions

Is there an Apple Health REST API?

Not from Apple. Some third-party apps upload your Health data to their servers and offer a REST API there. HealthSQL has no server and no REST API; its API is the command and the MCP server on your own Mac.

Can I read Apple Health from a Mac app?

No. On macOS, HealthKit is present but cannot read or write Health data (Apple)). A Mac app has to get the data from an iPhone app.

Can I write to Apple Health through HealthSQL?

No. HealthSQL only reads. Nothing is written back to Apple Health.

Do ChatGPT and Claude have an Apple Health API?

No. Both connect to Apple Health inside their own apps, for US users, and their help pages mention no API or MCP server for other programs, as of November 2026 (details).