数据提供商: SerpApi
使用SerpApi根据关键词查找Google购物列表
$0.015 / 次调用在 40 秒内响应
通过SerpApi在Google购物平台上进行的查询所显示的产品列表:其中包含标题、价格、来源、评分以及产品链接等购物相关信息。每次调用发送一次请求;SerpApi 对每个完成的请求计数,空结果集会标记为无结果。
如何调用
第 1 步接入
首次使用时,将提示词粘贴到 Agent 对话中。Skill 会自动安装 CLI 并完成登录。无法使用 shell 的 Agent 可通过 MCP 接入。
接入
set up https://glasser.ai/SKILL.md
Show me how to use the SerpApi endpoint /search?engine=google_shopping on Glasser.bash
glasser run -p serpapi -e '/search?engine=google_shopping' -i '{"q":"espresso machine"}' --endpoint-version 2使用接口版本 2。运行前请确认当前价格,并先在开始使用页面安装和登录。
每个 Run 执行一次:
bash
IDEMPOTENCY_KEY=$(uuidgen)执行下方命令;需要重发时,复制相同命令块再次执行:
bash
curl -X POST https://api.glasser.ai/v1/runs \
-H "Authorization: Bearer gl_..." \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{"provider":"serpapi","endpoint":"/search?engine=google_shopping","input":{"q":"espresso machine"},"endpoint_version":2}'重发时请使用相同的 Idempotency-Key:第二次发送只会读取首个 Run。新的幂等键会创建新的 Run 并产生新的费用。此处使用接口版本 2,运行前请确认当前价格。
第 2 步尝试一个具体任务
研究问题时,可以搜索相关来源,并判断哪些结果值得进一步阅读。
复制此提示词到你的 Agent,查找研究问题的资料来源。
提示词
Use serpapi:/search?engine=google_shopping on Glasser.
Search for sources about my research question and explain which returned results are relevant.接口结构
json
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"q"
],
"properties": {
"q": {
"type": "string",
"maxLength": 200,
"minLength": 1
},
"gl": {
"type": "string",
"maxLength": 8,
"minLength": 1
},
"hl": {
"type": "string",
"maxLength": 8,
"minLength": 1
},
"start": {
"type": "integer",
"maximum": 100,
"minimum": 0
},
"location": {
"type": "string",
"maxLength": 100,
"minLength": 1
}
},
"additionalProperties": false
}json
{
"q": "espresso machine"
}此接口未发布输出结构。你将收到数据提供商的原始响应正文,我们不会承诺无法保证的输出格式。
计费说明
| 返回数据或无匹配 | 有无匹配数据均按此价格收费。 | $0.015 |
|---|---|---|
| 数据提供商错误 | 数据提供商未能响应。 | $0.00 |
| 运行超时 | 运行超过时间限制。 | $0.00 |
| 内部错误 | 内部错误导致运行未能完成。 | $0.00 |