CSS API 概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
您可以使用 CSS API 管理您的 CSS 并控制您的 CSS 产品组合。
CSS API 是对 Content API for Shopping 中 CSS 功能的重新设计。
CSS API 与 Merchant API 的对比
了解 CSS API 和 Merchant API 之间的区别是有效管理商品的关键。每种 API 的用途各不相同,并且适用于不同的账号类型和 ID 空间:
CSS API (v1):使用此 API 可实现与管理 CSS 账号及其关联的 CSS 商品相关的所有功能。此 API 使用 css.googleapis.com
主机名,并且需要 CSS 网域 ID 才能执行商品操作。
- 示例:
POST https://css.googleapis.com/v1/accounts/{cssDomainId}/cssProductInputs:insert
Merchant API
(v1):使用此 API 可实现与标准 Merchant Center 账号及其商品相关的所有功能。此 API 使用 merchantapi.googleapis.com
主机名,并且需要标准 Merchant Center ID。
- 示例:
POST https://merchantapi.googleapis.com/v1/accounts/{merchantId}/productInputs:insert
重要提示:请勿将 CSS 网域 ID 与 Merchant API 的商品端点搭配使用,也请勿将 Merchant Center ID 与 CSS API 的商品端点搭配使用。如果 API ID 使用不当,会导致出现错误。
CSS API 和 Merchant API 共同取代了旧版 Content API for Shopping (v2.1),后者不应再使用。
以下是升级到 CSS API 的一些原因:
如需了解详情,请参阅入门指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-13。
[null,null,["最后更新时间 (UTC):2025-08-13。"],[[["\u003cp\u003eThe CSS API enables managing CSS and controlling your CSS Products portfolio.\u003c/p\u003e\n"],["\u003cp\u003eThe CSS API offers new features, improved alignment with Google's API improvement proposals, and updated documentation and samples.\u003c/p\u003e\n"],["\u003cp\u003eUpgrading from the Content API for Shopping to the CSS API is recommended.\u003c/p\u003e\n"]]],[],null,["# CSS API overview\n\nYou can use the CSS API to manage your CSS and control your CSS Products\nportfolio.\n\nThe CSS API is a redesign of the CSS features in [Content API for\nShopping](/shopping-content).\n\nCSS API versus Merchant API\n---------------------------\n\nUnderstanding the distinction between the CSS API and the Merchant API is key\nto effectively managing your products. Each API serves a different purpose and\noperates on different account types and ID spaces:\n\n- **CSS API (v1):** Use this API for all functionalities related to managing\n CSS accounts and their associated CSS products. This API uses the\n `css.googleapis.com` hostname and requires a **CSS Domain ID** for product\n operations.\n\n - Example: `POST https://css.googleapis.com/v1/accounts/{cssDomainId}/cssProductInputs:insert`\n- **[Merchant API](https://developers.google.com/merchant/api/overview)\n (v1):** Use this API for all functionalities related to\n standard Merchant Center accounts and their products. This API uses the\n `merchantapi.googleapis.com` hostname and requires a standard **Merchant\n Center ID**.\n\n - Example: `POST https://merchantapi.googleapis.com/v1/accounts/{merchantId}/productInputs:insert`\n\n**Key takeaway:** Don't use a CSS Domain ID with the Merchant API for product\nendpoints, and don't use a Merchant Center ID with the CSS API product\nendpoints. Using the wrong ID with the wrong API will result in errors.\n\nThe CSS API and Merchant API together replace the older Content API for Shopping\n(v2.1), which should no longer be used.\n\nHere are some reasons to upgrade to the CSS API:\n\n- New features.\n- Improved alignment with Google's [API improvement proposals](//google.aip.dev/).\n- Updated documentation and [samples](/comparison-shopping-services/api/code-samples).\n\nSee [Get started](/comparison-shopping-services/api/guides/quickstart) for more\ninformation."]]