From b172c3aa24b21dcc18dc07a3feb1e1cb0c59dc04 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Sun, 16 Aug 2026 20:05:04 +0200 Subject: [PATCH 1/2] Add health snapshot download method In __init__.py add a download_health_snapshot method that accepts as input a date, similarly to the download option on the garmin user settings page. This pulls health snapshot "activities" that are otherwise not accessible with the normal download. --- garminconnect/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/garminconnect/__init__.py b/garminconnect/__init__.py index 26c9ba7..ea72e8e 100644 --- a/garminconnect/__init__.py +++ b/garminconnect/__init__.py @@ -560,6 +560,7 @@ def __init__( self.garmin_connect_fitnessage = "/fitnessage-service/fitnessage" self.garmin_connect_fit_download = "/download-service/files/activity" + self.garmin_connect_health_fit_download = "/download-service/files/wellness" self.garmin_connect_tcx_download = "/download-service/export/tcx/activity" self.garmin_connect_gpx_download = "/download-service/export/gpx/activity" self.garmin_connect_kml_download = "/download-service/export/kml/activity" @@ -2851,6 +2852,15 @@ def download_activity( logger.debug("Downloading activity from %s", url) return self.download(url) + + def download_health_snapshot(self, requested_date: str) -> bytes: + """Download the Health Snapshot ZIP file for a calendar date.""" + requested_date = _validate_date_format(requested_date, "requested_date") + url = f"{self.garmin_connect_health_fit_download}/{requested_date}" + + logger.debug("Downloading Health Snapshot from %s", url) + + return self.download(url) def get_activity_splits(self, activity_id: str) -> dict[str, Any]: """Return activity splits.""" From 84a26050b2aba1ee427bdb4050698c44970febf3 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Mon, 17 Aug 2026 10:19:52 +0200 Subject: [PATCH 2/2] Add small test for health_snapshot download --- tests/test_garmin.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_garmin.py b/tests/test_garmin.py index d24da0d..b183332 100644 --- a/tests/test_garmin.py +++ b/tests/test_garmin.py @@ -156,6 +156,19 @@ def test_download_activity(garmin: garminconnect.Garmin) -> None: ) +@pytest.mark.vcr +def test_download_health_snapshot(garmin: garminconnect.Garmin) -> None: + garmin.login() + + try: + snapshot = garmin.download_health_snapshot(DATE) + assert isinstance(snapshot, bytes) + assert snapshot + except garminconnect.GarminConnectConnectionError as e: + assert any(code in str(e) for code in ("403", "404", "Forbidden", "Not Found")) + pytest.skip("Health Snapshot unavailable for this date") + + @pytest.mark.vcr def test_all_day_stress(garmin: garminconnect.Garmin) -> None: garmin.login()