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 ‘
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 “
API“, and “
true” for the aforementioned fields, respectively.
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 ‘
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.
What happens when you give the RunKeeper crew two days to let imaginations run wild? A whole lot of awesome, I tell ya!
Our product team is always five steps ahead in terms of planning awesome updates to the app, but in the process, it seems each developer has some sort of other dream RunKeeper project they’d love work on if given the time. We decided to set two work days aside for engineers (and others throughout the company) to try to bring those to reality.
The community had lots of interesting ideas on what would make it into our first-ever hackathon, and many of the resulting hacks lined up with your hopes! There was a simple start widget for the home and lock screens on Android, much-improved data visualizations for your fitness reports, refreshed technology for GPS tracking, in-app strength training tracking, a pretty new website, and some ridiculously fun and motivating audio cues. And a few other things that are internal and top secret—for now :).
We’re cranking hard to turn some of these hacks into actual RunKeeper updates and features, so stay tuned! And in the meantime, the pictures and videos below are definitely worth (more than a) thousand words.
Kicking off some collaboration
Jacked Jim gears up for his commercial debut in the RoidKeeper strength training promotional video
This team gave a whole new meaning to the term long hours. (And garnished some awesome prizes in the process)
Makers of the aforementioned awesome audio cues hack demo their goods
A little hack to get some more real-time insights into our community
Working to build the perfect GPS algorithm
And this video really speaks to the need for that widget hack
One of our many rocking trophies
Cross-posted from the RunKeeper blog.
GymPact (@gympact) from Health Graph (@healthgraphapi) partner Pact helps motivate your exercise with cold, hard cash. With GymPact‘s Health Graph integration, qualifying RunKeeper tracked running, walking, and biking activities can be turned into money in your pocket. Read on to learn how GymPact motivates healthy behavior using the Health Graph.
Bill Day: Please tell us about yourself and Pact.
Yifan Zhang: A classic dormroom to startup story, I co-founded Pact with my Harvard classmate Geoff Oberhofer. We were both fascinated by a behavioral economics principle that people are motivated much more by loss than rewards.
We decided to first tackle the specific problem of getting people to the gym more often, and launched GymPact on January 1st, 2012.
BD: What is the “elevator pitch” for why someone should use GymPact?
YZ: Do you pay for an expensive gym membership but can never find the time to use it? GymPact is an iPhone app that lets you earn cash rewards for checking in at the gym, paid for by non-exercisers!
You can make a Pact to work out, choose how much money you’ll put on the line to motivate you, and earn cash when you meet your Pact. Our over 45,000 GymPact users are 90% successful at getting to the gym on committed days.
BD: How did you get started using the Health Graph API?
YZ: Ever since we launched, our users have asked to count outdoor activities (runs, walks, bike rides) toward their Pact. The Health Graph platform has allowed us to easily partner with awesome products like RunKeeper to give our users a feature they wanted.
BD: How is using the Health Graph benefiting your business?
YZ: We announced our integration with the Health Graph a few weeks before the launch, and the response was overwhelming! We had over 1,000 people sign up for our beta list on the first day, and tons more likes/RT’s on social media.
BD: Which portions of the Health Graph API do you use, and why?
YZ: Right now, we are pulling RunKeeper GPS-tracked activities from the API so that we can automatically count them toward GymPacter’s Pacts.
BD: What do you like about the Health Graph? What would you like to see changed?
YZ: The integration was so simple! There were very few bugs, which allowed us to focus on the product and experience rather than the engineering challenges of integration. We see no changes needed for the current version of what we’re doing.
BD: If you could request any new feature from the Health Graph, what would it be? How would you use it?
YZ: We would like to have verified activities marked specifically, since we would like to pull data from other Health Graph-integrated apps as well as RunKeeper.
BD: Can you share any future plans for Pact? What’s coming next that your users will be excited about? Does the Health Graph play a role in that, and if so, how?
YZ: One big thing is that we have an Android app now in private beta! You can sign up for it on our homepage or here. Also, we’re looking to partner with other health apps to incentivize verified healthy activities. The Health Graph is huge for making those partnerships simple!
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 /teamresponse 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.
Time and date information included in exported GPX files are normalized to universal time. See below for an example showing normalized times such as
Here are the steps you would follow to convert from universal time to local time:
- Read the normalized date and time out of one or more GPX export file track points
- Use the latitude and longitude in those track points to derive local time zone offset(s)
- Convert the universal time values in the GPX files into local time using the offset(s)
That’s all there is to it!
Thanks to everyone that provided feedback on our previous expansion of user data export, we have pushed an update so that it now also supports:
- Heart rate information in exported activity GPX files
- Start/stop in GPX for all activities where the user paused and then resumed their activity
Heart rate information is included with each GPS data point via
gpxtpx:hr tags, while each pause/resume results in a new