You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Google REST API获取好友的Google+个人资料数据?

How to Retrieve Google+ Profile Information for Friends

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.get method, targeting the user ID in the format people/{user-id}.
  • Specify the exact fields you need in the personFields parameter 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.read and include emailAddresses in the fields
  • 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 08:17:29