Google Shopping REST API restricting by Category

笑着哭i 提交于 2019-12-23 12:44:30

问题


I'm trying restrict Google Shopping Requests by a category (In this case, I only want actual Movies/DVDs/Blu-Rays returned)..

Here is what I am passing:

https://www.googleapis.com/shopping/search/v1/public/products?country=US&q=Terminator&key=MY_KEY

Where MY_KEY is the key I obtained from: https://code.google.com/apis/console/#project:396093783634:access

I would like my returned results to look more like this:

https://www.google.com/webhp?rlz=1C1CHFX_enUS459US459&sourceid=chrome-instant&ie=UTF-8&ion=1#q=terminator&hl=en&safe=off&rlz=1C1CHFX_enUS459US459&tbm=shop&source=lnt&tbs=cat:839&sa=X&ei=rMvKT9aqBoac2QXLn9HaCw&ved=0CDQQpwU&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&fp=8fc3a267521f95b1&ion=1&biw=1920&bih=955

What do I need to pass in as a parameter?


回答1:


From https://developers.google.com/shopping-search/v1/reference-request-parameters it looks like you could specify:

restrictBy=category=categoryName

but categoryName has to come from a provided taxonomy, and you can only provide a taxonomy if you're accessing Commerce Search, rather than the public product list. Google Shopping itself presumably has a default taxonomy built in, but the docs for the APIs suggest that that taxonomy isn't available to API users.

So: this isn't supported.

Edit: discussion thread where Google engineers confirm it's not presently supported



来源:https://stackoverflow.com/questions/10867464/google-shopping-rest-api-restricting-by-category

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!