linkfox-amazon-alexa-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAmazon Alexa Shopping Assistant
Amazon Alexa 购物助手
This skill drives Amazon's storefront Alexa shopping assistant: pose a natural-language question and get an answer, a curated product list (with ASINs and links), and a set of follow-up questions Alexa is willing to continue with. Each call supports only one prompt. For multi-turn conversations, the agent must summarize prior context and concatenate it with the new question in a fresh call.
本技能驱动亚马逊前台的Alexa购物助手:提出自然语言问题,即可获取回答、精选商品列表(包含ASIN和链接),以及Alexa可继续回应的一系列追问问题。每次调用仅支持一个prompt。对于多轮对话,agent必须总结之前的上下文,并将其与新问题拼接后发起新调用。
Core Concepts
核心概念
- Single-turn per call: is an array but only supports 1 element. Each API call sends exactly one question to Alexa and returns one answer. Do not pass multiple elements.
prompts - Cross-call context is not preserved: every call starts a brand-new Alexa session. To ask follow-up questions, the agent must summarize the previous answer (key recommendations, ASINs, relevant context) and concatenate it with the new question as in a new call.
prompts[0] - Optional page context (): pass an Amazon page URL only when you want the conversation anchored to a specific page (a category page, search results page, or product detail page). Do not pass a plain marketplace homepage URL like
url— it adds no useful context. Omithttps://www.amazon.com/entirely when there is no specific page to anchor on.url - Two output formats:
- (default) — a single readable Markdown report containing the question, Alexa's answer, recommended product groups, and follow-up questions.
markdown - — a structured array under
json, where each entry carriesdata,prompt,content(grouped recommendations),products, andfollowUpQuestions.screenshot
resultsNum0- 单次调用单轮对话:是数组,但仅支持1个元素。每个API调用向Alexa发送一个问题并返回一个回答。请勿传入多个元素。
prompts - 跨调用不保留上下文:每次调用都会启动一个全新的Alexa会话。若要进行追问,agent必须总结之前的回答(关键推荐、ASIN、相关上下文),并将其与新问题拼接作为新调用中的。
prompts[0] - 可选页面上下文():仅当希望对话锚定到特定页面(分类页、搜索结果页或商品详情页)时,才传入亚马逊页面URL。请勿传入
url这类普通的商城首页URL——它无法提供有用的上下文。当没有特定页面可锚定时,请完全省略https://www.amazon.com/参数。url - 两种输出格式:
- (默认)——一份易读的Markdown报告,包含问题、Alexa的回答、推荐商品分组以及追问问题。
markdown - ——
json字段下的结构化数组,每个条目包含data、prompt、content(分组推荐)、products和followUpQuestions。screenshot
resultsNum0Parameters
参数
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
| prompts | string[] | Yes | Conversation prompts. Only 1 element is allowed per call. To ask follow-up questions, make a new call with context summary + new question as | - |
| format | string | No | Response format: | markdown |
| url | string | No | Specific Amazon page URL (category, search results, or product detail) to anchor the conversation. Skip when there is no specific page; do not pass a plain homepage URL such as | - |
| 参数 | 类型 | 是否必填 | 描述 | 默认值 |
|---|---|---|---|---|
| prompts | string[] | 是 | 对话提示词。每次调用仅允许1个元素。若要追问,需发起新调用,将上下文总结+新问题作为 | - |
| format | string | 否 | 响应格式: | markdown |
| url | string | 否 | 用于锚定对话的特定亚马逊页面URL(分类、搜索结果或商品详情页)。无特定页面时跳过;请勿传入 | - |
Response Fields
响应字段
| Field | Type | Description |
|---|---|---|
| stdout | string | Markdown report when |
| data | array | Structured turns when |
| resultsNum | integer | Number of answered turns (0 = Alexa did not respond) |
| code / errcode | string / integer | |
| msg / errmsg | string | |
| costTime | integer | API latency in milliseconds |
| costToken | integer | Tokens consumed (only billed on success) |
| taskId | string | Upstream task identifier for tracing |
| type | string | Render hint: |
| 字段 | 类型 | 描述 |
|---|---|---|
| stdout | string | 当 |
| data | array | 当 |
| resultsNum | integer | 已回答的轮次数(0表示Alexa未响应) |
| code / errcode | string / integer | 成功时为 |
| msg / errmsg | string | 成功时为 |
| costTime | integer | API延迟(毫秒) |
| costToken | integer | 消耗的Token数(仅成功时计费) |
| taskId | string | 用于追踪的上游任务标识符 |
| type | string | 渲染提示: |
Structured data[*]
shape (format=json
)
data[*]format=json结构化data[*]
格式(format=json
)
data[*]format=json| Field | Type | Description |
|---|---|---|
| prompt | string | The question or follow-up sent for this turn |
| content | string | Alexa's natural-language answer |
| products[].title | string | Group title (e.g. "Top picks", "Best for running") |
| products[].items[].asin | string | Product ASIN |
| products[].items[].title | string | Product title |
| products[].items[].url | string | Product detail page URL |
| products[].items[].cover | string | Product cover image URL |
| products[].items[].price | string | Current price string (with currency) |
| products[].items[].originalPrice | string | List price / strikethrough price |
| products[].items[].score | string | Star rating |
| products[].items[].ratingsCount | string | Review count |
| products[].items[].describe | string | Short product blurb |
| followUpQuestions | string[] | Questions Alexa offers to continue with |
| screenshot | string | Screenshot URL for this turn |
| 字段 | 类型 | 描述 |
|---|---|---|
| prompt | string | 本轮发送的问题或追问 |
| content | string | Alexa的自然语言回答 |
| products[].title | string | 分组标题(例如“热门精选”、“跑步首选”) |
| products[].items[].asin | string | 商品ASIN |
| products[].items[].title | string | 商品标题 |
| products[].items[].url | string | 商品详情页URL |
| products[].items[].cover | string | 商品封面图片URL |
| products[].items[].price | string | 当前价格字符串(含货币) |
| products[].items[].originalPrice | string | 标价/划线价 |
| products[].items[].score | string | 星级评分 |
| products[].items[].ratingsCount | string | 评论数 |
| products[].items[].describe | string | 商品简短介绍 |
| followUpQuestions | string[] | Alexa提供的可继续追问的问题 |
| screenshot | string | 本轮对话的截图URL |
调用方式
调用方式
- API 端点:(完整参数/响应/错误码见
POST /amazon/alexaSearch)references/api.md - Python 脚本:
python scripts/amazon_alexa_search.py '<JSON 参数>' [--inline] - 成本约束:本工具会消耗积分;同一会话同一参数组合默认只调用一次,脚本带 24h 本地缓存。失败/空结果不得自动换关键词、翻页或改邮编连续试探;需要继续检索时先向用户说明会产生额外消耗。
输出策略(脚本默认行为):
- 始终将完整响应写入 (
<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-amazon-alexa-search-<timestamp>.json为脚本执行时的工作目录,在 Claude Code 里即当前项目目录;<cwd>取自环境变量<session>,按用户任务自动聚合;禁止写入 /tmp,当前目录不可写则报错)SESSION_ID - 响应体 ≤ 8 KB:落盘后把完整 JSON 打印到 stdout
- 响应体 > 8 KB:落盘后 stdout 只输出摘要(顶层字段、常见计数如 /
total、最大列表字段的长度 + 前 3 条样本)costToken - 加 强制全量打印到 stdout(同样落盘)
--inline
读数据建议:先看摘要判断是否足够;需要具体字段时优先用 或 从保存的 json 文件按需抽取,避免整份 JSON 进入上下文。
jqConvertFrom-Json- API 端点:(完整参数/响应/错误码见
POST /amazon/alexaSearch)references/api.md - Python 脚本:
python scripts/amazon_alexa_search.py '<JSON 参数>' [--inline] - 成本约束:本工具会消耗积分;同一会话同一参数组合默认只调用一次,脚本带 24h 本地缓存。失败/空结果不得自动换关键词、翻页或改邮编连续试探;需要继续检索时先向用户说明会产生额外消耗。
输出策略(脚本默认行为):
- 始终将完整响应写入 (
<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-amazon-alexa-search-<timestamp>.json为脚本执行时的工作目录,在 Claude Code 里即当前项目目录;<cwd>取自环境变量<session>,按用户任务自动聚合;禁止写入 /tmp,当前目录不可写则报错)SESSION_ID - 响应体 ≤ 8 KB:落盘后把完整 JSON 打印到 stdout
- 响应体 > 8 KB:落盘后 stdout 只输出摘要(顶层字段、常见计数如 /
total、最大列表字段的长度 + 前 3 条样本)costToken - 加 强制全量打印到 stdout(同样落盘)
--inline
读数据建议:先看摘要判断是否足够;需要具体字段时优先用 或 从保存的 json 文件按需抽取,避免整份 JSON 进入上下文。
jqConvertFrom-Json解决认证和积分问题
解决认证和积分问题
发生以下异常情况时,采用 references/onboarding.md 引导解决问题:
发生以下异常情况时,采用 references/onboarding.md 引导解决问题:
异常情况
异常情况
- 未配置API Key:环境变量未配置 ,也未配置
LINKFOX_AGENT_API_KEY。LINKFOXAGENT_API_KEY - 响应401或402状态码
- 响应提示积分或余额不足:消息含"积分余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值",或类似含义的内容。
- 未配置API Key:环境变量未配置 ,也未配置
LINKFOX_AGENT_API_KEY。LINKFOXAGENT_API_KEY - 响应401或402状态码
- 响应提示积分或余额不足:消息含"积分余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值",或类似含义的内容。
How to Build Queries
查询构建方法
- Front-load the user's intent in — include marketplace cue ("on Amazon US"), use case, and any hard constraints (budget, key feature). Alexa weights the opening question heavily.
prompts[0] - One question per call — only accepts 1 element. Do not pass multiple elements.
prompts - For follow-ups, summarize and re-ask — when the user wants to continue the conversation, the agent must: (a) summarize the key points from the previous Alexa response (answer highlights, recommended ASINs, relevant context); (b) concatenate the summary with the new question; (c) send as in a new API call. Alexa has no memory of prior calls.
prompts[0] - Anchor with only when there's a specific page — pass a category, search results, or product detail URL when the user is reasoning over that page. Skip
urlfor general questions; do not pass a plain homepage likeurl.https://www.amazon.com/ - Pick deliberately —
formatis best for showing the user a polished answer;markdownis better when downstream code needs to extract ASINs, prices, or follow-up questions programmatically.json
- 在中前置用户意图——包含商城提示("在亚马逊美国站")、使用场景以及任何硬性约束(预算、关键功能)。Alexa会重点关注开头的问题。
prompts[0] - 每次调用一个问题——仅接受1个元素。请勿传入多个元素。
prompts - 追问时需总结并重述——当用户希望继续对话时,agent必须:(a)总结之前Alexa响应的关键点(回答要点、推荐ASIN、相关上下文);(b)将总结内容与新问题拼接;(c)作为新API调用中的发送。Alexa不保留之前调用的记忆。
prompts[0] - 仅在有特定页面时使用锚定——当用户针对某页面进行推理时,传入分类、搜索结果或商品详情页URL。对于一般性问题,跳过
url参数;请勿传入url这类普通首页。https://www.amazon.com/ - 谨慎选择——
format最适合向用户展示精美的回答;markdown更适合下游代码以编程方式提取ASIN、价格或追问问题。json
Usage Examples
使用示例
1. Single-turn shopping question
json
{
"prompts": ["best wireless earbuds for running on Amazon US under $100"]
}2. Follow-up question (agent summarizes prior context and re-asks)
First call:
json
{
"prompts": ["best electric kettle on Amazon US"]
}Second call (agent summarizes the previous answer and appends the follow-up):
json
{
"prompts": ["Previously Alexa recommended: 1) Cosori Electric Kettle (B07T1KY5TZ, $35.99, 4.7★), 2) Mueller Ultra Kettle (B09KC7D3HR, $29.97, 4.5★). Now compare these two on noise level and boil time."]
}3. Question anchored to a category page
json
{
"prompts": ["What are the most popular picks on this page?"],
"url": "https://www.amazon.com/s?k=electric+kettle"
}4. Structured output for downstream extraction
json
{
"prompts": ["best gift ideas for a 10-year-old who likes science"],
"format": "json"
}1. 单轮购物问题
json
{
"prompts": ["best wireless earbuds for running on Amazon US under $100"]
}2. 追问问题(agent总结之前的上下文并重述)
First call:
json
{
"prompts": ["best electric kettle on Amazon US"]
}Second call (agent summarizes the previous answer and appends the follow-up):
json
{
"prompts": ["Previously Alexa recommended: 1) Cosori Electric Kettle (B07T1KY5TZ, $35.99, 4.7★), 2) Mueller Ultra Kettle (B09KC7D3HR, $29.97, 4.5★). Now compare these two on noise level and boil time."]
}3. 锚定到分类页的问题
json
{
"prompts": ["What are the most popular picks on this page?"],
"url": "https://www.amazon.com/s?k=electric+kettle"
}4. 用于下游提取的结构化输出
json
{
"prompts": ["best gift ideas for a 10-year-old who likes science"],
"format": "json"
}Display Rules
展示规则
- Render the Markdown directly when :
format=markdownis already structured with turn headings, product cards, and follow-up questions — preserve that structure.stdout - Surface the recommended ASINs so the user can click through; show ,
title,price/score, and the product URL.ratingsCount - Show the follow-up questions Alexa returned — they are usable prompts the user can pick to continue digging. When the user picks one, summarize the current answer and use the selected follow-up as in a new call.
prompts[0] - Don't reroute to a data-analysis sandbox: the answer body is conversational and the recommended products are nested groups, not a flat tabular dataset suitable for SQL-like aggregation.
- Flag empty results: if is
resultsNumor0is empty, tell the user Alexa did not produce a usable reply and suggest rephrasing or anchoring with adata.url - Indicate freshness: results reflect Alexa's live answer at call time; mention this when the user asks about timing.
- Handle business errors: if /
codeis noterrcode, surface200/msgand suggest retrying with simpler prompts.errmsg
- 当时直接渲染Markdown:
format=markdown已按对话轮次标题、商品卡片和追问问题结构化——请保留该结构。stdout - 展示推荐的ASIN:方便用户点击跳转;显示、
title、price/score以及商品URL。ratingsCount - 展示Alexa返回的追问问题:这些是用户可选择继续深入的可用提示词。当用户选择其中一个时,总结当前回答并将选中的追问作为新调用中的。
prompts[0] - 不要重定向到数据分析沙箱:回答内容是对话式的,推荐商品是嵌套分组,并非适合类SQL聚合的扁平表格数据集。
- 标记空结果:如果为
resultsNum或0为空,告知用户Alexa未生成可用回复,并建议重新表述问题或使用data锚定。url - 说明时效性:结果反映调用时Alexa的实时回答;当用户询问时间相关问题时提及这一点。
- 处理业务错误:如果/
code不为errcode,展示200/msg并建议使用更简单的提示词重试。errmsg
Important Limitations
重要限制
- Alexa-driven, not deterministic: same prompts can yield different answers across calls — Alexa's response varies with time, traffic, and context.
- No cross-call memory: each tool call is a fresh Alexa session; the agent must summarize prior context and embed it in the new question.
- One prompt per call: only accepts 1 element. For follow-ups, the agent must summarize context + new question into a single
promptsand make a new call.prompts[0] - Marketplace coverage: anchored on Amazon's storefront Alexa experience (primarily amazon.com); availability on non-US marketplaces depends on Alexa rollout.
- Output mix: primary value is the conversational answer plus a curated handful of products; this is not a substitute for SERP-wide product extraction.
- 由Alexa驱动,非确定性:相同的提示词在不同调用中可能产生不同的回答——Alexa的响应会随时间、流量和上下文变化。
- 无跨调用记忆:每次工具调用都是全新的Alexa会话;agent必须总结之前的上下文并将其嵌入新问题中。
- 每次调用一个提示词:仅接受1个元素。如需追问,agent必须将上下文总结+新问题合并为单个
prompts并发起新调用。prompts[0] - 商城覆盖范围:基于亚马逊前台的Alexa体验(主要是amazon.com);非美国商城的可用性取决于Alexa的部署情况。
- 输出组合:核心价值在于对话式回答加上少量精选商品;无法替代全搜索结果页的商品提取。
User Expression & Scenario Quick Reference
用户表达与场景速查
Applicable — natural-language conversational shopping on Amazon:
| User Says | Scenario |
|---|---|
| "用 Alexa 帮我推荐...", "亚马逊 Alexa 问下..." | Direct Alexa Q&A |
| "在亚马逊上聊聊给我推荐 ...", "对话式选品" | Conversational discovery |
| "顺便再追问一下 / 接着问 ..." | Follow-up (agent summarizes prior result and re-asks in new call) |
| "在这个页面 / 这个分类下推荐...", "基于这个页面再问一下" | Page-anchored conversation (use |
| "best XX for YY under $Z on Amazon" | Goal + constraint + budget Q&A |
| "对比 Alexa 给的前两个推荐" | Compare within Alexa's reply |
| "Alexa 还能继续问什么 / 给我一些追问思路" | Surface follow-up questions |
Not applicable — better routed elsewhere:
- Pulling the full SERP for a keyword with positions, sponsored flags, etc. (use the storefront search-simulation skill).
- Historical search-term analytics or volume trends (use the ABA data explorer).
- Detailed product detail / A+ / bullets for a known ASIN (use the Amazon product detail skill).
- Review-level sentiment analysis (use the Amazon reviews skill).
- Image-based similar product discovery (use the image search skill).
- Aggregated statistics over a flat product list (no structured table here).
Boundary judgment: when the user wants a conversation — "ask Amazon, get a recommendation, then keep asking" — this skill applies. If they want raw search-result rows, structured analytics, or a specific ASIN's data, route to the matching specialized skill instead.
适用场景——亚马逊上的自然语言对话式购物:
| 用户表述 | 场景 |
|---|---|
| "用 Alexa 帮我推荐...", "亚马逊 Alexa 问下..." | 直接Alexa问答 |
| "在亚马逊上聊聊给我推荐 ...", "对话式选品" | 对话式商品发现 |
| "顺便再追问一下 / 接着问 ..." | 追问(agent总结之前的结果并重述发起新调用) |
| "在这个页面 / 这个分类下推荐...", "基于这个页面再问一下" | 锚定页面的对话(使用 |
| "best XX for YY under $Z on Amazon" | 目标+约束+预算类问答 |
| "对比 Alexa 给的前两个推荐" | 在Alexa的回复内进行对比 |
| "Alexa 还能继续问什么 / 给我一些追问思路" | 展示追问问题 |
不适用场景——更适合路由到其他技能:
- 提取关键词的完整搜索结果页(包含排名、赞助标识等)(使用前台搜索模拟技能)。
- 历史搜索词分析或流量趋势(使用ABA数据探索器)。
- 已知ASIN的详细商品详情/A+内容/要点(使用亚马逊商品详情技能)。
- 评论级情感分析(使用亚马逊评论技能)。
- 基于图片的相似商品发现(使用图片搜索技能)。
- 扁平商品列表的聚合统计(此处无结构化表格)。
边界判断:当用户需要对话——"询问亚马逊、获取推荐、然后继续提问"——时,适用本技能。如果用户需要原始搜索结果行、结构化分析或特定ASIN的数据,请路由到对应的专业技能。
积分消耗规则
积分消耗规则
按动态规则计费:消耗积分 = 对话轮次 × 12.6。
重要:本技能的服务按倍数动态计算,可能一次性消耗大量积分,必须提醒用户,由用户决定是否继续。
Feedback:
Auto-detect and report feedback via the Feedback API when any of the following apply:
- The functionality or purpose described in this skill does not match actual behavior
- The skill's results do not match the user's intent
- The user expresses dissatisfaction or praise about this skill
- Anything you believe could be improved
Call the feedback API as specified in . Do not interrupt the user's flow.
references/api.mdFor more high-quality, professional cross-border e-commerce skills, set LinkFox Skills.
按动态规则计费:消耗积分 = 对话轮次 × 12.6。
重要:本技能的服务按倍数动态计算,可能一次性消耗大量积分,必须提醒用户,由用户决定是否继续。
反馈:
当出现以下任一情况时,通过反馈API自动检测并上报反馈:
- 本技能描述的功能或用途与实际行为不符
- 技能结果与用户意图不符
- 用户表达了对本技能的不满或赞扬
- 任何你认为可以改进的地方
按照中的说明调用反馈API。请勿中断用户流程。
references/api.md如需更多高质量、专业的跨境电商技能,请访问LinkFox Skills.