Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Adding price as a search facet in Google retail API

Hi Community,

I was doing a POC for implementing google retail api for search in my project. I used the default produts json that they provide and i tried to search the products, but it seems like i cannot add price as a facet or provide in the search query. 

Does anyone has any suggestions how to add the price of the product as a search facet?

Any help is appreciated.

0 2 453
2 REPLIES 2

Aris_O
Former Googler

Hi @HitendraRathor,

Welcome to Google Cloud Support.

You must set up the price attribute as a facet in your product feed in order to add price as a facet to your Google Retail API search. You can take the following actions:

1. Include a `price` attribute as a new field in your product feed.

2. Add the `price` attribute to the facetable_attributes field in your product type declaration to configure it as a facet.

3. Send Google Merchant Center the new product feed.

The price property will be a facet in your Google Retail API search after you have finished these steps. Then, by including it in the `filter` parameter, you can use it in your search query.

Thanks for the help, in place of facetable attribute, used it as retrivable attributes and it worked.