user153742
user153742

Reputation: 377

How to get first name and last name by email address gmail.com?

I want to receive the first name and last name of the person by e-mail address. How can I do it? I thought to use the API from Google Plus, but Google is closing it. What other options are there?

Upvotes: 1

Views: 5222

Answers (1)

Jacque
Jacque

Reputation: 765

You can try using People API. The API has a people.get method which returns Resource: Person.

{
  "resourceName": string,
  "etag": string,
  "metadata": {
    object(PersonMetadata)
  },
  "locales": [
    {
      object(Locale)
    }
  ],
  "names": [
    {
      object(Name)
    }
  ],

  ...

  "emailAddresses": [
    {
      object(EmailAddress)
    }
  ],

  ...

}

The field names will return the object Name which contains the following fields:

{
  "metadata": {
    object(FieldMetadata)
  },
  "displayName": string,
  "displayNameLastFirst": string,
  "familyName": string,
  "givenName": string,
  "middleName": string,
  "honorificPrefix": string,
  "honorificSuffix": string,
  "phoneticFullName": string,
  "phoneticFamilyName": string,
  "phoneticGivenName": string,
  "phoneticMiddleName": string,
  "phoneticHonorificPrefix": string,
  "phoneticHonorificSuffix": string
}

Upvotes: 1

Related Questions