Public data types

Google Fit defines public data types for instantaneous readings.

Data types for instantaneous readings

The following table lists data types for instantaneous readings:

Data Type Name Description Permission Fields (Format—Unit) The user's Move Minutes. Activity duration (int—minutes) Instantaneous sample of the current activity. Activity activity (int—enum)
confidence (float—percent) Continuous time interval of a single activity. Activity activity (int—enum) Total calories expended over a time interval. Activity calories (float—kcal)
Instantaneous pedaling rate in crank revolutions per minute. Activity rpm (float—rpm)
Instantaneous wheel speed. Location rpm (float—rpm) Distance covered since the last reading. Location distance (float—meters) The user's Heart Points. Activity intensity (float—heart points) Heart rate in beats per minute. Body bpm (float—bpm) The user's height, in meters. Body height (float—meters) Food item information Nutrition nutrients (Map<String, float>—calories/grams/IU)
meal_type (int—enum)
food_item (String—n/a) Instantaneous power generated while performing an activity. Activity watts (float—watts) Instantaneous speed over ground. Location speed (float—m/s) Instantaneous cadence in steps per minute. Activity rpm (float—steps/min) Number of new steps since the last reading. Activity steps (int—count) The user's weight. Body weight (float—kg) A user's continuous workout routine. Activity exercise (int—enum)
repetitions (int—count)
resistance type (int—enum)
resistance (float—kg)
duration (int—milliseconds)
Table 1: Fitness data types for instantaneous readings

Using data types


On Android, the fitness data types are defined as public fields of the DataType class. How you invoke the Fitness APIs with the data type depends on what you want to accomplish:

  • To record fitness data, use the Recording API to create a subscription for each data type you want to record.
  • To read fitness data, use the History API to submit a read request for each data type.
  • To insert data into the fitness history, use the History API to submit an insert request for each data type.
  • To create sessions, use the Sessions API to insert or record fitness data with session metadata.

To create data points for an instaneous DataType object, assign values with the correct format. The following example shows you how to assign the food item as a string, the meal type as a constant from the Field class, and nutrient contents as mapped float values by calling the setKeyValue() method.

DataSource nutritionSource = new DataSource.Builder()

Map<String, Float> nutrients = new HashMap<>();
nutrients.put(Field.NUTRIENT_TOTAL_FAT, 0.4f);
nutrients.put(Field.NUTRIENT_SODIUM, 1f);
nutrients.put(Field.NUTRIENT_POTASSIUM, 422f);
DataPoint banana =
        .setTimestamp(now.getMillis(), TimeUnit.MILLISECONDS)
        .setField(Field.FIELD_FOOD_ITEM, "banana")
        .setField(Field.FIELD_MEAL_TYPE, Field.MEAL_TYPE_SNACK)
        .setField(Field.FIELD_NUTRIENTS, nutrients)

After setting data points in your app, you can insert, read, or delete the data from the fitness history with the History 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": ""

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.


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) The user's current location. latitude (float—degrees)
longitude (float—degrees)
accuracy (float—meters)
altitude (float—meters) 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)