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.


Improve your health with GEAR4 Renew SleepClock

The GEAR4 Renew SleepClock is a non-contact (no headbands or wristbands) sleep monitor for RunKeeper (@runkeeper) users. Read on to learn how GEAR4 uses the Health Graph API & platform (@healthgraphapi) to add sleep into your health and wellness profile.

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

Shane Dodson: I joined GEAR4 five years ago and have been developing consumer electronics accessories during my time here, mostly docking stations and Bluetooth products. We started to make our products app-enabled around 3 years ago. This also meant we could look beyond the audio products which made up our core range.

I enjoy long distance running and so getting the chance to work with products that measure my health and fitness has been really exciting. I am currently training for my first ultra marathon. Looking at my sleep and running stats helps me to analyse the progress of my training program and also keeps me motivated by sharing the data with some of my training partners. I am trying to observe patterns – for example when I have had periods of very heavy training, do I sleep longer or deeper?

BD: What is the “elevator pitch” for why someone should use Renew SleepClock?

SD: The Renew SleepClock is a wireless sleep monitor that allows you to track, learn, and improve a third of your life you know little about!

Renew uses a sophisticated bio-sensor to wirelessly monitor your sleep. It knows when you’re awake and it knows when you’re asleep. It even knows whether you’re in light or deep sleep. It senses your breathing and movement and wakes you up at the best moment in your sleep cycle so you start the day feeling refreshed and energized. The Renew App lets you track your sleeping patterns from graphs and charts and gives you analysis and recommendations based on your data to help you get the most out of your sleeping life.

Gear4 Renew sleep data in the SleepClock iOS app

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

SD: When we launched the Renew SleepClock we knew that we had to engage the user, not just to measure their sleep, but to improve their habits so that they could sleep better leading to a healthier life. We knew that we had to look beyond sleep itself and started to look at potential key partnerships. RunKeeper was the obvious choice and that led us to Health Graph platform.

BD: How is using the Health Graph platform benefiting your business?

SD: SleepClock Renew can measure all sorts of details about sleep patterns, influencing factors, and suggestions on how to improve sleep. However we realised that sleep is only one of three important parts of a healthy lifestyle; sleep, diet and exercise. Health Graph platform allows the user to have this more holistic view of their wellness which is essential.

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

SD: We push Sleep Sets to the Health Graph giving you a more complete health picture. The Renew SleepClock measures these details.

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

SD: It has very good documentation. We had a request to allow group uploads of sleep data (previously it was only possible to upload a single night’s date). The API has now been changed to enable this.

We post summary statistics. It would be useful to push the underlying raw data. This would allow more interesting graphs about sleep within RunKeeper.

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

SD: We sync sleep data with our own cloud-based storage. It would be interesting to look at ways that our cloud could sync directly through the Health Graph platform. This would enable our users and RunKeeper users to have a seamless experience and have even more insight into their sleep patterns.

BD: Can you share any future plans for Renew and Gear4? What’s coming next that customers will be excited about?

SD: We are looking at a second version of the Renew SleepClock which would make this more accessible to a wider user base. We would definitely intend to continue using Health Graph platform for that.

We are also looking at other related products – more on that later this year.

BD: Is there anything else we should know about you, Renew, or Gear4?

SD: At GEAR4, we believe that personal wellness should be accessible to everyone. To that end we created the Renew brand. Leveraging our experience in smartphone accessories we are creating a line of products that help people track, learn and improve their personal well being. The Renew SleepClock is just the beginning. In the coming months and years we are looking to stand out with products that incorporate the latest technology while being affordable and simple.

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