Query HealthKit data via REST API
Asked Answered
S

4

14

Is it possible to get data from Healthkit the same way as you would query regular API (With user's consent) to store in my webapp?

Something like: healthkit.com/api/v1/user/GetWeight

If yes, where can I find a list of available methods? If not, are there any workarounds?

Sophrosyne answered 1/5, 2015 at 10:59 Comment(3)
Given their approach to user privacy, especially with Health, I think it's very unlikely that something like this will ever be implemented by Apple.Microspore
When they could make it available for other iOS apps and app developers, I don't think it is different for REST api.Ethelyn
The HealthKit documentation says that The HealthKit data is only kept locally on the user’s device so I'm afraid a REST API doesn't exist like in Google Fit.Bosanquet
K
16

You'll have to build:

  • your own REST API service to store and retrieve the desired data;
  • an iOS app that accesses the data on-device using the HealthKit SDK and POSTs it to your API.

Neither step is trivial. Good luck!

Kurdistan answered 29/1, 2016 at 18:55 Comment(3)
Is this still the case?Tombouctou
I've been able to cook something up with workflow.is that fetches data from healthkit and then posts it to a URL of choice. Sorry, can't share because some details are personal, but hopefully this is a pointer for others.Nauseate
I found this Medium link helpful; non-paywall versionMicrocopy
L
14

An alternative may be to install Google Fit on the iPhone, which would connect to healthkit and sync that data to the cloud, which can then be queried via Fit's REST API https://developers.google.com/fit/rest/

Lawana answered 8/8, 2019 at 7:38 Comment(0)
L
4

If it's a REST/json API you want it's not available and i guess it never will be.

HealthKit is just a standard API available in the IOS8 SDK accessible from application running on a iDevice and written in objective-c/swift.

Lenlena answered 1/5, 2015 at 11:15 Comment(1)
This answer didn't age well...Refurbish
C
1

Not sure if this question is still relevant for someone, but now you have the option to use shortcuts to gather the desired health data and post it to your own api, also you may use automation in order to make it all happen without any hustle.

Celanese answered 30/6, 2022 at 5:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.