How to take a single product from Merchante with Shopping Content API?

36 views
Skip to first unread message

Mattia Costola

unread,
Feb 20, 2024, 10:45:36 AM2/20/24
to Google Ads Scripts Forum
I have always used the Shopping Content API with Google Ads scripts to get the list of all products from the Merchant Center. Now I would like to get a single product via the id.
I see that there is a GET method available in the API that allows you to get a single product.

GET https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/products/{productId}

So I tried with this code to get the information of a product with a google ads script: const products = ShoppingContent.Products.get(MCID,ItemId) but it gives me this error: GoogleJsonResponseException: API call to content.products.get failed with error: [itemId] Invalid item id.

Do you have any ideas on how to get a single ID from the merchant center with a Google Ads script?

Thanks in advance
Reply all
Reply to author
Forward
0 new messages