of Google Health API is the official successor to Fitbit Net API. It targets Google Well being API v4 and strikes builders to Google OAuth 2.0. It’s now referred to as the open supply CLI command-line device. ghealth Wrap that API for gadgets and AI brokers.
This device is a single Go binary underneath the Apache 2.0 license. Expose 40 validated knowledge sorts as structured JSON. This design permits sleep, coronary heart price, and step knowledge to be piped into the agent’s context.
What’s well being?
ghealth is a wrapper for Google Well being API v4. Construct from supply like this: go construct -o ghealth .. Ships as one self-contained binary.
This device is explicitly agent-first. All instructions return simplified JSON in a secure format. It additionally offers a definitive exit code. --dry-run flag and --raw Flag.
The repository comprises two agent abilities. SKILL.md file. One covers authentication, setup, and world flags. The opposite totally paperwork 40 knowledge sorts, operations, patterns, and concerns. Set up the agent as follows: npx abilities add.
The CLI is Google-Well being-API GitHub group. The group additionally hosts the long-standing Fitbit open supply repository.
Knowledge floor: 40 validated sorts
40 sorts, masking most Fitbit and Pixel Watch alerts. Examples embrace: steps, heart-rate, sleep, weight, oxygen-saturationand heart-rate-variability. Scientific sorts akin to: electrocardiogram want ecg.readonly vary.
Every sort helps a subset of operations. The frequent ones are checklist, rollup, daily-rollupand reconcile. writable sort (train, sleep, weight, body-fat, peak) addition create, replaceand delete.
of reconcile This operation merges duplicate knowledge factors from a number of sources. This mirrors the v4 API’s Reconciled Stream.
Sleep is an efficient instance of sample evaluation. default checklist Returns the abstract. addition --detail Returns knowledge for every stage (Awakening, Deep, REM). This can enable you to discover weekly patterns.
Setup: What truly occurs
Setup is executed with one command. ghealth setup. The wizard will information you thru GCP tasks and OAuth. Create a desktop-type OAuth consumer in Google Cloud Console.
Deliver your individual OAuth credentials. This device doesn’t preserve shared keys. The file will likely be written to ~/.config/ghealth/ File mode 0600. The token will likely be up to date routinely.
All Google Well being API scopes are labeled as restricted. Google requires a privateness and safety overview for entry to manufacturing environments. For private use, approve your individual tasks in your personal account. The API returns knowledge from Fitbit, Pixel Watch, and linked third-party sources.
Headless flows use PKCE with S256 challenges. Additionally verify random state Parameters upon completion.
Palms-on: Instructions and Output
Studying knowledge is constant throughout sorts. Every learn returns an object with the next rows: dataPoints.
# Current coronary heart price readings
ghealth knowledge heart-rate checklist --from right now --limit 10
# Every day step totals for per week
ghealth knowledge steps daily-rollup --from 2026-03-22 --to 2026-03-29
# Sleep phases for the final 5 nights
ghealth knowledge sleep checklist --limit 5 --detail
Step sum returns aggregated JSON.
{
"dataPoints": [
{"date": "2026-03-28", "countSum": "9037"},
{"date": "2026-03-27", "countSum": "2408"}
]
}
Output is simplified by default. use --raw For the unique API response. use --format csv or --format desk For different shapes. of -o flag writes a file and outputs a schema preview.
Pagination is lossless. massive checklist returns nextPageToken. you come it like --page-token Get the subsequent web page.
Utilization and examples
- Feed your sleep patterns to the agent: and pull a number of nights
--detail. Pipe the JSON to your code or codex session. Ask your agent to summarize their deep sleep traits over the previous week. - Load the exercise into pandas: run
ghealth knowledge train export-tcx --id <id> --output experience.csv --as csv. Every row is one trackpoint with coronary heart price and GPS. then runpd.read_csvon file. - Construct a resting coronary heart price view: question
daily-resting-heart-rateGreater than 30 days. Output CSV--format csv. Graph it in your pocket book or dashboard.
Find out how to evaluate ghealth
The desk under units ghealth For the uncooked API and the opposite two CLIs. The opposite two CLIs each determine themselves as unofficial.
| attribute | ghealth (this CLI) | Google Well being API v4 (direct REST) | Rudrankuriyam/Google-Well being-CLI | googlehealth-cli (npm) |
|---|---|---|---|---|
| set up | git clone + go construct |
None; name HTTP/gRPC your self | Construct from Go supply | npm i -g googlehealth-cli |
| language | Come on, single binary | Any | go | Node.js |
| certification | Proprietary OAuth consumer, PKCE S256 | Google OAuth 2.0 | Your personal OAuth consumer | Your personal OAuth consumer |
| Agent output | simplified JSON, exit code, SKILL.md |
Uncooked JSON/gRPC | Predictable JSON | secure --json envelope |
| knowledge sort | 40 verified in opposition to dwell APIs | full v4 floor | Monitor documented v4 surfaces | subset of sorts |
| official standing | No; communities throughout the Google-Well being-API group | sure; google | No; state unofficial | No; impartial state |
For uncooked management, the direct REST API is the bottom fact. For terminal and agent utilization, see ghealth Scale back authentication and formatting boilerplate.
interactive explainer
Please verify lipo. Please be at liberty to comply with us too Twitter Do not forget to affix us 150k+ML subreddit and subscribe our newsletter. cling on! Are you on telegram? You can now also participate by telegram.
Must accomplice with us to advertise your GitHub repository, Hug Face Web page, product launch, webinar, and so forth.? connect with us
Michal Sutter is a knowledge science skilled with a grasp’s diploma in knowledge science from the College of Padova. With a robust basis in statistical evaluation, machine studying, and knowledge engineering, Michal excels at remodeling complicated datasets into actionable insights.

