# Alternative way to pull data from Apple Health?

**URL:** <https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011>\
**Category:** Tech\
**Created:** [February 13, 2021, 1:37am UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011 "2021-02-13T01:37:15Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![gustavohsouza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/gustavohsouza/32/3833_2.png) [@gustavohsouza](https://forum.beeminder.com/u/gustavohsouza)\
**Post date:** [February 13, 2021, 1:37am UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/1 "2021-02-13T01:37:15Z")

</div>

I have a Meditation-Minutes goal that is unfortunately not working so well due to technical issues

- I meditate using Headspace and the Breathe app on the Apple Watch
- The data from both of these apps get pulled to Apple Health and labeled as “mindful minutes”
- The Beeminder iPhone app pulls data from my Apple Health stats and sends it to this “meditation” goal.

The problem is that the Apple Health data is not being correctly transferred to Beeminder.  
I’ve done several tests and I’m confident that the issues happen when I meditate several times a day and Beeminder goes nuts and doesn’t log everything correctly.

I’ve already reported this to @shanaqui and @Andy_Brett but I’m anxious to be able to trust my Beeminder system wholeheartedly again.

Does anyone have any creative idea of how to get my data from Apple Health being transferred to any other app/system and then have this app/system sending the cumulative meditated minutes to Beeminder at the end of the day?

---

<div class="post-metadata">

**Author:** ![krugerk](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/krugerk/32/5161_2.png) [@krugerk](https://forum.beeminder.com/u/krugerk)\
**Post date:** [February 13, 2021, 8:56am UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/3 "2021-02-13T08:56:08Z")

</div>

You can also pull from Apple Heath via Shortcuts and feed Beeminder the data via the API, skipping the official Beeminder iOS app.

---

<div class="post-metadata">

**Author:** ![krugerk](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/krugerk/32/5161_2.png) [@krugerk](https://forum.beeminder.com/u/krugerk)\
**Post date:** [February 13, 2021, 9:14am UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/4 "2021-02-13T09:14:15Z")

</div>

I have a bunch of goals fed this way. Usually I have the shortcuts set up to be triggered manually but in your case maybe you could set up ‘automation’ to run the ‘log my meditation for the day’ shortcut once per day at a set time.

---

<div class="post-metadata">

**Author:** ![gustavohsouza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/gustavohsouza/32/3833_2.png) [@gustavohsouza](https://forum.beeminder.com/u/gustavohsouza)\
**Post date:** [February 13, 2021, 3:25pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/5 "2021-02-13T15:25:32Z")

</div>

**This sounds like EXACTLY what I need!!**

I’ve already invested an hour on this but I didn’t make much progress ☹  
@krugerk , would you be so kind and help me out by sharing with me your Shortcuts _(especially if they pull Health Data)_ **and** also how you set it up on Beeminder?

(_since I’m not a dev and relatively unfamiliar with APIs, I was thinking of sending the Mindful Minutes to IFTTT every night and connect my goal to iftt instead of receiving the data directly from the shortcut. I know… it’s not the most efficient way but sounded like the easiest to me now._ If you send the data directly to Beeminder, I’d love to learn how you did it!)

---

<div class="post-metadata">

**Author:** ![gustavohsouza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/gustavohsouza/32/3833_2.png) [@gustavohsouza](https://forum.beeminder.com/u/gustavohsouza)\
**Post date:** [February 13, 2021, 6:25pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/6 "2021-02-13T18:25:35Z")

</div>

I’ve put in at least 3 hours on it already but I’m having troubles with pulling the Mindful Minutes data using the Shortcuts app.

I’m following [this guy’s](https://blog.maximeheckel.com/posts/build-personal-health-api-shortcuts-serverless) tutorial on how to create a shortcut that pulls Health Data.  
I’m following his steps on my Shortcuts app and It works perfectly with steps, sleep, heart rate… all different sorts of data BUT the godamned mindful minutes.

Heartrate:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/beeminder/original/2X/d/d28d52b7eb470922feae26126b93b6508fc1eaa9.png)

Mindful minutes (always returns empty)

 ![image](https://us1.discourse-cdn.com/flex019/uploads/beeminder/original/2X/d/d3136991b0b36e4cf3e8c3f52329958bacbdeefe.png)

**Can anyone with an iphone test it and see if Shortcut is working with mindful minutes?**  
(I’ve checked my data permissions and I’ve made double sure I have mindful minutes logged for today)

---

<div class="post-metadata">

**Author:** ![krugerk](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/krugerk/32/5161_2.png) [@krugerk](https://forum.beeminder.com/u/krugerk)\
**Post date:** [February 13, 2021, 6:57pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/7 "2021-02-13T18:57:12Z")

</div>

Hello. I tried here too and see that shortcuts seems to be showing blanks instead of the minutes.  
I will look into it a little.

Thanks for learning about shortcuts! Sorry for the rabbit hole. 🙂

---

<div class="post-metadata">

**Author:** ![gustavohsouza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/gustavohsouza/32/3833_2.png) [@gustavohsouza](https://forum.beeminder.com/u/gustavohsouza)\
**Post date:** [February 13, 2021, 7:21pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/8 "2021-02-13T19:21:07Z")

</div>

Thanks for jumping in!

Thx for introducing me to Shortcuts. I had heard about them before but couldn’t think of any application for them yet. Now I know how to use them (except with mindful minutes haha).

---

<div class="post-metadata">

**Author:** ![philip](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/philip/32/1505_2.png) [@philip](https://forum.beeminder.com/u/philip)\
**Post date:** [February 14, 2021, 2:23pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/9 "2021-02-14T14:23:35Z")

</div>

Doubtless you’ve thought of this, but before adding the complexity of looping in Zapier, make sure using the Show Notification step in Shortcuts that you’ve found the data on device. That way, you can quickly cycle through the different available fields and figure out what’s got data.

In the case of **Mindful Minutes** , the data seems to be in the **Duration** field rather than the **Value** field. Testing with a manually-entered datapoint in Health, five minutes is shown as `5:00` in my notification of the duration field.

---

<div class="post-metadata">

**Author:** ![krugerk](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/krugerk/32/5161_2.png) [@krugerk](https://forum.beeminder.com/u/krugerk)\
**Post date:** [February 14, 2021, 8:23pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/11 "2021-02-14T20:23:10Z")

</div>

And now that I look more closely at my own mindfulness goal, I see a day where there were two sessions on a single day and the value of the datapoint created by the official Beeminder app is off, showing, in this case, fewer minutes than available in Health.

---

<div class="post-metadata">

**Author:** ![gustavohsouza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/gustavohsouza/32/3833_2.png) [@gustavohsouza](https://forum.beeminder.com/u/gustavohsouza)\
**Post date:** [February 16, 2021, 8:00pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/12 "2021-02-16T20:00:48Z")

</div>

Doubtless I didn’t think/know about the “Show Notification” trick hahaha  
Thanks for teaching 🙂

And also thanks for cracking the code on getting the Duration instead of Value for Mindful Minutes!

---

<div class="post-metadata">

**Author:** ![gustavohsouza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/gustavohsouza/32/3833_2.png) [@gustavohsouza](https://forum.beeminder.com/u/gustavohsouza)\
**Post date:** [February 16, 2021, 8:04pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/13 "2021-02-16T20:04:49Z")

</div>

Now I’m stuck at another step - haha

The value that Shortcuts sends is exactly 1:00, with the “:”

When IFTTT sends this value to Beeminder, it causes an error to occur. How do you convert minutes to numerals or even delete everything that comes after the “:”?  
Can I do it on Shortcuts level? IFTTT level? How? (I told ya, I’m a newbie)

* * *

Once I get this done with IFTTT, my next step will be getting rid of IFTTT and sending the data directly to Beeminder 🙂

It’s been fun to play with this

---

<div class="post-metadata">

**Author:** ![krugerk](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/krugerk/32/5161_2.png) [@krugerk](https://forum.beeminder.com/u/krugerk)\
**Post date:** [February 16, 2021, 10:06pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/14 "2021-02-16T22:06:34Z")

</div>

I think you would want to cover this from hh:mm into hh + mm/60 and send that over to Beeminder.

Perhaps you could use the ‘split’ on : then perform the math like mentioned.

---

<div class="post-metadata">

**Author:** ![krugerk](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/krugerk/32/5161_2.png) [@krugerk](https://forum.beeminder.com/u/krugerk)\
**Post date:** [February 16, 2021, 10:07pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/15 "2021-02-16T22:07:34Z")

</div>

You would also not need ifttt going this route. The Beeminder api can be used directly.

---

<div class="post-metadata">

**Author:** ![gustavohsouza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/gustavohsouza/32/3833_2.png) [@gustavohsouza](https://forum.beeminder.com/u/gustavohsouza)\
**Post date:** [February 16, 2021, 11:00pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/16 "2021-02-16T23:00:00Z")

</div>

sorry for the very basic question: how does one do it? using the scripts function?

---

<div class="post-metadata">

**Author:** ![gustavohsouza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/gustavohsouza/32/3833_2.png) [@gustavohsouza](https://forum.beeminder.com/u/gustavohsouza)\
**Post date:** [February 17, 2021, 4:05pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/17 "2021-02-17T16:05:51Z")

</div>

**Update:**  
Someone commented on my [personal blog](https://gustavosouza.blog/mind-the-bee/) and his/her comment led me abandon IFTTT sooner than later.

I’m now able to get data from my health app and post directly on my Beeminder goal!

The problem I was having with IFTTT’s value not being recognized by Beeminder is now gone.  
I suspect that by setting the “value” field as a _number_ and sending directly to through the API fixes this. IFTTT most likely sends this as a _string/text_ and when the value includes “:” it breaks.

## ![image](https://us1.discourse-cdn.com/flex019/uploads/beeminder/original/2X/5/56733020e2cbe07f3f43fa33b226d9341d144125.jpeg)

* * *

**Is it working as I intended?** No! Not yet.  
It’s just as faulty as the Beeminder iOS app: when used with Meditation Minutes, it only gets how many minutes the last meditation session took.

**Anyone has any clue on how to make Shortcuts read and sum all Mindful Minutes logged on a given day?**

---

<div class="post-metadata">

**Author:** ![gustavohsouza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/gustavohsouza/32/3833_2.png) [@gustavohsouza](https://forum.beeminder.com/u/gustavohsouza)\
**Post date:** [February 19, 2021, 9:14pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/18 "2021-02-19T21:14:33Z")

</div>

**Update:** _it’s working!!_

Thanks @krugerk @philip @krugerk and an anonymous beeminder user that commented on my [personal blog](https://gustavosouza.blog/mind-the-bee/). You rock!!

Here are the screenshots in case you want to copy it for yourself (apple does not allow for sharing Automations)

 ![IMG_2A0FA9D067D2-1](https://us1.discourse-cdn.com/flex019/uploads/beeminder/original/2X/2/2b78e6be7f2d98c348267c51ee679c9221f12bdf.jpeg)  
 ![IMG_C9C46A39312B-1](https://us1.discourse-cdn.com/flex019/uploads/beeminder/original/2X/4/4b8f55a95803d158e7facfc7072f007f1056b2ad.jpeg)  
 ![IMG_63F8E6CAA795-1](https://us1.discourse-cdn.com/flex019/uploads/beeminder/original/2X/c/c459faa8b33090908a460823bab3679f1ccd8c5b.jpeg)  
 ![IMG_FEFAF5BE9AC1-1](https://us1.discourse-cdn.com/flex019/uploads/beeminder/original/2X/a/a5fdce9a6d7cf88dd0a4d4f9cf6432f889d9467d.jpeg)

Case closed!

---

<div class="post-metadata">

**Author:** ![gustavohsouza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/gustavohsouza/32/3833_2.png) [@gustavohsouza](https://forum.beeminder.com/u/gustavohsouza)\
**Post date:** [February 24, 2021, 4:46pm UTC](https://forum.beeminder.com/t/alternative-way-to-pull-data-from-apple-health/9011/19 "2021-02-24T16:46:09Z")

</div>

Case reopened:

iphone Automations doesn’t work because it requires human authorization everytime the automation is fired (and at the time it fires I’m laying in bed)

Workaround: I gave up on the automation path and created a Shortcut that I’ll trigger everyday before sleeping. Not ideal but good enough until the iOS app is fixed 🙂
