How to look up user information from Google GAIA ID?

IMPORTANT UPDATE

March 2019: This answer is still getting up votes, however Google are withdrawing / have withdrawn the Google Plus API.

You will need an alternative solution as this will no longer apply.

Original Reply

Use the Google Plus API: https://developers.google.com/+/api/

I've not tested specifically with Hangouts (I never knew there was a Hongouts API!) but it returns details given IDs from other APIs.

You can test it out here: https://developers.google.com/apis-explorer/#p/plus/v1/plus.people.get to see what you'll get.


The Gaia ID may be obtained with the People API, by requesting the metadata in the personFields.

You may try it with the Google APIs Explorer (sample links are provided below).


For any of your contacts (provided he/she is a google user), using the people.connections/list resource :

People API - people.connections/list - personFields=names,metadata (I have included the names value in the personFields for better illustration, though it is not required to retrieve the Gaia Id)

Sample output (1XXXXXXXXXXXXXXXXXXXX is the Gaia Id):

{
  "connections": [
    {
      "resourceName": "people/c42",
      "etag": "...",
      "metadata": {
        "sources": [
          {
            "type": "CONTACT",
            ...
          },
          {
            "type": "PROFILE",
            "id": "1XXXXXXXXXXXXXXXXXXXX",
            ...
            "profileMetadata": {
              "objectType": "PERSON",
              "userTypes": [
                "GOOGLE_USER"
              ]
            }
          }
          ....
        ],
        "objectType": "PERSON"
      }
      "names": [
        {
          ...
          "displayName": "John Doe",
          ...
        }
      ]
    },
    ...
}

For yourself or any user using the people/get resource

People API - people/get - personFields=metadata

In the resourceName field :

  • use people/me to obtain your informations.
  • use the resourceName value previously retrieved in a people.connections.list request to retrieve another user informations

Sample output (1XXXXXXXXXXXXXXXXXXXX is the Gaia Id):

{
  "resourceName": "people/...",
  "etag": "....",
  "metadata": {
    "sources": [
      {
        "type": "PROFILE",
        "id": "1XXXXXXXXXXXXXXXXXXXX",
        "etag": "...",
        "profileMetadata": {
          "objectType": "PERSON",
          "userTypes": [
            "GOOGLE_USER"
          ]
        }
        ...
      },
     ...
    ],
    "objectType": "PERSON"
  }
}