Connects / Exports / Data and dashboards
Apple Health to InfluxDB: write it straight from your iPhone
To get Apple Health data into InfluxDB, an iPhone app has to write it there, because Apple Health has no API a server can call. Marrow does this for free: give it your InfluxDB address, bucket and an API token, and it writes every metric, workout, lifting set and meal in line protocol on a schedule, with no Telegraf or bridge in between.
Open in Marrow works on an iPhone with Marrow 1.7.1 or later.
Automated Free
Marrow writes to it directly on a schedule, with the app closed. Nothing to run in between. You need: An InfluxDB API token with write on one bucket.
- In Marrow, open Connects, then Exports, and tap InfluxDB. Turn Automated on.
- In InfluxDB: Load Data, API Tokens, Generate, write to one bucket.
- In Marrow: tap Connect. Its page asks for:
- Address: Where InfluxDB answers, with its port. It looks like
https://influx.example.com:8086. - Organization: Your org's name. InfluxDB 1.8 and 3 do not need one.
- Bucket: The bucket the token can write to, for example
health. - API token: The token you just made.
- Address: Where InfluxDB answers, with its port. It looks like
What arrives in InfluxDB
Marrow writes seven measurements to your bucket in InfluxDB's line protocol. Every field is a float, so a field never changes type. Timestamps are in seconds, and a day's total is stamped at noon UTC of that day. These lines use sample values:
daily,metric=step_count,units=count qty=8746.0 1793880000 daily,metric=heart_rate,units=bpm Avg=71.0,Min=52.0,Max=148.0 1793880000 daily,metric=sleep_analysis,units=h totalSleep=7.4,deep=1.1,rem=1.6,core=4.7 1793880000 sample,metric=heart_rate,units=bpm,source=Apple\ Watch value=71.0,dur_s=0.0 1793883900 workout,activity=Running,source=Apple\ Watch duration_min=31.0,kcal=312.0,distance_mi=3.1,avg_hr=151.0 1793917800 set,exercise=Bench\ Press,session=Push\ day,set_type=work,unit=lb,n=2,muscle=Chest weight=185.0,reps=8.0,e1rm=231.0,volume=1480.0 1793900400 meal,day=2026-11-05,idx=3,meal=lunch kcal=640.0,protein_g=42.0,carbs_g=55.0,fat_g=28.0,grams=320.0,food="Chicken burrito" 1793883900
| Measurement | Tags | Fields |
|---|---|---|
daily | metric, units | qty for totals, Avg, Min and Max for heart rate, totalSleep and the stages for sleep |
sample | metric, units, source, stage for sleep | value, dur_s |
workout | activity, source | duration_min, kcal, distance_mi, avg_hr |
set | exercise, session, set_type, unit, n, muscle | weight, reps, e1rm, volume, rir |
meal | day, idx, meal | kcal, protein_g, carbs_g, fat_g, grams, food, and each nutrient as n_ and its name |
symptom | name, severity, source | severity_code, dur_s |
mood | kind, source | valence, feeling |
The first run sends the last 90 days unless you pick 30 days, 365 days or All under Advanced, History. Later runs send what is new and send the last two days again, because Apple Health keeps filling in a day after it ends. A point with the same measurement, tags and time overwrites the old one, so nothing doubles. Raw samples is on for InfluxDB. Turn it off under Advanced if you only want the daily totals.
Query it
Steps per day for the last month, in InfluxQL and in Flux:
SELECT "qty" FROM "daily" WHERE "metric" = 'step_count' AND time > now() - 30d
from(bucket: "health") |> range(start: -30d) |> filter(fn: (r) => r._measurement == "daily" and r.metric == "step_count" and r._field == "qty")
Built with InfluxDB
Body OpsEvery signal from your phone, watch and logs on one Grafana dashboard, updated every hour.
A Year in RingsOne picture of a year: heart rate, sleep, steps, calories, sound and daylight as six clock rings, from Body Ops data.
AnnulusA personal web dashboard for a self-hosted Marrow mirror: rings, sleep, heart rate and HRV, weight, workouts and food in four tabs.Made something? Add it to Built with Marrow.
If it does not work
In InfluxDB
- Test connection fails. InfluxDB answers 401 when the token is wrong or cannot write to the bucket, and 404 when the org or bucket name is wrong. Check all three on the Connect screen.
- The address is refused. Marrow takes https anywhere and plain http only on your own network. Include the port, 8086 unless you changed it.
- A meal deleted in Marrow is still in InfluxDB. On InfluxDB 2 and Cloud, Marrow rewrites each day's meals whole, so a deleted one disappears. InfluxDB 3 Core has no delete for this, so a removed entry stays there.
- Still running the bridge or Telegraf from before Marrow 1.7? An older automation that posts to the bridge keeps working. The direct connection replaces it, and the bridge can go once the direct one delivers.
Automated checks
- Test with Run now. The line under Run now says what happened. Any 2xx answer counts as delivered. Anything else shows as Server answered and the status code, or the network error.
- Check the Activity log. In the automation, More options, Activity log lists its last 30 runs with the result of each.
- Runs come late. iOS picks the moment for background runs, and a phone that stays locked sends when it is next unlocked. Since last run catches up on the next run that succeeds.
- A receiver on your home network. Marrow needs Local Network access to reach it (Settings, Privacy and Security, Local Network). Tap Run now once with Marrow open, so iOS can ask: in the background it refuses without asking.
- It will not switch on. Each automation that is on counts as a connection. Free keeps 3 connections on at a time. Marrow Pro keeps up to 20: AIs, servers and automations together. Sources never count.
More fixes in the guides: Automated.
Questions
Do I need Telegraf, a bridge or a server in between?
No. Since Marrow 1.7 the app writes InfluxDB's own write API itself. You only need InfluxDB to be reachable from the phone over https, or over plain http on your own network.
Which InfluxDB versions work?
InfluxDB 1.8, 2, 3 and InfluxDB Cloud. On 1.8 there is no organization, the bucket is the database and retention policy as db/rp, and the API token is user:password.
How often does it write?
Every hour unless you change it under Advanced. iOS picks the exact moment for background work, so expect several runs a day, not an exact clock. When automations run has the detail.
Is it free?
Yes. The InfluxDB connection is on Marrow's free plan and counts as one of its three connections. No account is needed.
Can I chart it in Grafana?
Yes. Point a Grafana InfluxDB data source at the same bucket. Apple Health to Grafana has the queries.
Other ways to do it, and when to pick them
We make Marrow, so here are the alternatives as fairly as we can put them.
- Health Auto Export. It posts JSON to a REST endpoint or publishes over MQTT, on its Premium tier, and you run Telegraf or a small ingester to turn that into InfluxDB points. Pick it if you already run that pipeline, or want its Mac and iPad apps and cloud-drive destinations. See healthyapps.dev and our comparison.
- A webhook and your own writer. Post JSON to n8n, Node-RED or a small script and write the points yourself. Pick it when you want your own measurement names or want to mix in other data on the way. Start at Apple Health to a webhook.
- Apple's export.zip. Health, your picture, Export All Health Data gives you everything once, as one large XML file. Pick it for a one-time backfill or a backup. It is not a feed, so new data means a new export. Our in-browser converter turns it into CSV.
Related: Apple Health to Grafana · Apple Health to a webhook · Automations: every payload