準備使用 People API
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
在開始編寫第一個用戶端應用程式之前,您需要先完成以下三項操作:
- 建立 Google 帳戶
- 建立專案
- 設定應用程式
如果您尚未完成這些工作,本指南將引導您完成所有步驟。
1. 建立 Google 帳戶
您必須具備 Google 帳戶,才能在 Google API 控制台中建立專案。如果您已經有帳戶,就大功告成了!您可能也想要使用另一個 Google 帳戶進行測試。
2. 為用戶端建立專案
您必須先向 Google 告知用戶端並啟用 API 的存取權,才能向 People API 傳送要求。如要這麼做,請使用 Google API 控制台建立「專案」,專案的名稱是具名的集合和 API 存取權資訊,並註冊應用程式。
如要開始使用 People API,請先使用設定工具;這項工具會逐步引導您在 Google API 控制台中建立專案、啟用 API,並建立憑證。
3. 設定應用程式
如果您使用其中一種支援的語言,請考慮使用其中一個用戶端程式庫。您必須先設定授權,才能向 API 發出要求。
查看快速入門程式碼範例,其中示範如何擷取多種語言的聯絡人清單。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[[["\u003cp\u003eTo begin coding your client application, you must first obtain a Google Account, create a project in the Google API Console, and set up your app.\u003c/p\u003e\n"],["\u003cp\u003eCreating a project involves informing Google about your client and activating API access using the Google API Console, where you can register your application and manage settings.\u003c/p\u003e\n"],["\u003cp\u003eBefore making requests to the API, ensure you've set up authorization and consider utilizing client libraries if your language is supported.\u003c/p\u003e\n"]]],["To start coding, you must first obtain a Google Account. Then, use the Google API Console to create a project, which involves registering your application and enabling API access via the setup tool. Finally, set up your application, potentially using a client library and ensuring proper authorization before making API requests. Sample code is available to demonstrate fetching a list of contacts in various languages.\n"],null,["# Get Ready to Use the People API\n\nBefore you can start coding your first client application, you need to do three\nthings:\n\n1. Get a Google Account\n2. Create a project\n3. Set up your app\n\nThis guide walks you through those tasks, if you haven't done them already.\n\n1. Get a Google Account\n-----------------------\n\nYou need a [Google Account](https://www.google.com/accounts/NewAccount) in order\nto [create a project](#project) in the Google API Console. If you already have\nan account, then you're all set. You may also want a separate Google Account for\ntesting purposes.\n\n2. Create a project for your client\n-----------------------------------\n\nBefore you can send requests to the People API, you need to tell Google\nabout your client and activate access to the API. You do this by using the Google API Console to create a project, which is a named collection of\nsettings and API access information, and register your application.\n\nTo get started using People API, you need to first\n[use\nthe setup tool](https://console.cloud.google.com/start/api?id=people.googleapis.com&credential=client_key), which guides you through creating a project in the\nGoogle API Console, enabling the API, and creating credentials.\n\n3. Set up your app\n------------------\n\nIf you are using one of the supported languages, consider using one of the\n[client libraries](/people/v1/libraries). Before you can make requests to the\nAPI, you must set up [authorization](/people/v1/how-tos/authorizing).\n\nTake a look at the\n[quick start sample code](https://developers.google.com/people/quickstart/js)\nwhich shows you how to fetch a list of contacts in a variety of languages."]]