Get started with Comparison Shopping Services (CSS)

Performing basic operations with the API is a good way to start using it.

Prerequisites

Before you start, complete the following:

  • Make sure that you have a valid CSS Center account.
  • Register an API developer.
  • Verify the correctness of your permissions setup.
  • Verify that you have enabled CSS API.
  • Verify that you have installed the client libraries for your environment.

For more information, see Quickstart.

Enable the CSS API

Register as a developer to use the CSS API, you must link your CSS Center account and your Google Cloud project using the Developer Registration method, as follows:

Link CSS Center and your Google Cloud project: The link is established automatically, as the caller has access to the Google Cloud project based on the Access token or API key, and is an authorized user of the CSS Center account.

Register an API developer

Add an API developer user to the CSS Center account: If a user already exists they will just be granted the new "API Developer" access type. In case of a new user, they receive a CSS Center email invite.

After registration you can view the Registration status using GetDeveloperRegistration or unregister using UnregisterGCP. You can use the following registration call:

POST https://merchantapi.googleapis.com/accounts/v1beta/accounts/{ACCOUNT_ID}/developerRegistration:registerGcp

{
      developer_email:"example-email@example.com"
}

After the request runs successfully, expect the response:

{
      "developerRegistration":
{
            "name": "accounts/ACCOUNT_ID/developerRegistration",
           "gcpIds": [
            "GOOGLE_CLOUD_PROJECT_ID"
        ]
    }
}

CSS products

Similar to the Products sub-API, CSS API distinguishes between CssProductInput and ListCssProduct. Insert a product with InsertCssProductInput.

Once our internal systems have processed the product (this can take a few minutes), retrieve it with ListCssProducts.

Identify your products using raw_provided_id. We recommend that you use an identifier you are already using in your own system. Alternately, common methods to create one include the use of one of the following:

  • Globally Unique Identifiers (GUIDs)
  • Universally Unique Identifiers (UUIDs)
  • Concatenated unique product attributes (for example, brand_model_color_size)

For more information, see Insert/List/Update/Delete a product.

Basic operations

Here are a few basic requests you can try.

  1. Insert a test product using InsertCssProductInput. For help on the attributes to send, review this sample code.

  2. List all your products using ListCssProducts. Note that there is a small processing delay between inserting a product and its appearance for listing. If you don't see one right away, try again after a few seconds.

  3. Update a single product using UpdateCssProductInput using your cssproductinput.name. You need to send only the attributes required to be updated. For an example, see the sample code.

  4. Delete the test product using DeleteCssProductInpu, supplying the raw_provided_id.

Limitations

Inserting or deleting an individual product can be slow. To improve performance, Use Async to improve performance. This enables calling the API in parallel.

List and label your accounts

Label Management in CSS API lets you programmatically organize your client Merchant Center accounts using custom tags. This feature helps you efficiently categorize clients (for example, by type or strategy), enabling better organization and streamlined operations. You can use the API to perform the following functions on labels: