How to get contacts from gmail account?

1.3k Views Asked by At

Previously i was using following service to get my contacts from my Gmail account. https://github.com/google/gtm-oauth2 But this API uses embedded browser to login and it will going to deprecated in short time.

Now, i need to use new way to authorise use and contacts from gmail account. I'm able to login in Google account through following service. https://github.com/google/GTMAppAuth

But by using this service, i'm not able to get Contacts from my gmail account. Can anyone help me out to get rid on this issue?

2

There are 2 best solutions below

0
pejowei On

For gmail contacts, I have been using python to access the people API.

Google provides an apiclient and oauth2client to manage the entire application flow.

https://developers.google.com/people/quickstart/python

Once you have retrieved credentials, you can call the people service

https://developers.google.com/people/api/rest/

In python, you could try method results =

service.people().connections().list(resourceName='people/me', pageSize=10).execute()

connections = results.get('connections', [])

2
Mehul Solanki On

Thanks for looking for this issue. After digging more with below services i got solution.

It is giving everything just we need to read carefully. They also giving good sample project which serve everything what we need.