Fitness Data Types

Google Fit provides a set of fitness data types under the com.google namespace. Data types define the format of the values inside data points. A data point can represent:

  • An instantaneous reading or observation
  • An aggregate with statistics over a time interval

Google Fit defines data types for instantaneous observations and data types for aggregate data. Data points consist of values for the fields of a data type and timestamp information. Points that represent instantaneous observations include a timestamp, and points of an aggregate data type also include a timestamp for the start of the interval.

Google Fit enables you to define new data types in your app and to share your new data types with other apps.

For more information about inserting data points, see Add points to a dataset.

Data types

Google Fit features the following data types:

Public data types
Standard data types provided by the platform, like com.google.step_count.delta. Any app can read and write data of these types, with some limited exceptions.
For more information, see Public Data Types.
Private custom data types
Custom data types defined by a specific app. Only the app that defines the data type can read and write data of this type.
For more information, see Custom Data Types.
Shareable data types
Custom data types submitted to the platform by an app developer. Once approved, any app can read data of a shareable type, but only whitelisted apps as specified by the developer can write data of that shareable type.
For more information, see Shareable Data Types.
Restricted data types
Google Fit applies additional security and privacy controls to HealthDataTypes.
For more information, see Restricted Data Types.

Public data types

Google Fit defines public data types for instantaneous readings and data types for aggregate data.

Data types for instantaneous readings

The following table lists data types for instantaneous readings:

Data Type Name Description Permission Fields (Format—Unit)
com.google.activity.sample Instantaneous sample of the current activity. Activity activity (int—enum)
confidence (float—percent)
com.google.activity.segment Continuous time interval of a single activity. Activity activity (int—enum)
(deprecated) com.google.calories.consumed Total calories consumed over a time interval. Activity calories (float—kcal)
com.google.calories.expended Total calories expended over a time interval. Activity calories (float—kcal)
com.google.cycling
.pedaling.cadence
Instantaneous pedaling rate in crank revolutions per minute. Activity rpm (float—rpm)
com.google.cycling
.wheel_revolution.rpm
Instantaneous wheel speed. Location rpm (float—rpm)
com.google.distance.delta Distance covered since the last reading. Location distance (float—meters)
com.google.heart_rate.bpm Heart rate in beats per minute. Body bpm (float—bpm)
com.google.height The user's height, in meters. Body height (float—meters)
com.google.nutrition Food item information Nutrition nutrients (Map<String, float>—calories/grams/IU)
meal_type (int—enum)
food_item (String—n/a)
com.google.power.sample Instantaneous power generated while performing an activity. Activity watts (float—watts)
com.google.speed Instantaneous speed over ground. Location speed (float—m/s)
com.google.step_count.cadence Instantaneous cadence in steps per minute. Activity rpm (float—steps/min)
com.google.step_count.delta Number of new steps since the last reading. Activity steps (int—count)
com.google.weight The user's weight. Body weight (float—kg)
com.google.activity.exercise A user's continuous workout routine. Activity exercise (int—enum)
repetitions (int—count)
resistance type (int—enum)
resistance (float—kg)
duration (int—milliseconds)

Data types for aggregate data

The following table lists data types for aggregate data:

Data Type Name Description Permission Fields (Format—Unit)
com.google.activity.summary Total time and number of segments in a particular activity for a time interval. Activity activity (int—enum)
duration (int—ms)
num_segments (int—count)
com.google.heart_rate.summary Average, maximum, and minimum beats per minute for a time interval. Body average (float—bpm)
max (float—bpm)
min (float—bpm)
com.google.nutrition.summary User's nutrition intake during a time interval. Nutrition nutrients (Map<String, float>—calories/grams/IU)
meal_type (int—enum)
food_item (String—n/a)
com.google.power.summary Average, maximum, and minimum power generated while performing an activity. Activity average (float—watts)
max (float—watts)
min (float—watts)
com.google.speed.summary Average, maximum, and minimum speed over ground over a time interval. Location average (float—m/s)
max (float—m/s)
min (float—m/s)
com.google.weight.summary Average, maximum, and minimum weight over a time interval. Body average (float—kg)
max (float—kg)
min (float—kg)

Using data types with the REST API

The dataSources resource includes the data type (and a list of its fields) for each data source. You can specify one of these data types when you create data sources, and you can obtain the name of the data type and a list of its fields when you retrieve a data source from the fitness store.

For example, a data source representation specifies its data type as follows:

{
  "dataStreamId": "exampleDataSourceId",
  ...
  "dataType": {
    "field": [
      {
        "name": "steps",
        "format": "integer"
      }
    ],
    "name": "com.google.step_count.delta"
  },
  ...
}

When using one of the public data types in a data source, the data type name and its field definitions must match those listed in the tables above.

Exceptions

Whilst any application can write data to a public data type, there are certain data types which can only be read by the application that wrote the data.

Data Type Name Description Fields (Format—Unit)
com.google.location.sample The user's current location. latitude (float—degrees)
longitude (float—degrees)
accuracy (float—meters)
altitude (float—meters)
com.google.location.bounding_box A bounding box for the user's location over a time interval. low_latitude (float—degrees)
low_longitude (float—degrees)
high_latitude (float—degrees)
high_longitude (float—degrees)

Custom data types

Google Fit enables you to create custom data types for your application and to use them to store fitness data. When you create custom data types, ensure that:

  • Google Fit does not already provide a similar data type.
  • The data type name is clear.
  • The data type name accurately represents the underlying data.
  • The prefix of the data type name matches the package name of your application.

Create a custom data type

To create a custom data type, create a new data source specifying the name of the data type and its field definitions.

For example, define a custom data type in a data source as follows:

{
  "dataStreamId": "exampleDataSourceId",
  ...
  "dataType": {
    "field": [
      {
        "name": "myFieldA",
        "format": "integer"
      },
      {
        "name": "myFieldB",
        "format": "integer"
      },
    ],
    "name": "com.example.myapp.mycustomtype"
  },
  ...
}

Use a custom data type

To insert fitness data of your custom type, specify the data source you created for your data type when you create a dataset with new data points. The data points must have the same number of components and types as those specified by your custom data type.

To read fitness data of your custom data type, specify the data source you created for your data type when you retrieve data points from the fitness store.

Shareable data types

Shareable data types are custom data types that have been approved by Google to be shared on Google Fit. Applications can use existing shareable data types in accordance with the terms and conditions set by the developer who created the data type.

Available shareable data types

For more information about these shareable data types, see the third party developer terms and documentation for each data type.

Data Type Name Third Party Description Permission Fields
(Format—Unit)
Third Party Documentation
com.nike.NIKEFUEL Nike NikeFuel is a universal metric for movement that allows athletes to measure and compare all day activity and training intensity, and get real time feedback for any sport, at any skill level. Activity NIKEFUEL
(int—NikeFuel points)
Terms of Use
com.adidas.jump.height Adidas Jump height measures the height in inches for each jump recorded over a given period of time. Activity height
(float—inches)
Terms of Use
com.adidas.hustle Adidas Hustle measures how much force (effort) one generates through events (sprints, cuts and jumps) over a given period of time. Activity hustle
(float—m/s2/min)
Terms of Use
com.adidas.quickness Adidas Quickness is determined by how quick (on average) one changes their upper body linear speed or direction. Activity quickness
(float—m/s2/sec)
Terms of Use

Inserting data of a shareable type

Only applications approved by the developer of a shareable data type can write data of this type.

To insert data of a shareable type using the REST API, create a data source that specifies the shareable data type (including its fields and types) as the datasource's data type. Then use that data source to insert fitness data.

Reading data of a shareable type

To read data of a shareable type, look for available data sources whose data type is the shareable data type you're interested in.

Restricted data types

Google Fit defines the following data types for instantaneous readings and data types for aggregate data:

Data Type Name Description Permission Fields (Format—Unit)
com.google.body.temperature.basal The instantaneous basal body temperature of the user. Reproductive Health body temperature (float—celsius)
measurement location (int—enum)
com.google.blood_glucose Blood glucose concentration, temporal relationships to meals and sleep, and the source of the specimen which was measured. Blood Glucose blood glucose level (float—mmol/L)
temporal relation to meal (int—enum)
specimen source (int—enum)
temporal relation to meal (int—enum)
com.google.blood_pressure The instantaneous blood pressure of the user. Blood Pressure systolic (float—mmHg)
diastolic (float—mmHg)
body position (int—enum)
com.google.body.temperature The instantaneous body temperature of the user. Body Temperature body temperature (float—celsius)
measurement location (int—enum)
com.google.cervical_mucus User report of their cervical mucus. Reproductive Health texture (int—enum)
amount (int—enum)
com.google.cervical_position The user's cervical position. Reproductive Health position (int—enum)
dilation (int—enum)
firmness (int—enum)
com.google.menstruation A report of the user's menstrual flow. Reproductive Health menstrual flow (int—enum)
com.google.ovulation_test The results of an ovulation test. Reproductive Health test result (int—enum)
com.google.oxygen_saturation The instantaneous blood oxygen saturation of the user. Oxygen Saturation administration mode (int—enum)
system (int—enum)
measurement method (int—enum)
com.google.vaginal_spotting Occurrence of vaginal spotting. Reproductive Health occurrences (int—count)

Because health data is potentially sensitive, access to Google Fit HealthDataTypes are controlled through separate, sensitive API scopes.

Sensitive scopes allow access to Google User Data. If an app uses sensitive scopes, it must comply with the Google API User Data Policy and have its OAuth consent screen configuration verified by Google.

Users must accept your app's access to these data types separately from other scopes.

Read access to restricted data types

To read restricted data types, you must verify your app through Google's OAuth Application Verification process. Learn more

Any app may apply for verification and therefore read restricted data types. If your app is not verified, when it requests access to a sensitive OAuth scope certain request quotas will be applied and users may see warnings. The quotas are there to allow you to conduct testing. Learn more

Write access to restricted data types

Write access to restricted data types is a privilege that the Google Fit team assesses and grants on a per-application basis. To apply for your app to gain write access to restricted data types:

  1. Complete the verification process described in Reading restricted data types.

  2. Send an email to google-fit-restricted@google.com and request to be added to the list of apps allowed to write data of a restricted type to Google Fit. Provide a brief description of the data types you would like access to.

  3. If the data from your application can originate from connected devices, please include the following details about your use case and connected devices:

    • Data Type(s) to be written to.
    • Device model.
    • Validation Protocols Met (e.g. ESH 2002, BHS, ISO15197:2013).

Send feedback about...