Google Fit

Intro

The Google Fit API is used to track your health and activity information.

Data points

The following data points are available for this integration:

Data pointDescription
aerobicsAerobics
archeryArchery
badmintonBadminton
baseballBaseball
basketballBasketball
biathlonBiathlon
bikingBiking
biking-handBiking (hand)
biking-mountainBiking (mountain)
biking-roadBiking (road)
biking-spinningBiking (spinning)
biking-stationaryBiking (stationary)
biking-utilityBiking (utility)
boxingBoxing
calisthenicsCalisthenics
circuit-trainingCircuit training
cricketCricket
crossfitCrossfit
curlingCurling
dancingDancing
divingDiving
elevatorElevator
ellipticalElliptical
ergometerErgometer
escalatorEscalator
extra-statusExtra status
fencingFencing
football-americanFootball (American)
football-australianFootball (Australian)
football-soccerFootball (soccer)
frisbee-discFrisbee disc
gardeningGardening
golfGolf
guided-breathingGuided breathing
gymnasticsGymnastics
handballHandball
high-intensity-interval-trainingHIIT
hikingHiking
hockeyHockey
horseback-ridingHorseback riding
houseworkHousework
ice-skatingIce skating
interval-trainingInterval training
in-vehicleIn vehicle
jump-ropeJump rope
kayakingKayaking
kettlebell-trainingKettlebell training
kickboxingKickboxing
kick-scooterKick scooter
kitesurfingKitesurfing
martial-artsMartial arts
meditationMeditation
mime-type-prefixMime type prefix
mixed-martial-artsMixed martial arts
on-footOn foot
otherOther
p90xP90x
paraglidingParagliding
pilatesPilates
poloPolo
racquetballRacquetball
rock-climbingRock climbing
rowingRowing
rowing-machineRowing machine
rugbyRugby
runningRunning
running-joggingRunning (jogging)
running-sandRunning (sand)
running-treadmillRunning (treadmill)
sailingSailing
scuba-divingScuba diving
skateboardingSkateboarding
skatingSkating
skating-crossSkating (cross)
skating-indoorSkating (indoor)
skating-inlineSkating (inline)
skiingSkiing
skiing-back-countrySkiing (back country)
skiing-cross-countrySkiing (cross country)
skiing-downhillSkiing (downhill)
skiing-kiteSkiing (kite)
skiing-rollerSkiing (roller)
sleddingSledding
sleepSleep
sleep-awakeSleep awake
sleep-deepSleep deep
sleep-lightSleep light
sleep-remSleep rem
snowboardingSnowboarding
snowmobileSnowmobile
snowshoeingSnowshoeing
softballSoftball
squashSquash
stair-climbingStair climbing
stair-climbing-machineStair climbing (machine)
standup-paddleboardingStandup paddleboarding
status-activeStatus active
status-completedStatus completed
stillStill
strength-trainingStrength training
surfingSurfing
swimmingSwimming
swimming-open-waterSwimming (open water)
swimming-poolSwimming (pool)
table-tennisTable tennis
team-sportsTeam sports
tennisTennis
tiltingTilting
treadmillTreadmill
unknownUnknown
volleyballVolleyball
volleyball-beachVolleyball (beach)
volleyball-indoorVolleyball (indoor)
wakeboardingWakeboarding
walkingWalking
walking-fitnessWalking (fitness)
walking-nordicWalking (nordic)
walking-strollerWalking (stroller)
walking-treadmillWalking (treadmill)
water-poloWater polo
weightliftingWeightlifting
wheelchairWheelchair
windsurfingWindsurfing
yogaYoga
zumbaZumba
.stethoscoperc.yml
integrations:
google-fit:
aerobics: true
archery: true
badminton: true
baseball: true
basketball: true
biathlon: true
biking: true
biking-hand: true
biking-mountain: true
biking-road: true
biking-spinning: true
biking-stationary: true
biking-utility: true
boxing: true
calisthenics: true
circuit-training: true
cricket: true
crossfit: true
curling: true
dancing: true
diving: true
elevator: true
elliptical: true
ergometer: true
escalator: true
extra-status: true
fencing: true
football-american: true
football-australian: true
football-soccer: true
frisbee-disc: true
gardening: true
golf: true
guided-breathing: true
gymnastics: true
handball: true
high-intensity-interval-training: true
hiking: true
hockey: true
horseback-riding: true
housework: true
ice-skating: true
interval-training: true
in-vehicle: true
jump-rope: true
kayaking: true
kettlebell-training: true
kickboxing: true
kick-scooter: true
kitesurfing: true
martial-arts: true
meditation: true
mime-type-prefix: true
mixed-martial-arts: true
on-foot: true
other: true
p90x: true
paragliding: true
pilates: true
polo: true
racquetball: true
rock-climbing: true
rowing: true
rowing-machine: true
rugby: true
running: true
running-jogging: true
running-sand: true
running-treadmill: true
sailing: true
scuba-diving: true
skateboarding: true
skating: true
skating-cross: true
skating-indoor: true
skating-inline: true
skiing: true
skiing-back-country: true
skiing-cross-country: true
skiing-downhill: true
skiing-kite: true
skiing-roller: true
sledding: true
sleep: true
sleep-awake: true
sleep-deep: true
sleep-light: true
sleep-rem: true
snowboarding: true
snowmobile: true
snowshoeing: true
softball: true
squash: true
stair-climbing: true
stair-climbing-machine: true
standup-paddleboarding: true
status-active: true
status-completed: true
still: true
strength-training: true
surfing: true
swimming: true
swimming-open-water: true
swimming-pool: true
table-tennis: true
team-sports: true
tennis: true
tilting: true
treadmill: true
unknown: true
volleyball: true
volleyball-beach: true
volleyball-indoor: true
wakeboarding: true
walking: true
walking-fitness: true
walking-nordic: true
walking-stroller: true
walking-treadmill: true
water-polo: true
weightlifting: true
wheelchair: true
windsurfing: true
yoga: true
zumba: true

If you want to enable all data points, you can simply use all instead:

.stethoscoperc.yml
integrations:
google-fit:
frequency: "daily"
all: true

Authentication

To fetch your health data from Google Fit, you have to create a Google Cloud application. Head to https://console.cloud.google.com and create an application, then enable the Fitness API (https://console.cloud.google.com/apis/api/fitness.googleapis.com/overview).

After enabling the Fitness API, generate OAuth 2.0 credentials (see Using OAuth 2.0 to Access Google APIs). Under "Authorized redirect URIs", enter https://developers.google.com/oauthplayground. You will generate a client ID and a client secret.

Then, head to the OAuth 2.0 Playground and click on the configuration icon on the top-right. Check the "Use your own OAuth credentials" checkbox and your client ID and client secret, then press "Close". Under "Select & authorize APIs", click on "Fitness API v1" and select all scopes. Click on the "Authorize APIs" button, then click on "Exchange authorization code for tokens". Finally, copy the generated access token and refresh token.

Environment variables

Environment variableDescription
GOOGLE_FIT_CLIENT_IDClient ID
GOOGLE_FIT_CLIENT_SECRETClient secret
GOOGLE_FIT_ACCESS_TOKENAccess token
GOOGLE_FIT_REFRESH_TOKENRefresh token
Google Fit