Fitbit Air Export
A small, free Python script that copies your own Fitbit data (sleep, resting heart rate, heart rate variability, blood oxygen, steps, active minutes) from Google to plain files on your computer: one JSON file per day, plus a CSV and a Markdown table. It is for people who keep a journal or notes and want their numbers next to them.
What it does
- Reads, never writes. It asks Google for read-only access to your sleep, activity and health-metric data.
- Runs on your computer only. There is no server and no account with us. Data goes from Google straight to a folder you choose.
- You own the connection. You create your own Google Cloud project and sign-in client, so the only party involved is you.
- Built for the Google Health API, which replaced the Fitbit Web API in 2026. Works with the Fitbit Air and other Fitbit devices on a Google account.
Setup, once
- Sign in to the Google Health (Fitbit) app on your phone with your Google account.
- In the Google Cloud console, create a project and enable the Google Health API.
- Under Google Auth Platform: set up the consent screen (External), add yourself as a test user, and on
Data Access add the scopes
googlehealth.sleep.readonly,googlehealth.activity_and_fitness.readonlyandgooglehealth.health_metrics_and_measurements.readonly. - Create an OAuth client of type Desktop app, download its JSON, and save it as
~/.google-health/client_secret.json. - Run
python fitbit_export.py authand approve access in the browser.
While your Google project is in "Testing", Google expires the sign-in after 7 days, so you'd run
auth again weekly. Publishing your own project removes that.
Daily use
python fitbit_export.py # last 3 days into ./fitbit-data python fitbit_export.py --days 30 # backfill python fitbit_export.py --out ~/notes/fitbit
Schedule it (Task Scheduler, cron, launchd) for an hour or two after you usually wake, once your phone has synced. It re-pulls the last three days each run, so a late sync fills itself in.