The Google Health API gives you access to user-submitted health and wellness
data. User profile information is available through the
getProfile endpoint but is
limited to metrics such as age and membership start date.
To get additional user profile information, you can use the
People API. You may need to request authorization for
additional scopes. For example, to read the user's birthday, you must include
https://www.googleapis.com/auth/user.birthday.read and
https://www.googleapis.com/auth/userinfo.profile in your authorization
request. For more information on People API authorization, see Authorize Requests.
For example, to get the user's birthday using People API:
Protocol
GET /v1/people/me?personFields=birthdays HTTP/1.1 Host: people.googleapis.com
Java
Person profile = peopleService.people().get("people/me") .setPersonFields("birthdays") .execute();
Python
profile = people_service.people() .get('people/me', personFields='birthdays')
PHP
$profile = $people_service->people->get( 'people/me', array('personFields' => 'birthdays'));
.NET
PeopleResource.GetRequest peopleRequest = peopleService.People.Get("people/me"); peopleRequest.PersonFields = "birthdays"; Person profile = peopleRequest.Execute();
Response
{ "resourceName": "people/115549...", "etag": "%EgQBBy43...", "birthdays": [ { "metadata": { "primary": true, "source": { "type": "DOMAIN_PROFILE", "id": "115549..." } }, "date": { "month": 1, "day": 1 } }, { "metadata": { "source": { "type": "ACCOUNT", "id": "115549..." } }, "date": { "year": 1990, "month": 1, "day": 1 } } ] }