关于 google-shopping
google-shopping 是基于 Apify 的 Google Shopping 商品搜索服务,面向开发者和 AI 工作流。它以结构化数据返回商品、商家、价格、评分和配送信息,并提供筛选与本地化选项。
主要功能
- 01搜索 Google Shopping 商品列表
- 02按价格、促销和配送筛选
- 03按价格排序结果
- 04返回商家、价格、评分和配送数据
- 05按地点、国家和语言本地化
适用场景
- 01比较不同商家的价格
- 02追踪折扣商品
- 03监测竞争对手的商品列表
- 04为 AI 工作流收集商品数据
MCP 相关
通过 Apify 托管的 MCP 服务提供 Google Shopping Actor,供 MCP 客户端搜索并获取商品列表。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://mcp.apify.com/?tools=johnvc/google-shopping-api-google-shopping-products-prices-dealsclaude mcp add --transport http johnisanerd-google-shopping https://mcp.apify.com/?tools=johnvc/google-shopping-api-google-shopping-products-prices-deals{"mcpServers":{"johnisanerd-google-shopping":{"type":"http","url":"https://mcp.apify.com/?tools=johnvc/google-shopping-api-google-shopping-products-prices-deals"}}}在 Cursor 中打开{"servers":{"johnisanerd-google-shopping":{"type":"http","url":"https://mcp.apify.com/?tools=johnvc/google-shopping-api-google-shopping-products-prices-deals"}}}在 VS Code 中打开{"mcpServers":{"johnisanerd-google-shopping":{"type":"http","url":"https://mcp.apify.com/?tools=johnvc/google-shopping-api-google-shopping-products-prices-deals"}}}{"mcpServers":{"johnisanerd-google-shopping":{"serverUrl":"https://mcp.apify.com/?tools=johnvc/google-shopping-api-google-shopping-products-prices-deals"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
🛍️ Google Shopping API:以简洁的 JSON 获取商品、价格和优惠
高效、可靠且对开发者友好的 Google Shopping API 使用方式。
Actor 页面: apify.com/johnvc/google-shopping-api-google-shopping-products-prices-deals 输入架构: apify.com/johnvc/google-shopping-api-google-shopping-products-prices-deals/input-schema
Google Shopping API 会针对查询返回 Google Shopping 商品列表,并以简洁、结构化的 JSON 呈现:标题、商家来源、当前价格和原价、评分、评论数、促销标签、配送条款以及商品 ID。可按价格区间、排序方式、免运费和促销状态筛选,也可按国家、语言和 Google 域名进行本地化。专为比价、优惠追踪、竞争监控和 AI Agent 工作流打造。
视频演示
快速开始
前提条件
- Python 3.11 或更高版本
- Apify 账户和 API 密钥(在此免费获取密钥)
-
克隆仓库
git clone https://github.com/johnisanerd/Apify-Google-Shopping-API.git cd Apify-Google-Shopping-API -
使用 UV 安装依赖
# Install UV if you do not have it: curl -LsSf https://astral.sh/uv/install.sh | sh # Install project dependencies: uv sync -
配置 API 密钥
cp .env.example .env # Edit .env and add your Apify API key # Get your free API key at: https://apify.com?fpr=9n7kx3 -
运行示例
uv run python google-shopping-api-example.py
替代方式:直接设置 API 密钥
export APIFY_API_TOKEN="your_api_key_here"
uv run python google-shopping-api-example.py
为什么使用此 Google Shopping API?
跨商家的价格。 获取 Google Shopping 针对查询展示的商品,每件商品都包含商家来源、当前价格,以及打折时的原价。
内置优惠信号。 促销标签(例如 16% OFF)、原价和促销筛选器,让优惠追踪变得简单直接。
评分和配送信息。 每条商品信息都包含评分、评论数和配送条款,因此排序时可以综合考虑价格以外的因素。
灵活筛选。 使用 min_price 和 max_price 缩小范围,按价格排序,并筛选免运费或促销商品。
支持本地化。 可按 location、国家(gl)、语言(hl)和 Google 域名指定目标,还可模拟桌面端、平板或移动设备。
费用可预测,按使用量计费。 按处理的页面计费(每页约 40 件商品),另收取少量单次运行费用。
功能
核心功能
- 商品搜索,支持价格区间、排序、免运费和促销筛选
- 每件商品均包含商家来源、当前价格、原价和促销标签
- 评分、评论数和配送条款
- 按地点、国家、语言和 Google 域名进行本地化
- 支持分页,并可配置页数上限
数据质量
- 每页对应一个条目,每个条目包含一个
shopping_results数组 - 提供格式化的
price和数值型extracted_price - 商品打折时提供促销字段(
old_price、tag) - 返回每页可用的筛选项
filters
使用示例
基本搜索
{
"q": "wireless headphones",
"max_pages": 1
}
价格区间、促销商品,按价格从低到高排序
{
"q": "4k monitor",
"min_price": 200,
"max_price": 500,
"on_sale": true,
"sort_by": 1
}
输入参数
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
q | str | 是 | - | 要搜索的产品或关键词,例如 wireless headphones。 |
location | str | 否 | - | 地理位置,例如 Austin, Texas, United States。 |
gl | str | 否 | - | 国家/地区代码,例如 us、uk、de。 |
hl | str | 否 | - | 语言代码,例如 en、es。 |
google_domain | str | 否 | google.com | Google 域名,例如 google.co.uk。 |
device | str | 否 | desktop | desktop、tablet 或 mobile。 |
min_price | number | 否 | - | 仅显示价格高于此值的产品。 |
max_price | number | 否 | - | 仅显示价格低于此值的产品。 |
sort_by | int | 否 | - | 1 表示价格从低到高,2 表示从高到低;留空表示按相关性排序。 |
free_shipping | bool | 否 | false | 仅显示免运费的产品。 |
on_sale | bool | 否 | false | 仅显示促销或折扣产品。 |
max_pages | int | 否 | 1 | 要获取的页面数(每页约 40 件产品);0 = 不限。每页都会计费。 |
输出格式
wireless headphones 的真实结果(每页一项;shopping_results 已精简为单个产品,filters 列出可用的筛选条件)。
{
"search_parameters": { "q": "wireless headphones", "device": "desktop", "max_pages": 1 },
"search_metadata": { "results_count": 40, "pages_processed": 1, "max_pages_set": 1, "pagination_limit_reached": true },
"page_number": 1,
"shopping_results": [
{
"position": 1,
"title": "JLab Studio 2 Wireless Headphones",
"product_id": "13340055750063076763",
"source": "Target",
"price": "$24.99",
"extracted_price": 24.99,
"old_price": "$30",
"rating": 4.6,
"reviews": 727,
"tag": "16% OFF",
"delivery": "Free delivery on $35+"
}
],
"filters": [ { "input_type": "link_with_icon", "options": [ "..." ] } ]
}
每个页面项都会回显 search_parameters,报告 search_metadata(结果数量和已处理页面数),并在 shopping_results 中列出每件产品的排名、标题、商家 source、格式化价格和数值价格、可选促销字段(old_price、tag)、评分、评价数、配送条款以及 product_id。filters 数组会返回 Google 为该查询提供的筛选条件。
用作 MCP 工具
你可以将 Google Shopping API 加载为 MCP 工具,让助手代你调用。MCP 服务 URL 仅预加载此 Actor:
https://mcp.apify.com/?tools=actors,docs,johnvc/google-shopping-api-google-shopping-products-prices-deals
在浏览器中按提示通过 OAuth 验证,或使用 Apify API token(与 Python 示例中使用的 APIFY_API_TOKEN 相同)进行验证。可在 https://console.apify.com/settings/integrations 获取 token,并在 https://apify.com?fpr=9n7kx3 注册免费的 Apify 账户。
在 Claude Cowork Desktop 中安装

Cowork 是桌面应用的自动化模式。要将 Google Shopping API 作为工具提供给它,请将 Apify MCP 服务添加为连接器。
- 打开 Claude 桌面应用并前往 Settings → Connectors(或前往 Settings → Developer → Edit Config,直接编辑
claude_desktop_config.json)。- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- 添加 Apify MCP 服务,并仅预加载此 Actor:
{
"mcpServers": {
"apify": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.apify.com/?tools=actors,docs,johnvc/google-shopping-api-google-shopping-products-prices-deals"
]
}
}
}
- 重启应用。Cowork 首次调用工具时,请在浏览器中完成 OAuth 提示,或在连接器设置中添加 Apify API token 以跳过 OAuth。
- 在 Cowork 聊天中,确认工具可用,并让它运行 Google Shopping API。
下载桌面应用并开始免费试用:https://claude.ai/referral/uIlpa7nPLg 更多帮助:https://docs.apify.com/platform/integrations/claude-desktop
在 Claude Code 中安装

Claude Code 是命令行工具。使用一条命令添加 Actor 的 MCP 服务:
claude mcp add --transport http apify \
"https://mcp.apify.com/?tools=actors,docs,johnvc/google-shopping-api-google-shopping-products-prices-deals"
要使用 token 而非浏览器 OAuth:
claude mcp add --transport http apify \
"https://mcp.apify.com/?tools=actors,docs,johnvc/google-shopping-api-google-shopping-products-prices-deals" \
--header "Authorization: Bearer YOUR_APIFY_TOKEN"
然后使用 claude mcp list 验证,或在会话中运行 /mcp。让 Claude Code 调用 Google Shopping API。
免费试用 Claude Code:https://claude.ai/referral/uIlpa7nPLg Claude Code MCP 文档:https://code.claude.com/docs/en/mcp
在 Claude(网站)中安装

在 claude.ai 上,将 Apify 添加为连接器,然后仅启用此 Actor 的工具。
- 前往 Settings → Connectors → Browse connectors,搜索 Apify MCP server。安装它(如有提示,请启用或更新)。
- 连接时,使用你的 Apify API 令牌进行身份验证,并启用工具
johnvc/google-shopping-api-google-shopping-products-prices-deals。 - 在任意聊天中,打开 + → Connectors,然后开启 Apify。
- 你也可以选择 Add custom connector,粘贴完整的 MCP URL
https://mcp.apify.com/?tools=actors,docs,johnvc/google-shopping-api-google-shopping-products-prices-deals,并在提示时使用 OAuth。 - 让 Claude 运行 Google Shopping API。
在网页上打开 Claude:https://claude.ai/referral/uIlpa7nPLg
在 Cursor 中安装

Cursor 从项目文件 .cursor/mcp.json 中读取 MCP 服务。
- 在项目中创建
.cursor/mcp.json:
{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com/?tools=actors,docs,johnvc/google-shopping-api-google-shopping-products-prices-deals"
}
}
}
- 如果你更倾向于使用令牌身份验证,而不是浏览器 OAuth,请添加一个标头:
{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com/?tools=actors,docs,johnvc/google-shopping-api-google-shopping-products-prices-deals",
"headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
}
}
}
- 打开 Cursor → Settings → MCP,确认 apify 服务已连接(绿色圆点)。
- 在 Composer 或 Chat 中,让 Cursor 调用 Google Shopping API。
刚开始使用 Cursor?在这里获取:https://cursor.com/referral?code=XQP4VBLI3NNX
在 ChatGPT 中安装

ChatGPT 通过开发者模式连接到 Apify MCP 服务(ChatGPT Pro、Plus、Business、Enterprise 和 Education 方案均可使用)。
- 点击个人资料图标,然后前往 Settings > Apps。如果看不到 Create app 按钮,请打开 Advanced settings 并启用 Developer mode。
- 点击 Create app 并填写表单:
- 名称: Apify
- MCP 服务 URL:
https://mcp.apify.com/?tools=actors,docs,johnvc/google-shopping-api-google-shopping-products-prices-deals - 身份验证: OAuth
- 点击 Create,并通过 Apify 授权连接。
- 若要在对话中使用该应用,请点击聊天中的 +,选择 Developer mode,然后选择 Apify。
更多帮助:https://docs.apify.com/platform/integrations/mcp
使用 Google Shopping API 获取可靠、结构化的结果,为价格比较、优惠追踪和竞争监控提供支持。
精选任务
Apify Store 中可直接运行的示例。
🤖 向 AI 助手咨询此 Actor
在你选择的 AI 中打开一条关于 Google Shopping API 的现成提示词:
- 💬 ChatGPT
- 🧠 Claude
- 🔍 Perplexity
- 🅒 Copilot
最后更新:2026.10.27
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。
