The Google Health Data API allows client applications to view and update Health content in the form of a Google Data API feed. Depending on the type of application you are developing (web or an installed application), your client can post new health data to a user's profile, edit or delete entries, request a list of existing entries, and query for specific health data that match a certain criteria.
This document is intended for developers looking to get started using the Google Health API. This document outlines the necessary steps to begin integration with Google Health.
To aid in development, Google Health offers a developer's sandbox called H9 (https://www.google.com/h9). We recommend first developing your application against H9 because it has fewer restrictions than the production version, Google Health (https://www.google.com/health). The differences between the two platforms are noted later on in this document.
Important: Your application can not interact with the production version of Google Health until you have first tested and integrated with the H9 developer's sandbox. To integrate with Google Health and become listed in the directory of available services to users, you must follow a set of guidelines for developing and deploying your application.
You must agree to and fill out API Terms of Service. In addition, please follow these guidelines for a successful integration:
The developer's sandbox (H9) uses normal Google Accounts, so if you already have a Google account, you're all set.
The H9 sandbox is located at https://www.google.com/h9.
Important: Throughout the Google Health Data API documentation, feed URIs, AuthSub parameters,
and inline code snippets reference /health. As a general rule of thumb, you should replace all instances of /health with /h9 in order to develop against the sandbox.
To help you get started, the sample applications found in the developer guides are set to work with H9.
There are a few important differences between Google Health and the H9 development sandbox. The table below should help to clarify the requirements for each platform.
| H9 Sandbox https://www.google.com/h9 | Google Health https://www.google.com/health | Comments | |
|---|---|---|---|
| Do API requests need to be digitally signed? | NO | YES | Also for testing purposes, the sandbox does not require the use of secure=1 AuthSub tokens.
You must
register your domain with both Google and Google Health. |
| Where should I request an AuthSub token from? | https://www.google.com/h9/authsub | https://www.google.com/health/authsub | Both Google Health and H9 use their own AuthSub handler to issue tokens. Note: The other Google Data APIs use /accounts/AuthSubRequest. |
Can I use http://localhost as AuthSub's next parameter? |
YES | NO | http://localhost has already been registered as a domain on /h9. On /health, you must
register your domain with both Google and Google Health and upload an X.509 certificate to sign requests. |
What is the value for AuthSub's scope parameter? |
https://www.google.com/h9/feeds/ | https://www.google.com/health/feeds/ | Both platforms require the scope parameter be for HTTPS (SSL). |
What is the service name for ClientLogin? |
weaver | health |
Whether you're developing on H9 or integrating with Google Health, accessing a data feed requires authentication. For detailed information on the different authentication methods see Authenticating to the Health service in the API's Protocol Guide.
Google Health requires using AuthSub in "Registered with enhanced security" mode. To obtain secure tokens and sign requests to Google Health, you must register your domain(s) and upload a public certificate.
http://localhost and secure=0 AuthSub tokens
to speed initial development. To migrate your app to Google Health, you must register the domain(s) with Google
and Google Health. These steps are also necessary if you want to test your H9 implementation with signed requests and/or use a domain other than http://localhost
as an AuthSub next URL.next parameter.
Each subdomain must be registered separately (e.g. if you plan to use both http://www.example.com and
http://dev.example.com for testing, these need to be enumerated).dev.example.com, the 'Target URL path prefix' should be set to http://dev.example.com/.Sample code can be found in the developer's guides for each language or by visiting the Libraries & Code page.
Google Health has partnered with Mt Tabor Online Services to create two applications to assist developers with Google Health integration:
| H9 Data Exchange: | https://h9demo.mttaboronline.com/ca |
| Google Health Data Exchange: | https://h9demo.mttaboronline.com/health/ |
Each tool requires you to create a separate account. Note, these accounts are separate from your Google Health account.
These applications demonstrate successful Google Health integration and permits developers to interact with Google Health services in a number of ways:
As an example of how to use this site with the Google Health platform, do the following:
Caution: Although these tools are hosted over SSL, you should only use test/development data.
https://www.google.com/health/feeds/ to interact with Google Health, https://www.google.com/h9/feeds/ to
interact with H9). The protocol is https.permission parameter on the Link Accounts page.
For example, permission=1 should be set if your application is reading a user's profile data.
For more troubleshooting tips, see the Google Health API FAQ.