Google API: how to get email address


Step 1: enable Google People API here

Step 2: use scopes:

email profile https://www.googleapis.com/auth/plus.login

Step 3:

HTTP request:

GET https://people.googleapis.com/v1/people/account_id

or

GET https://people.googleapis.com/v1/people/me

Query parameters:

personFields=emailAddresses

Response Example:

{
  "resourceName": "people/116566999726909241857",
  "etag": "%EgUBCT43LhoMAQIDBAUGBwgJCgsMIgxDUmw5bXpHNERzST0=",
  "emailAddresses": [
    {
      "metadata": {
        "primary": true,
        "verified": true,
        "source": {
          "type": "ACCOUNT",
          "id": "116566999726909241857"
        }
      },
      "value": "tutorialspots.com@gmail.com"
    }
  ]
}

Leave a Reply