Garmin export


With the system outage at Garmin between July 23rd and July 29th 2020, it became clear that a user is really dependent on the Garmin systems for access to their own data. This made me think about ways to at least have a copy in my own possession.

Luckally, I am not the first one thinking about this. Peter Gardfjall has created some nice scipting which allows to connect to the Garmin API and download your data. It is called Garmin export.

This page describes how I’m using Peter’s scripting to saveguard my data.

Initial testing

I first wanted to try the script and see what data is retrieved from the Garmin API. To do that, I first installed the script using PIP:

pip3 install garmin-export

After that, I ran the script to look at the files generated:

garmin-export --password <password> <username>

Apparently my watch tracked 161 activities since I started using it in October 31st 2019.

The files generated are described in Garmin export command line tool description.

Looking at the files, the json format looks most accessible, but I’m not sure yet what to do with it.

Backing up

Although I have no real purpose for the data right now, I have automated backing up the files by creating a cron job:

 # m h  dom mon dow   command
 0 0 * * * /home/<user>/.local/bin/garmin-backup \
   --backup-dir=/home/<user>/garmin_activities \
   --password <password> <username> \
   &>> /home/<user>/garmin_activities/backup.log

I choose to have a nightly backup at midnight. Doing it daily will keep it short.

What’s next?

As said, I have no real purpose right now. I might put some effort in importing the data into a database, so I can use for example Grafana to visualize it. And then, having it in a database, it would allow me to do some more analysis on e.g. my heart-rate statistics.

August 5, 2020