How to Enable Google Fit, Apple’s HealthKit, and Other Services to Share Data with Your App
If you’re building a fitness application of any kind, you likely know that they greatly depend on real-time user data. That will be true for whatever your case is: gym scheduling, online workouts, branded coaching, mindfulness, nutrition, you-name-it app. But what’s the use case for it?
Modern users often have more than 1 tracking application. They can use their favorite apps to monitor sleep, count calories and track evening runs, each perfectly calibrated to match their preferences and needs.
Google and Apple let such apps freely exchange data — of course, prior user permission is required. It helps to give users an even more customized experience than any of these apps could do on its own.
For example, your online workouts app can analyze daily calorie intake to offer even more personalized exercise plans. Or your users can still compete in a daily step-counting challenge in the same social fitness app while using different devices and apps to track their walking activity.
Whatever your reasons are, you will still face the same questions as:
- What data do fitness trackers and apps collect?
- How can you enable Google Fit, Apple’s HealthKit, Garmin, Strava, Fitbit, and other services to share data with your application?
- Is there any special privacy, security, or other requirements to integrate these services into your app?
In this guide, we’ll cover all of the mentioned and other questions like a comparison of Google Fit kit vs Apple HealthKit. Let’s start by figuring out the general scheme of how you can integrate these services into your app.
📲 How to Get Fitness & Health Data for Your App from other Apps?
We’ve been writing this article keeping non-developers in mind: gym and yoga studio owners or personal coaches and fitness influencers. So let’s spend a minute to explain how it all works in a nutshell.
To access fitness & health data provided by such services as Google Fit, Apple Health, Garmin, and others, you’ll need to integrate their public API — application programming interface. To put it simply: write a special part of code that will enable your app to reach out to those services, ask them for data and display it in your application.
In the description of each service, we’ll leave links to the service’s documentation that explains what your developers should do. So just show it to your development team if you already have one — and they’ll be all set!
In case you’re still looking for a Tech Partner, drop us a line with your idea and we’ll be glad to see how we can apply our experience to help you!
Links to documentation can be found in paragraphs dedicated to each service 🙂
Let’s start by taking a look at two major fitness & health data services — Google Fit and Apple Health!
🏃♂️ Google Fit
Google Fit was released in 2014. The same year the company also introduced the Google Fit SDK to provide developers with tools for mobile and web app development.
Actually, there are quite many fitness apps using Google API. The most well-known are Nike Run Club, Strava, Runtastic, 8fit Workouts, Calorie Counter — MyFitnessPal, and others.
What even more interesting is that the list of Google Fit compatible apps isn’t limited only to fitness applications. For example, you can find there such apps as Pokémon Go (game), Calm (mindfulness), or Clue Period Tracker (healthcare).
This is how it all works:
The list of Google Fit compatible devices is also quite long. Moreover, it’s the default fitness application in every Wear OS device. It means Google Fit perfectly integrates with such devices as Amzfit, Xiaomi Mi Band, Samsung Galaxy Watch, Huawei Band, Sony SmartBand, Withings Move, Fitbit, and Garmin devices.
Many app developers are interested in Google Fit integration because of the great number of available data types. Let’s take a closer look at them!
Google Fit is an open ecosystem. It means that users can upload their fitness data to a central storage (repository) and then access it from different applications and devices.
To develop mobile or web apps that work with Google Fit, you’ll need to use the Google Fit SDK. It comes together with a bunch of Android APIs like the Sensors API (to access raw sensor data streams), the History API (to access the historical health and wellness data), or others.
For iOS and web applications, you should use the REST API.
Types of fitness & healthcare data
Basically, Google Fit collects and stores 4 types of fitness data from users:
- Activity — step count, burned calories, workout duration, basal metabolic rate.
- Location — total running/cycling distance and speed as well as cycling cadence (RPM).
- Body — heart rate, weight, body fat percentage.
- Nutrition — nutrients, food & hydration.
Your app can access this data by asking permission to do so. Except for that public data, Google Fit can also store restricted health data types. Yet, since these kinds of data relate to sensitive healthcare information, you’ll have to apply for OAuth API verification to get it. Then Google will review your application and either grant or deny verification. Such protected info includes:
- Oxygen saturation
- Body temperature
- Blood pressure
- Blood glucose
- Cervical position and others
If you need data that isn’t covered by the platform yet, Google allows creating custom data types.
Since fitness and healthcare data are usually quite sensitive, you should also be aware of how Google Fitness APIs comply with modern security requirements and how you integrate them without breaking these rules.
The full Terms and Conditions can be found here, so we’ll just cover the key points:
- If you use Shareable Data Types from other providers, you may be required to comply with additional third-party terms. For example, if you’d like to use any custom fitness data (e.g. NIKEFUEL fitness points) in your app, you must comply with the terms of the provider (the NIKE+ Developer Terms in that case).
- Google Fit isn't meant to be used with medical devices. As Google explicitly states it, "do not use Google Fit APIs with any product or service that may qualify as a medical device" as it defined in the Section 201(h) of the Federal Food Drug & Cosmetic (FD&C) Act.
- Using Google Fit APIs doesn't automatically make your app HIPAA-compliant. It means that you are solely responsible for any applicable compliance with HIPAA. Moreover, if you plan to involve any kind of Protected Health Information (according to HIPAA), you’ll need to get prior written consent to such use from Google.
- Finally, you should agree that you neither will sell any content you get from Google Fit for advertising, promotions, etc., nor you will allow your end-users to do so.
To enable Google Fit to share data with your app, you’ll need a Google account and Google Play Services. Good news for your developers: Google provides clear and extensive documentation on how to retrieve data from Google Fitness API! Let them check it below:
- Android APIs for developing Android apps
- REST API for developing apps on any other platform (including desktop web)
Now let’s switch to Apple’s healthcare data framework and check the differences between HealthKit and Google Fit!
🧘♀️ Apple’s HealthKit
Just like Google Fit, the Apple Health app was announced in 2014 and included in Apple devices with iOS 8+. Quite a fruitful year for fitness apps, isn’t it?
Along with the app, the company also released the Apple HealthKit API which is a part of the iOS SDK for app development on Mac.
The tool quickly became popular. The list of apps compatible with HealthKit includes such popular names as:
- fitness apps — Strava, Runtastic Steps, Garmin Connect
- nutrition apps — Lifesum, Foodzy
- healthcare apps — HealthyNow, Hello Doctor
When it comes to HealthKit compatible devices, Apple obviously prioritizes its own products — iPhone, iPod Touch, and Apple Watch. Except for that, Apple Health works with Jawbone, Nike Fuelband, devices by Withings, and a bunch of others. Yet, since both Apple and Google may face changes in the number and brands of supported devices, we recommend checking this info before development on your own so as to notice the latest changes.
The iOS HealthKit framework is widely used in different types of apps because it collects and stores much data of different types. Here they are!
Apple offers 3 Kits to be used by developers:
- HealthKit — a health & fitness data container. It enables seamless communication with other apps and makes it easy for them to store, exchange, and collect health data.
- ResearchKit — this framework will be useful if you need to gather medical data from large groups of people for research purposes.
- CareKit — a framework for monitoring and managing long-term and chronic illnesses, recovery after surgery, etc.
We’ll focus on the Apple HealthKit SDK since it’s the one you need for your fitness or yoga application. But a few words on user privacy first.
Types of fitness & healthcare data
If we compare Google FitKit vs Apple HealthKit, the last one collects more data on users that its competitor by Google. Moreover, the app puts a special emphasis on health data.
From the fitness perspective, the most important categories are:
|🗂 Category||🔎 Data examples*|
|Characteristic Identifiers — data that doesn’t typically change over time||Sex, blood type, date of birth, etc.|
|Activity||Number of steps, wheelchair pushes, swimming strokes; distance the user has moved running, walking cycling, swimming, skiing, using a wheelchair, etc.; burned resting and active energy.|
|Body Measurements||Height, weight, body mass index, and body fat percentage.|
|Vital Signs||Heart rate, oxygen saturation, body temperature, respiratory rate, systolic, and diastolic blood pressure.|
|Nutrition||Amount of consumed energy, fiber, sugar, carbohydrates, fat, etc.; vitamin and mineral consumption; hydration levels.|
|Mindfulness and Sleep||Sleep analysis|
|Workouts||Workout type identifier and the route the user took during a workout.|
|Other types of data that mainly relate to health data||Reproductive health; hearing; medical symptoms; lab and test results; clinical records; UV exposure.|
* full list of examples can be found here
How does the Health app collect such data? It’s provided either by:
- devices (for example, iPhone or Apple Watch may count a number of taken steps and burned calories);
- apps (user has its own favorite hydration app that shares this data with Apple Health);
- the user itself (when he manually enters his weight).
Note that developers can’t create custom data types. So make sure the Apple HealthKit framework provides all types of data you need. Otherwise, we’d recommend you to consider using another fitness data service that either provides all needed data types or allows you to create custom ones — like Google Fit API.
When developing fitness apps that work with Apple Health you can enable them to access and read the data as well as save new data to HealthKit.
Apple has quite strict guidelines for developers that want to enable data exchange using Apple Healthkit SDK. Here are the key things to consider:
- You must get explicit permission from a user to read and write his data. Moreover, users can grant or deny their permission for each type of data: for example, allow to share steps count and weight but prevent your app from accessing any nutrition data.
- Data must be kept only locally on users’ devices.
- You can only access the Apple HealthKit APIs if your app is primarily designed to provide fitness or health services. How can you prove this to Apple? As they put it in their guidelines, “it must be clear in both your marketing text and your user interface”.
- Obviously, you can’t disclose any information gained due to the use of the Apple HealthKit framework for advertising. It means you can still run in-app ads but don’t use health & fitness data for that purpose. Also, Apple allows to share this information with a third party but only with user permission and only if this third party also provides fitness or health services to the user.
Apple has a comprehensive step-by-step guide for iOS developers. Note, that you can integrate HealthKit can be integrated only in iOS applications.
For that your Dev Team will need to use iOS SDK 8 or higher. The guide can be found here.
Garmin is one of the key competitors of Apple and Fitbit in the market of fitness wearable devices. With millions of users, Garmin also represents a huge database of fitness data that you can access from your fitness app, too.
It’s proven by the number of third-party fitness apps and websites that partnered with Garmin for facilitated data exchange. To name a few big names: Nike+, Strava, MyFitnessPal, Run Keeper, and others.
The good news is that you too can access the Garmin framework to enable fitness data sharing. But first, let’s take a look at opportunities that Garmin offers to developers!
Garmin has a bunch of APIs and SDKs to cover different cases of fitness data exchange. Let’s see what tools you can use for Garmin integration.
A Garmin SDK that allows building applications, widgets, data fields and watch faces for Garmin devices. Will come in handy if your users actively use smartwatches and fitness trackers by Garmin and you’d like to improve their experience with your custom software.
This API lets to share user training data (like workouts, training plans, route plans, etc.) from your platform to the Garmin Connect account, and from there — to the Garmin devices. Thus, users will be able to access and track this data from their Garmin devices during workouts.
In other words, the Training API expands the utility of your content. For example, users can follow steps of your workouts or a running route on their Garmin wearables, increasing the likelihood of program adherence.
However, the key elements of the ecosystem are Garmin Health API and SDKs. These are the ones you’ll likely use when you need to enable data streaming from Garmin wearables or Garmin Connect.
Garmin Health SDKs
Garmin Health enterprise partners can use the Garmin Health SDKs for direct integration with Garmin wearable devices in their iOS and Android applications. In other words, these SDKs will come in handy if you need to directly get user data from Garmin wearables into your own fitness app.
The company offers 2 different types of SDKs:
- Standard SDK
The HIPAA-compliant SDK that allows gathering and storing user’s fitness & health data from Garmin wearables in your app. With its help you can create a single-app experience, take control of device features, and ensure that data goes directly to your app, letting you avoid the use of any Garmin servers.
- Companion SDK
This SDK provides fewer data types but allows real-time activity data streaming from Garmin wearables. For example, step count, heart rate, accelerometer, etc. However, the SDK itself doesn’t let you access historic data. To read episodic and historic data that users share with the Garmin Connect service, you should combine this Garmin SDK with Health API.
|Standard SDK||Companion SDK|
|Supported Devices||vívofit® 3/4, vívosmart® 3/4, vívoactive® 3/4, vívomove® HR/3, vívosport®, Venu™, Forerunner® series, fēnix® 5 series, fēnix® 6 series, Instinct®, tactix® Charlie, MARQ®*||vívosmart® 3/4, vívoactive® 3/4, vívomove® HR/3, vívosport®, Venu™, Forerunner® series, fēnix® 5 series, fēnix® 6 series, Instinct®, tactix® Charlie, MARQ®|
|Number of supported data types||14||10|
|Compatible with Garmin Connect||❌||✅|
Finally, the most likely case is that you’ll need to access the user’s fitness & health data stored in Garmin Connect. That’s when you need Garmin Health API.
Garmin Health API
If you need access to all data synced through Garmin Connect, the Health API should be your choice. It doesn’t allow you to control or configure Garmin devices but shares with your app the fullest volume of data they gather.
Types of fitness & healthcare data
The Garmin Health API lets you read and use both the all-day health data as well as details of fitness activities. Thus, it’s the only API you need to integrate so as to read data provided by users to Garmin.
Here you can see types of supported data:
However, you can customize your data feed and read only those metrics that are essential for your app, leaving unnecessary ones out.
The list of supported activity types is also huge and includes over 30 names. Except for basic running/cycling/swimming activities, Garmin also provides data on such special sports like kitesurfing, snowboarding and others.
Yet, as of 2019, it included common security requirements:
- You are allowed to transmit or share any end-user data only with the fully informed consent of the end-user.
- It’s prohibited to sell or rent data you get using Garmin’s API or SDKs.
However, it also includes a number of special responsibilities as:
- If you’d like to mention Garmin for any marketing purposes, you must first obtain written approval.
Garmin provides access to its framework upon request. Usually, the request is processed within 2 business days. The approval grants you access to the Garmin Developer Portal.
They will also hold an integration call to better understand your needs and help with high-level technical details.
Typically, integration takes 1-3 weeks.
You can send your request here:
Enabling Fitbit to share data from 20+ million users opens your way to one of the biggest fitness data storage. And with comprehensive documentation, the development becomes a piece of cake.
Just like Garmin, Fitbit integration allows creating your own apps for Fitbit wearable devices or integrating user data into your desktop or mobile applications. Here are APIs and SDKs you should use for that purpose.
Fitbit provides developers with everything they need to either build an app for a Fitbit device or integrate data of Fitbit users into his own application.
The most relevant parts of the Fitbit framework for you are:
- the Fitbit SDK — to create clock faces and applications for Fitbit OS devices: Fitbit Ionic and Versa Series (Versa, Versa Lite, Versa 2).
- the Fitbit Web API — to enrich your mobile or desktop application with data from Fitbit wearables, Aria scale, and manually entered logs.
In case you want to build an app for Fitbit devices, your developers will also use Fitbit Studio — a web browser-based development environment.
Yet, since this article covers the topic of custom fitness/health app development, we’ll focus on the characteristics of the Fitbit API.
Types of fitness & healthcare data
Fitbit divides the data it provides into categories called “scopes”. Developers can access 9 of them:
|🗂 Scope||📋 Description|
|Activity||Exercise log and activity data, including such details as step count, burned calories, distance, active minutes|
|Heart Rate||User’s heart rate and related analysis|
|Location||GPS and other location data|
|Nutrition||Food/water logging, nutrition-related data, calorie consumption, goals, etc.|
|Sleep||Sleep logs and related analysis|
|Weight||Weight, goals and related analysis (body fat percentage, body mass index)|
|Social||Social activity of the user within the Fitbit platform: friend list, leaderboards, etc.|
|Profile||Basic user info like name, sex, and age|
|Settings||User account and device settings (e.g. alarms)|
At first glance, security requirements for the Fitbit framework integration are quite basic: you can’t read any data without the user’s permission; you can’t sell the data obtained through the Fitbit services; users should clearly understand how you use their data, etc.
Yet, we recommend taking a close look at Fitbit’s requirements since the platform is quite strict when it comes to using their data in your own app.
For example, when providing access to its services, Fitbit expects developers to create apps that “interact with, enhance, extend, and improve the Fitbit Platform”. They stress that you shouldn’t use the Web API or Fitbit Developer Tools to create services that replace or provide similar functionality to the Fitbit Products and Platform. Consider this if you were about to make a Fitbit-like application.
You should be also careful with details. For example, your app, business name, domain name, and even email address or social media username shouldn’t contain not only “Fitbit” itself but even “-bit” ending. You are also not allowed to use the logo, icon, and even font and type styles from Fitbit Products.
You can check all the needed policies and requirements here:
- Fitbit Platform Terms of Service
- If you’re developing an application for a Fitbit Product, then it also must comply with Fitbit App Gallery Guidelines and Fitbit Application Distribution Agreement.
To use the Fitbit SDK and develop apps and clock faces for Fitbit devices, you’ll need:
- Fitbit user account.
- A Fitbit OS device for testing. It’s not necessary to buy one — you can use the Fitbit OS Simulator for Windows or macOS instead.
- The latest Fitbit mobile app for iOS, Android, or Windows Phone, paired with the Fitbit device.
- A computer with access to Fitbit Studio.
- An internet connection for the Fitbit device.
Look for details here:
Strava is another popular fitness platform that can be a source of valuable data for you. Yet, the company is also quite strict on how you use that data so they expect your application to augment the Strava experience of users in the first place.
Nevertheless, the Strava API is used by many big names such as Fitbit, Peloton, or Aaptiv. The company is actually proud of the number of apps integrated with Strava, so you can find many cases on this list.
By the way, one of the projects we've worked on is featured on that list under the wellness category — look for WePulse. Closer to the end of this article we'll share our expertise in that case!
Unlike other services from this article, Strava doesn’t have a branched ecosystem. It relies on the Strava API. This is the only tool developers need; the company doesn’t offer any Strava SDK or other tools.
The Strava API is a free-to-use public interface that allows to access Strava data on users, routes, clubs, gear, and segments. Notice that the API usage is limited on a 15-minute and daily request basis per app. The default rate limits your app to 100 requests every 15 minutes, with up to 1,000 requests a day.
Types of fitness & healthcare data
With the Strava API you can access the following types of data:
|🗂 Data Type||📋 Data examples (not exclusive list)|
|Activity||Type, distance, moving time, average speed|
|Athlete||Name, profile picture, weight, city, country, sex, friend count, linked clubs/bikes/shoes|
|Club||Name, city, country, status (private or not), member count|
|Gear||Name, brand, model, description, logged distance|
|Route||Distance, type (for runs or rides), status (private or public), estimated time to complete|
|Running Race||Name, type, distance, start time, country and city|
|Segments||Distance, grade, elevation, city, country|
|Streams||Time, distance, altitude, heart rate, cadence, power, temperature|
Strava doesn’t have all these data types listed in one place, but you can check this page for more info.
Strava’s guidelines are somewhat similar to the ones Fitbit has. Except for basic security requirements, you are not allowed to create an app that replicates or competes with Strava.
Yet, the company also has a few quite special requirements. For example:
- You must use the provided Strava logos and links in places where you use data provided by Strava.
- Your app must include the “Connect with Strava” button.
- You must also include the “Compatible with Strava” or “Powered by Strava” logos in all websites, applications, and media (prints, videos, images).
To make sure your app matches all the requirements for Strava integration, check the following links:
🦸♂️ Our Expertise in Health & Fitness Data Sharing Implementation
At Stormotion, we have also implemented fitness data integration from third-party services into our clients’ apps. One of the projects we’ve worked on — WePulse — is even featured on the Strava website.
WePulse is the French corporate well-being platform aimed to motivate employees across Europe to adopt a healthier lifestyle. The company has over 85 000 signed up employees and 150 partners, including BNP Paribas, Go Sport, and the city of Paris.
We started working on that project when our other client — a German corporate health platform HUMANOO — acquired WePulse.
Then the HUMANOO Team asked us to continue the BackEnd development for the WePulse mobile app.
To get health & fitness user data, we’ve implemented integration with 3 fitness services for them:
Thus, they are able to get all the fitness data without counting steps, calories, and other well-being parameters on their own.
These were the top 5 apps that gather fitness & health user data. We’ve started by taking a look at 2 main services — Google Fit and Apple Health — and followed by reviewing such big industry players as Garmin, Fitbit, and Strava.
Except for these companies, fitness data sharing can be also provided by:
We at Stormotion can help you integrate any of the mentioned or other fitness & health data services. We are also here to answer any questions on fitness/yoga app development — reach out to us and we’ll see how we can help you! 🙂