怎么调用 Google 购物 关键词搜索 API?
search使用 platform="google_shopping"、action="search" 调用“关键词搜索”能力;返回列表,默认 20 条、单次最多 100 条,主要包含 rank、title、product_id、offer_id、image_id、price_text 等 17 个字段。
Google 购物 search 的参数分别是什么意思?
keyword必填- 商品搜索词(如 wireless earbuds)。
country可选- 按哪个国家的 Google 购物搜,两位国家代码(如 us、gb、de),默认 us;价格的货币跟着它。
language可选- 结果语言,两位语言代码(如 en、de),默认 en。
max_price可选- 最高价,不低于 min_price。
min_price可选- 最低价,按 country 的货币,不小于 0。
Google Merchant Center 的商品数据规范说明商家提交的商品要带标题、价格(price)和可选的促销价(sale_price)等属性,Google 用这些数据把商品匹配到搜索。这里只确认 Google 购物上的价格来自商家提交的商品数据、有原价和促销价之分;本接口的 min_price、max_price 按搜索国家的货币筛选结果,由 EveryInfra 定义,该来源不证明筛选效果或结果条数。官方来源:Google Merchant Center:商品数据规范里的价格与促销价来源核查:
sort可选- 排序:price_low(价格从低到高)、price_high(从高到低)、rating(评分从高到低);不填按相关度。
Google 购物 返回字段与含义(12)
- rank
- 该商品在这次搜索结果里的名次,从 1 开始。
- product_id
- Google 购物的商品聚合 ID(纯数字),同一款商品各商家的报价归在它下面;个别结果没有。
- offer_id
- 这一行展示的那个商家报价的 ID(纯数字)。
- image_id
- 这一行主图的 ID(纯数字)。
- price_text
- 价格原文,带货币符号和当地写法(如 $29.99、Rp 419.000)。
- price
- price_text 解析出的数值,货币按搜索的国家(country);不带货币单位。
- old_price_text
- 划线原价原文;没有打折就不出现。
- old_price
- old_price_text 解析出的数值。
- merchant
- 这一行报价的商家名。
- multiple_merchants
- 是否有多个商家卖这款商品(true 时 Google 购物页上能比价)。
- rating
- 商品评分,1–5。
- review_count
- 商品评价数。