MyFitnessPal calories available via Health Graph API

A quick note for all Health Graph platform (@healthgraphapi) partners:

RunKeeper‘s (@runkeeper) recently announced integration with MyFitnessPal enables users to connect their accounts on the two systems to automatically sync MyFitnessPal tracked calories consumed (i.e. calories added) into RunKeeper while also syncing RunKeeper tracked fitness activities (calories subtracted) into MyFitnessPal. Weight measurements are also synchronized bidirectionally between the two systems so that your latest weight is consistent between the two.

MyFitnessPal calories consumed displayed in RunKeeper fitness feed

But there’s an added bonus for other RunKeeper partners and members of the Health Graph community. Both calories consumed and weight measurements synchronized from MyFitnessPal to RunKeeper are available to all Health Graph API developers. Calories appear as Nutrition sets with values in the calories field and weight measurements appear in Weight sets. Both of these nutrition and weight sets will have a source value of ‘MyFitnessPal‘ to indicate their origin.

We hope that access to the additional MyFitnessPal-originated data will help you build even more amazing things for our collective user community!

Bill Day (@billday) is Platform Evangelist & PM for RunKeeper where he helps developers learn about and use the Health Graph platform.

Advertisements

Validating tracked versus manual fitness activities using the Health Graph API

One question we receive fairly often from Health Graph (@healthgraphapi) partners is how to validate that fitness activities (runs, walks, bike rides, etc.) read out of the Health Graph platform were GPS-tracked versus manually entered by the user. Rewards partners a la Earndit and GymPact, corporate wellness providers like Virgin HealthMiles, and forward-thinking brands are often keen to differentiate between tracked versus manually entered activities as part of their programs’ anti-fraud efforts.

So how do you tell the difference between GPS and manual activities?

Each item in the Fitness Activity feed has ‘source‘, ‘entry_mode‘, and ‘has_path‘ fields. These let you determine whether the activity was originally submitted as a GPS-tracked activity. For example, a RunKeeper (@runkeeper) mobile app GPS-tracked run should have values of “RunKeeper“, “API“, and “true” for the aforementioned fields, respectively.

Health Graph fitness activity documentation

If you are interested in including GPS-tracked sources from other Health Graph partners’ activity trackers, you can include them in your ‘source‘ filtering. In addition, if you need to differentiate by type of activity (i.e. running, walking, cycling, etc.) you can use the ‘type‘ field.

Using these fields should let you skip any activities for which the user simply entered statistics, or originally entered the route map (path) via the Web. For more details on these fields and their usage, please refer to the Health Graph fitness activities documentation, especially the array structures section.

Caveat: The only reliable way to verify whether a user has subsequently edited the map associated with a saved GPS-tracked activity is to manually check each point’s ‘type‘ (a value of “manual” means it has been edited). For efficiency’s sake, we don’t save that information anywhere else in the Health Graph platform and we retrieve points only when full data for the activity is requested. That said, we have found that most users do not edit maps after the fact.

Bill Day (@billday) is Platform Evangelist & PM for RunKeeper where he helps developers learn about and use the Health Graph.


Health Graph API additions

We’ve made several recent additions to the Health Graph API (@healthgraphapi) based upon partner feedback and requests.

Recently added fields include:

  • source – string added to Fitness Activities, Background Activities, Nutrition, Sleep, Diabetes Measurements, and Weight portions of the Health Graph API; this provides the name of the application that last modified the given activity or measurement; see documentation for details.
  • is_live – boolean added to Fitness Activities to indicate whether the activity is currently being tracked via RunKeeper Live; note that this field will report ‘false‘ until at least one GPS point for the Live activity is received (this should occur immediately upon beginning the Live activity, but may be delayed up to several seconds if it takes longer than normal for GPS hardware to acquire a sufficient GPS signal).
  • userID – integer added to each team member entry from Street Team GET /team response to allow developers to more easily access team member account details (assuming member has authorized the calling app).
  • past activities are now available in a summary form that is more conducive to bandwidth-constrained environments; search for ‘summary’ in the Fitness Activities docs to learn more.
  • blood markers – a number of additional markers have been added to the General Measurements portion of the Health Graph API; for the complete list of what’s now available, please refer to documentation for General Measurements and Diabetes portions of the API.

Please let us know if you have any questions about these API updates by leaving a comment here or on this Health Graph discussion group thread (click here to access).

Bill Day (@billday) is Platform Evangelist for RunKeeper where he helps developers learn about and use the Health Graph.


Fleetly delights users via Health Graph integration

I recently had the pleasure of speaking with Geoff Pitfield (@gpitfield) of Fleetly (@fleetly) about his company and their new Fleetly app release which now includes support for RunKeeper users via Health Graph (@healthgraphapi) integration. Here’s an inside look at how one developer keeps their users happy and healthy with the Health Graph.

Bill Day: Please tell us about yourself and your company.

Geoff Pitfield: We’re currently an angel-backed team of two. I’ve been making mobile stuff since the days when that meant doing your own hardware, and have been working on Fleetly since early 2010. I’m a Product Design grad and MBA, but I’d never really coded so I taught myself in order to build Fleetly, which has certainly been interesting. Fleetly’s the first app that lets you check in on your fitness and evaluate your overall Fitness Level, based on all the exercise that you do, from weight training to long distance running. I got started on the app when I couldn’t find anything fun to use that supported the variety of activities I was doing to train for a triathlon.

BD: What’s the “elevator pitch” for why someone should use your app?

GP: It’s a fun, social way to stay motivated about your fitness *and* get meaningful insight into what you’re doing. When it clicks for people, they end up doing things like an extra 20 pushups or running another mile just to pass their friend on the leaderboard. That’s a great thing.

BD: How did you get started using the Health Graph API?

GP: Our users started vigorously and repeatedly demanding RunKeeper integration!

BD: How will using the Health Graph benefit your business?

GP: We think it will both increase our user base and increase retention, because Health Graph integration makes it much easier for people to use – they no longer have to enter their data into multiple applications.

BD: Which portions of the Health Graph API do you use, and why?

GP: We use the Fitness Activity API, because that’s the part that fits in with what we’re doing, as well as being what our users demanded. We might add weight tracking at some point as well.

BD: What do you like about the Health Graph? What would you like to see changed?

GP: It’s fairly easy to use and is comprehensive. It would benefit from better delete tracking, and should also support an identifier for originating source on entries. Otherwise, you run into problems if someone has cross-linked multiple services. For instance, we already integrate with Health Graph partner Withings (@withings). If someone’s linked their Withings account to the Health Graph, there really should be a way to tell that a given weight entry originated as Withings ID XYZ to avoid duplication. (Editor’s note: De-duplication today falls on the app developer.)

BD: If you could request any new feature from the Health Graph, what would it be? How would you use it?

GP: Off the top of my head, I’d rather see continued focus on making the API as robust, useable, and open a platform as possible. I don’t have any blindingly great feature ideas, per se, other than what I mentioned above which I think is really important. A push update service would be nice to reduce the need for polling.

BD: Can you share any future plans for your app? What’s coming next that your users will be excited about? Does the Health Graph play a role in that, and if so, how?

GP: The really cool stuff has to remain secret. 🙂 We’ll soon be introducing some new types of challenges that we think are going to be great, and very much focused on the same Fitness Activities we’re linking via the Health Graph. Also, we’ve always had our own little API but never done much to promote it, and we’re eager to help anyone who’s interested. The second most requested thing after RunKeeper is an Android app if anyone wants to play!

BD: Is there anything else we should know about you or your application?

GP: We’ve been doing a cool challenge with Lifehacker (click to access), and also have a badly under-promoted startup challenge (click here for startup challenge), both of which might be of interest. And the app’s available at www.fleetly.com/ios, so check it out!

Bill Day (@billday) is Platform Evangelist for RunKeeper where he helps developers learn about and use the Health Graph.