These data types can be used to capture activities, workouts and metrics around
exercise.

## Activity

This data type can be used to capture any activity a user does. This can be
common fitness activities like running or different sports, as well as
activities like meditation, gardening, and sleep.

If the user was doing more than one activity during that time period, create a
session for the main activity type, and multiple segments for the different activity types.
For example, if they did a little bit of kick boxing and boxing during a mixed martial arts
class, create a session for mixed martial arts. You can then breakdown the different
activity types into segments.

Each data point needs a start time and end time. Data points don't need to be
back-to-back or directly after each other, there can be gaps in between.

> [!NOTE]
> **Note:** Time ranges for data points from the same stream shouldn't overlap! If they do, data from the overlapping period will be dropped which could cause discrepancies between expected and displayed values.

### REST

|---|---|
| **Name** | `com.google.activity.segment` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.activity.write |
| **Fields (format---units)** | **activity type** (`int`---enum) The type of activity the user was doing. See the list of [activity types here](https://developers.google.com/fit/rest/v1/reference/activity-types). |

### Android

|---|---|
| **Name** | `com.google.activity.segment` |
| **Data type object** | `TYPE_ACTIVITY_SEGMENT` |
| **Android permission** | `ACTIVITY_RECOGNITION` |
| **Fields (format---unit)** | **FIELD_ACTIVITY** (`int`---enum) The type of activity the user was doing. See the list of [activity types here](https://developers.google.com/android/reference/com/google/android/gms/fitness/FitnessActivities). |

## Basal metabolic rate (BMR)

This data type captures the BMR of a user, in kilocalories. Each data point
represents The number of kilocalories a user would burn if at rest all day,
based on their height and weight. Only the end time should be set. This
will be used as the timestamp for the reading.

> [!NOTE]
> **Note:** In Google Fit, BMR is used to calculate calories burned. It's not shown directly in the app.

### REST

|---|---|
| **Name** | `com.google.calories.bmr` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.activity.write |
| **Fields (format---units)** | **calories** (`float`---kcal per day) The number of kilocalories a user would burn if at rest all day, based on their height and weight. |

### Android

|---|---|
| **Name** | `com.google.calories.bmr` |
| **Data type object** | `TYPE_BASAL_METABOLIC_RATE` |
| **Fields (format---units)** | **FIELD_CALORIES** (`float`---kcal per day) The number of kilocalories a user would burn if at rest all day, based on their age, weight and height. |

## Calories burned

This data type captures the total calories (in kilocalories) burned by the
user, including calories burned at rest (BMR). Each data point represents the
total kilocalories burned over a time interval, so both the start and end times
should be set.

> [!NOTE]
> **Note:** When writing calorie data, include the calories burned at rest (BMR of the user).

### REST

|---|---|
| **Name** | `com.google.calories.expended` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.activity.write |
| **Fields (format---units)** | **calories** (`float`---kcal) Number of kilocalories burned. |

### Android

|---|---|
| **Name** | `com.google.calories.expended` |
| **Data type object** | `TYPE_CALORIES_EXPENDED` |
| **Android permission** | `ACTIVITY_RECOGNITION` |
| **Fields (format---units)** | **FIELD_CALORIES** (`float`---kcal) Number of kilocalories burned. |

## Cycling pedaling cadence

If a user goes cycling, this data type can be used to capture their pedaling
rate, in **crank revolutions per minute (RPM)**. Each data point represents an
instantaneous measure of the pedaling rate, so only the end
time should be set. This will be used as the timestamp for the reading.

> [!NOTE]
> **Note:** Different data sources need to monitor the crank revolutions for different amounts of time before calculating the instantaneous RPM. This should be indicated as part of the data source, not the data point.

### REST

|---|---|
| **Name** | `com.google.cycling.pedaling.cadence` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.activity.write |
| **Fields (format---units)** | **rpm** (`float`---rpm) Number of bicycle crank revolutions per minute. |

### Android

|---|---|
| **Name** | `com.google.cycling.pedaling.cadence` |
| **Data type object** | `TYPE_CYCLING_PEDALING_CADENCE` |
| **Fields (format---units)** | **FIELD_RPM** (`float`---rpm) Number of bicycle crank revolutions per minute. |

## Cycling pedaling cumulative

If a user goes cycling, this data type can be used to capture the number of
**crank revolutions over a time period**. Each data point represents the number
of revolutions since the count at the start time.

> [!NOTE]
> **Note:** Each data point captures the total number of revolutions since the start time. It's not the delta or change in revolutions. So the number of revolutions over a time interval can be calculated by subtracting the final count at the end time from the initial count at the start time.

### REST

|---|---|
| **Name** | `com.google.cycling.pedaling.cumulative` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.activity.write |
| **Fields (format---units)** | **revolutions** (`int`---count) Number of bicycle crank revolutions over a time period. |

### Android

|---|---|
| **Name** | `com.google.cycling.pedaling.cumulative` |
| **Data type object** | `TYPE_CYCLING_PEDALING_CUMULATIVE` |
| **Fields (format---units)** | **FIELD_REVOLUTIONS** (`int`---count) Number of bicycle crank revolutions over a time period. |

## Heart Points

This data type captures the number of Heart Points a user has earned, from all
their activity. Each data point represents the number of Heart Points calculated
for a time interval.

User's can set a daily Heart Point goal and track their progress. Heart Points
can be calculated using:

- heart rate
- [Metabolic Equivalent of Task (MET) values](https://golf.procon.org/met-values-for-800-activities/)
- walking speed

The number of Heart Points earned depends on the intensity of the activity. Use
this guide to calculate and write Heart Points:

| Data | 1 HP (Low-medium intensity activity) | 2 HPs (High intensity activity) |
|---|---|---|
| Heart rate | 1 minute of actvity at \>50% maximum heart rate | 1 minute of activity at \>70% max heart rate |
| MET value | 3-6 MET. For example, rowing or rock climbing, | \>6 MET. For example, HIIT, skiing, volleyball or football. |
| Walking speed | 100-130 steps per minute | \>130 steps per minute |

> [!NOTE]
> **Note:** Both start and end time must be set. These timestamps need to be rounded up or down to the nearest minute, so the seconds values should always be `:00`.

### REST

|---|---|
| **Name** | `com.google.heart_minutes` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.activity.write |
| **Fields (format---units)** | **intensity** (`float`---Heart Points) Heart Points earned based on the intensity of the exercise or activity the user does. |

### Android

|---|---|
| **Name** | `com.google.heart_minutes` |
| **Data type object** | `TYPE_HEART_MINUTES` |
| **Fields (format---units)** | **FIELD_INTENSITY** (`float`---heart points) The intensity of the exercise or activity the user does. One minute of light to moderate physical activity (like walking faster than 2.5 mph, or cycling faster than 10 mph) earns 1 heart point. One minute of more intense activity earns 2 heart points. |

## Move Minutes

This data type captures the number of Move Minutes Google Fit calculates that a
user has earned, from all their activity. Each data point represents the derived
number of Move Minutes for a time interval. Both start and end time must be set.

Users can earn Move Minutes from any activity like yoga, dancing, or gardening
and other household chores. If they go for a walk, Google Fit awards one Move
Minute every time they take at least 30 steps within 60 seconds.

> [!NOTE]
> **Note:** These timestamps need to be rounded up or down to the nearest minute, so the seconds values should always be `:00`.

### REST

|---|---|
| **Name** | `com.google.active_minutes` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.activity.write |
| **Fields (format---units)** | **duration** (`int`---milliseconds) The duration of Move Minutes earned, in milliseconds. **Valid range**: \>=0 |

### Android

|---|---|
| **Name** | `com.google.active_minutes` |
| **Data type object** | `TYPE_MOVE_MINUTES` |
| **Fields (format---units)** | **FIELD_DURATION** (`int`---milliseconds) The duration of Move Minutes earned, in milliseconds. **Valid range**: 0---Long.MAX_VALUE |

## Power

This data type captures the power generated by a user when doing an activity,
measured in watts. For example, using a power meter when exercising on a
stationary bike. Each data point represents an instantaneous measurement of
power generated.

Each data point represents an instantaneous measure of power generated, so only
the end time should be set. This will be used as the timestamp for the reading.

### REST

|---|---|
| **Name** | `com.google.power.sample` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.activity.write |
| **Fields (format---units)** | **watts** (`float`---watts) Power generated, in watts. |

### Android

|---|---|
| **Name** | `com.google.power.sample` |
| **Data type object** | `TYPE_POWER_SAMPLE` |
| **Fields (format---units)** | **FIELD_WATTS** (`float`---watts) Power generated, in watts. |

## Step count cadence

This data type captures the walking cadence, measured in steps per minute. Each
data point represents an instantaneous measurement of the cadence in steps per
minute.

### REST

|---|---|
| **Name** | `com.google.step_count.cadence` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.activity.write |
| **Fields (format---units)** | **rpm** (`float`---steps/minute) Cadence measured in steps per minute. |

### Android

|---|---|
| **Name** | `com.google.step_count.cadence` |
| **Data type object** | `TYPE_STEP_COUNT_CADENCE` |
| **Fields (format---units)** | **FIELD_RPM** (`float`---steps/minute) Cadence measured in steps per minute. |

## Step count delta

This data type captures the number of steps taken since the last reading. Each
step is only reported once so data points shouldn't have overlapping time. The
start time of each data point should represent the start of the interval in
which steps were taken.

The start time must be equal to or greater than the end
time of the previous data point. Adding all of the values together for a period
of time calculates the total number of steps during that period.

### REST

|---|---|
| **Name** | `com.google.step_count.delta` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.activity.write |
| **Fields (format---units)** | |---| | **steps** (`int`---count) Number of steps taken over a time period. **Valid range**: 0---10 steps per second | |

### Android

|---|---|
| **Name** | `com.google.step_count.delta` |
| **Data type object** | `TYPE_STEP_COUNT_DELTA` |
| **Android permission** | `ACTIVITY_RECOGNITION` |
| **Fields (format---units)** | |---| | **TYPE_STEP_COUNT_DELTA** (`int`---count) Number of steps taken over a time period. **Valid range**: 0---10 steps per second | |

## Workout

Each data point represents a single continuous set of a workout exercise
performed by a user. The data point contains fields for the exercise type (for
example resistance exercises or weight training), the number of repetitions of
the exercise, the duration of the exercise, and the resistance.

### REST

|---|---|
| **Name** | `com.google.activity.exercise` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.activity.write |
| **Fields (format---units)** | |---| | **exercise** (`int`---enum) Values representing different exercises, such as weight lifting exercises, strength training exercises, and cardiovascular exercises. Accepted values <br /> ```restructuredtext back_extension bridge.hip.single_leg burpee calf_press calf_raise calf_raise.seated calf_raise.standing chinup clean clean.hang clean.hang_power clean.jerk clean.power crunch crunch.twisting curl.bicep deadlift deadlift.rdl deadlift.single_leg deadlift.straight_leg dip dip.chest dip.triceps fly good_morning hip_extension hip_raise hip_thrust jumping_jack leg_curl leg_extension leg_press leg_raise lunge lunge.rear lunge.side plank plank.side press.bench press.bench.close_grip press.bench.decline press.bench.incline press.jm press.pike press.shoulder press.shoulder.arnold press.shoulder.military pulldown pullover pullup pushup pushup.close_grip pushup.pike raise.front raise.lateral raise.lateral.rear row row.high row.upright run.high_knee russian_twist shrug situp situp.twisting squat step_up swing thruster triceps_extension vups wall_sit ``` | | **repetitions** (`int`---enum) Number of repetitions of an exercise. | | **resistance type** (`int`---enum) The type of resistance used during the exercise. Accepted values ```restructuredtext "intVal": 0 // The resistance type is unknown, unspecified, or can't be represented by a value. "intVal": 1 // The user is using a barbell for resistance. "intVal": 2 // The user is using a cable for resistance. If using 2 cables are used (one for each arm), include the resistance weight for one arm. "intVal": 3 // The user is using dumbells for resistance. "intVal": 4 // The user is using a kettlebell for resistance "intVal": 5 // The user is performing the exercise in a machine. "intVal": 6 // The user is using their own body weight for resistance. ``` | | **resistance** (`float`---kg) The resistance of the exercise (or weight), in kilograms. | | **duration** (`int`---milliseconds) Duration of an exercise for which the duration matters. | |

<br />

### Android

|---|---|
| **Name** | `com.google.activity.exercise` |
| **Fields (format---units)** | |---| | **FIELD_EXERCISE** (`int`---enum) Values representing different exercises, such as weight lifting exercises, strength training exercises, and cardiovascular exercises. Accepted values <br /> ``` ARNOLD_PRESS BACK_EXTENSION BENCH_PRESS BICEP_CURL BURPEE CALF_PRESS CALF_RAISE CHEST_DIP CHINUP CLEAN CLEAN_JERK CLOSE_GRIP_BENCH_PRESS CLOSE_GRIP_PUSHUP CRUNCH DEADLIFT DECLINE_BENCH_PRESS DIP FLY FRONT_RAISE GOOD_MORNING HANG_CLEAN HANG_POWER_CLEAN HIGH_KNEE_RUN HIGH_ROW HIP_EXTENSION HIP_RAISE HIP_THRUST INCLINE_BENCH_PRESS JM_PRESS JUMPING_JACK LATERAL_RAISE LEG_CURL LEG_EXTENSION LEG_PRESS LEG_RAISE LUNGE MILITARY_PRESS PIKE_PRESS PIKE_PUSHUP PLANK POWER_CLEAN PULLDOWN PULLOVER PULLUP PUSHUP RDL_DEADLIFT REAR_LATERAL_RAISE REAR_LUNGE ROW RUSSIAN_TWIST SEATED_CALF_RAISE SHOULDER_PRESS SHRUG SIDE_LUNGE SIDE_PLANK SINGLE_LEG_DEADLIFT SINGLE_LEG_HIP_BRIDGE SITUP SQUAT STANDING_CALF_RAISE STEP_UP STRAIGHT_LEG_DEADLIFT SWING THRUSTER TRICEPS_DIP TRICEPS_EXTENSION TWISTING_CRUNCH TWISTING_SITUP UPRIGHT_ROW V_UPS WALL_SIT ``` | | **FIELD_REPETITIONS** (`int`---count) Number of repetitions of an exercise. | | **FIELD_RESISTANCE_TYPE** (`int`---enum) The type of resistance used during the exercise. Accepted values ``` RESISTANCE_TYPE_UNKNOWN // The resistance type is unknown, unspecified, or can't be represented by a value. RESISTANCE_TYPE_BARBELL // The user is using a barbell for resistance. RESISTANCE_TYPE_CABLE // The user is using a cable for resistance. If using 2 cables are used (one for each arm), include the resistance weight for one arm. RESISTANCE_TYPE_DUMBBELL // The user is using dumbells for resistance. RESISTANCE_TYPE_KETTLEBELL // The user is using a kettlebell for resistance RESISTANCE_TYPE_MACHINE // The user is performing the exercise in a machine. RESISTANCE_TYPE_BODY // The user is using their own body weight for resistance. ``` | | **FIELD_RESISTANCE** (`float`---kg) The resistance of the exercise (or weight), in kilograms. | | **FIELD_DURATION** (`int`---milliseconds) Duration of an exercise for which the duration matters. | |
| **Fields (format---units)** |
| **Fields (format---units)** |

<br />