如何通过Google REST API获取好友的Google+个人资料数据?
Hey there, let's break this down clearly since Google's API landscape has shifted a lot with the deprecation of Google+.
The Core Challenge
First, let's address the hard truth: Google has fully deprecated the Google+ API's friend-listing endpoints (like the list method you referenced), and there's no official, supported way to fetch a list of Google+ friends' user IDs anymore. Google+ social graph data is no longer maintained or accessible via public APIs, so that direct path to get friend IDs is gone for good.
What You Can Do If You Have Existing Friend IDs
If you previously stored your friends' Google+ user IDs before the API deprecation, you can still retrieve their profile data using the People API (skip the old Google+ API entirely—it's being phased out completely). Here's how to approach it:
- Use the
people.getmethod, targeting the user ID in the formatpeople/{user-id}. - Specify the exact fields you need in the
personFieldsparameter to avoid unnecessary data:- For names: Include
names - For profile photos: Include
photos - For emails: You'll need the OAuth scope
https://www.googleapis.com/auth/plus.profile.emails.readand includeemailAddressesin the fields
- For names: Include
- Example curl request (replace placeholders with your actual token and user ID):
curl \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ "https://people.googleapis.com/v1/people/USER_ID?personFields=names,photos,emailAddresses"
Alternatives If You Don't Have Friend IDs
Since you can't fetch new Google+ friend IDs anymore, here are the closest practical workarounds:
- People Contact API: As you noted, this returns your Google Contacts, not Google+ friends. If your users manually added their Google+ friends to their contacts, there might be overlap, but it's not a replacement for the old Google+ social graph.
- Shift to Other Social Platforms: For new user onboarding, you can integrate APIs from other social platforms if your app supports them, but there's no Google-backed equivalent to the old Google+ friend list functionality.
Key Reminders
- Always use the latest People API instead of the deprecated Google+ API—Google has stated remaining Google+ endpoints will be shut down entirely soon.
- Stick to minimal, necessary OAuth scopes to comply with Google's data privacy policies and avoid authorization issues.
内容的提问来源于stack exchange,提问作者Carmoreno

