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?

uraimo
  • 19,081
  • 8
  • 48
  • 55
user194076
  • 8,787
  • 23
  • 94
  • 154
  • 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. – lewis Sep 08 '17 at 15:27
  • When they could make it available for other iOS apps and app developers, I don't think it is different for REST api. – Nagarjun Nov 11 '17 at 22:13
  • The [HealthKit documentation](https://developer.apple.com/documentation/healthkit) 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](https://developers.google.com/fit/rest/). – Ferran Maylinch Mar 26 '18 at 09:01

4 Answers4

14

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!

candu
  • 2,827
  • 23
  • 18
  • 1
    Is this still the case? – jaybro May 17 '17 at 20:47
  • 6
    I've been able to cook something up with https://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. – Joris Nov 30 '17 at 09:50
10

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/

rockgecko
  • 4,127
  • 2
  • 18
  • 31
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.

uraimo
  • 19,081
  • 8
  • 48
  • 55
0

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.

pinty
  • 441
  • 4
  • 5