The legacy Fitbit Web API and its OAuth endpoints were scheduled to be turned off on 2 November 2026. Apps that still call it stop receiving Fitbit and Pixel Watch data. The replacement is the Google Health API v4, and there was no Python client for it, so I wrote one: google-health.

Change one import

If your code uses python-fitbit, the compatibility layer keeps the same calls and returns the legacy JSON shapes:

# import fitbit from google_health import fitbit_compat as fitbit client = fitbit.Fitbit(GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, access_token=..., refresh_token=...) 

time_series, intraday_time_series, get_sleep, get_bodyweight and user_profile_get keep working. There is a similar layer for apps built on the Google Fit REST API (dataset:aggregate, dataSources, sessions.list), behind the same users().dataset().aggregate(...).execute() chain as googleapiclient.

Or use the new API directly

from google_health import HealthClient, OAuthCredentials, DataType client = HealthClient(OAuthCredentials.load("~/.config/google-health/token.json")) for day in client.daily(DataType.STEPS, "2026-07-01", "2026-10-29"): print(day.date, day.value) 

The parts I found hardest to get right, and that the library now handles:

  • Filters. Every data type uses a different AIP-160 filter field (steps.interval.start_time vs weight.sample_time.physical_time). You pass start/end; the right filter is built for you.
  • Range limits. Roll-ups are capped at 14 or 90 days. Longer ranges are split and pages are followed automatically.
  • Webhooks. Endpoint verification, shared-secret check, ECDSA signature verification against Google's published Tink keyset (with key rotation), batched notifications.
  • Auth. OAuth 2.0 with PKCE, refresh-token rotation, and a google-health login command for local scripts.

Sync and async clients, all 42 data types as a typed enum, retries that honour Retry-After. Python 3.9+, only httpx required.

pip install google-health google-health login --client-secrets client_secret_xxx.json google-health daily steps --days 7 

If you are migrating a Fitbit integration and something in your code doesn't map cleanly, please open an issue — those reports are the most useful thing right now.

GitHub: https://github.com/msavas2544/google-health · PyPI: https://pypi.org/project/google-health/