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 (第 1 版):使用這個 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
重要事項:請勿在 Merchant API 的產品端點中使用 CSS 網域 ID,也不要在 CSS API 的產品端點中使用 Merchant Center ID。如果 API 使用的 ID 有誤,就會發生錯誤。
CSS API 和 Merchant API 會取代舊版的 Content API for Shopping (v2.1),請勿再使用舊版 API。
升級至 CSS API 的好處如下:
詳情請參閱「開始使用」一文。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-13 (世界標準時間)。
[null,null,["上次更新時間: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."]]