Garmin presents certain challenges when it comes to accessing raw activities and health data. The official API remains inaccessible to Garmin Connect users, and only a few types of data are available for manual download via the web interface. Since this is interesting data to further analyze, I wrote a script that fetches all the data using an unofficial API wrapper to get my Garmin statistics.
The Python script allows entering a start and end date to then download activities and health data from that date range. Activities are downloaded in GPX, FIT and TCX formats and health and wellness data (like heart rate, steps, stress level, …) is downloaded as JSON.
To use the script, create a virtual environment and activate it (venv
python -m venv venv and
source venv/bin/activate). After that, install all the necessary dependencies with
pip install -r requirements.txt. To access your Garmin Connect account, ensure you set the email and password within a
.env file (use
.env.example as a template).
That’s all, you can now run the script (
python ./reclaimgarmin.py) and input the desired start and end dates for data retrieval. The files will be stored in the data directory, grouped by day. Make sure to download data in smaller batches (like one month at a time) to prevent timeouts or too many requests errors…