Performance best practices

  • Uploading many products can be slow due to the time required per operation.

  • Calling the CSS API in parallel is the recommended solution to speed up product uploads.

  • Parallel calls allow simultaneous uploads of multiple products, reducing overall time.

  • Although not directly supported, batch operations are possible for direct HTTP calls using the Google API default batch feature.

Uploading products takes a certain amount of time per operation. If you need to upload many products in a short timeframe, this could cause the process to seem slow.

Our recommended solution is to call the CSS API in parallel.

Parallel calls

To speed up the upload process, we recommend using parallel calls to upload multiple products simultaneously. This can significantly reduce overall upload time. Use the features appropriate for your programming language.

For Java, use the asynchronous version within a parallel executor:

ApiFuture<CssProductInput> future =
  cssProductInputsServiceClient.insertCssProductInputCallable().futureCall(request);

Additional information can be found in the Merchant API documentation for concurrent requests

Bulk / Batch operations

While bulk and batch operations aren't supported directly in the CSS API, if you are calling the API directly using HTTP you can use the Google API default batch feature.

For detailed instructions on how to format batch requests, refer to the Merchant API documentation for batch requests.

Limits

Batch requests have the following limits:

  • 2,000 nested requests per batch request.

If a batch request exceeds any of these limits, the API returns a 400 Bad Request error and rejects the entire request.