rocket
认识一下
Merchant API
- Content API for Shopping 的正式替代产品。
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。
自动设置步骤
不适用于此流程。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):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 access your own Merchant Center account using service accounts or access other merchants' accounts via OAuth.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication can be tested using Shopping samples that support both service account and OAuth2 client authentication, utilizing the Content API client libraries or 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."]]