Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to look up user information from Google GAIA ID?

I've been working on a Hangouts.json parser for Google's Takeout service that takes all of the conversations, attachments, and miscellaneous information from the json file and populates a database with everything. I've finished everything but the only information the json file provides for who sent what is a GAIA ID that I've been able to figure out is the unique ID Google uses between their services. The problem is I don't know how to look up any other information about the user such as the name they identify with or their email.

I know most of the information is publicly available as you can take the GAIA ID and put it into a URL like: https://plus.google.com/u/0/#####################/about where the #'s are the GAIA ID. This page will reveal their screen name publicly. When a email address is unknown the same thing can be inferred by using: reply-#####################@profiles.google.com where this will also be able to be used to contact them.

Ideally I'd like to be able to look up a user's screen name without having to parse that public Google+ page at least but a true email would be great as well. So ideally I'd like an API or other resource to look up screen names and / or email info from a GAIA ID.

like image 726
rfoo Avatar asked Nov 19 '14 22:11

rfoo


2 Answers

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.

like image 83
Robbie Avatar answered Sep 18 '22 07:09

Robbie


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"
  }
}
like image 27
Olivier Avatar answered Sep 19 '22 07:09

Olivier