update
取得最新資訊
,瞭解 Merchant API 的新功能、錯誤修正和版本更新。
設定 Content API 存取權
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
摘要
如要以指定 Merchant Center 帳戶使用 Content API for Shopping,您必須設定 API 控制台專案。API 控制台專案可協助您管理 Content API 解決方案的 API 存取權及驗證。
手動步驟
有兩種方式可以驗證使用 Content API for Shopping,視您需要存取的商家帳戶而定:
- 存取自己的 Merchant Center 帳戶
- 如果只需存取自己的帳戶和子帳戶,若使用多重客戶帳戶,則建議使用服務帳戶。如要瞭解透過 Merchant Center 建立服務帳戶的步驟,請參閱「服務帳戶」指南。
- 存取其他商家的帳戶
- 如果您打算以第三方的身分管理其他 Merchant Center 帳戶,請參閱 OAuth 指南。
取得適當的驗證權杖後,您就可以使用購物範例測試驗證設定,這些範例同時支援服務帳戶和 OAuth2 用戶端驗證。這些範例使用 Content API 用戶端程式庫,如果您使用支援的語言,建議您在應用程式中使用。或者,您可以直接使用 REST API。
自動步驟
不適用於這項程序。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間:2025-08-31 (世界標準時間)。"],[[["\u003cp\u003eTo use the Content API for Shopping, you need to set up an API Console project for API access and authentication.\u003c/p\u003e\n"],["\u003cp\u003eYou can authenticate using service accounts for accessing your own Merchant Center account or OAuth for managing other merchants' accounts.\u003c/p\u003e\n"],["\u003cp\u003eFor testing and development, Google provides Shopping samples and client libraries for easier integration with the Content API.\u003c/p\u003e\n"],["\u003cp\u003eIf your programming language isn't supported by the client libraries, you can directly use the REST API.\u003c/p\u003e\n"]]],[],null,["# Set up Content API access\n\nSummary\n-------\n\nTo use the Content API for Shopping with a given Merchant Center account, you\nmust set up an [API Console](https://console.developers.google.com) project. API Console projects help you manage API\naccess and authentication for your Content API solution.\n\nManual steps\n------------\n\nThere are two ways you can authenticate to use the Content API for Shopping\ndepending on whose merchant accounts you need to access:\n\nAccess your own Merchant Center account\n: If you only need to access your account (and sub-accounts, if using a\n multi-client account), then we suggest using service accounts. See the\n [Service accounts](/shopping-content/guides/how-tos/service-accounts) guide for the steps to create a service account from the\n [Merchant Center](https://merchants.google.com).\n\nAccess other merchants' accounts\n: If you plan to manage other Merchant Center accounts as a third-party, see the\n [OAuth](/shopping-content/guides/how-tos/authorizing) guide.\n\nOnce you have the appropriate authentication tokens, you can test your\nauthentication setup with the [Shopping samples](https://github.com/googleads/googleads-shopping-samples), which support both service\naccount and OAuth2 client authentication. These samples use the\n[Content API client libraries](/shopping-content/guides/libraries), which we recommend using in your own\napplications if you're using a supported language. Otherwise, you can use the\n[REST API](/shopping-content/reference/rest/v2.1) directly.\n\nAutomatic steps\n---------------\n\nNot available for this process."]]