amazon-product-api-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Amazon Product Search Skill

Amazon商品搜索Skill

📖 Introduction

📖 介绍

This skill utilizes BrowserAct's Amazon Product API template to extract structured product listings from Amazon search results. It provides detailed information including titles, ASINs, prices, ratings, and product specifications, enabling efficient market research and product monitoring without manual data collection.
本Skill利用BrowserAct的Amazon Product API模板,从亚马逊搜索结果中提取结构化的商品列表。它提供包括标题、ASIN、价格、评分和商品规格在内的详细信息,无需手动收集数据即可实现高效的市场调研和商品监控。

✨ Features

✨ 特性

  1. No Hallucinations: Pre-set workflows avoid AI generative hallucinations, ensuring stable and precise data extraction.
  2. No Captcha Issues: No need to handle reCAPTCHA or other verification challenges.
  3. No IP Restrictions: No need to handle regional IP restrictions or geofencing.
  4. Faster Execution: Tasks execute faster compared to pure AI-driven browser automation solutions.
  5. Cost-Effective: Significantly lowers data acquisition costs compared to high-token-consuming AI solutions.
  1. 无幻觉问题:预设工作流可避免AI生成幻觉,确保数据提取稳定精准。
  2. 无验证码问题:无需处理reCAPTCHA或其他验证挑战。
  3. 无IP限制:无需处理区域IP限制或地理围栏。
  4. 执行速度更快:与纯AI驱动的浏览器自动化解决方案相比,任务执行速度更快。
  5. 高性价比:与高token消耗的AI解决方案相比,可大幅降低数据获取成本。

🔑 API Key Setup

🔑 API Key配置

Before running, check the
BROWSERACT_API_KEY
environment variable. If not set, do not take other measures; ask and wait for the user to provide it. Agent must inform the user:
"Since you haven't configured the BrowserAct API Key, please visit the BrowserAct Console to get your Key."
运行前请检查
BROWSERACT_API_KEY
环境变量。如果未设置,请勿采取其他操作,询问并等待用户提供。 Agent必须告知用户
"由于您尚未配置BrowserAct API Key,请访问BrowserAct控制台获取您的密钥。"

🛠️ Input Parameters

🛠️ 输入参数

The agent should configure the following parameters based on user requirements:
  1. KeyWords
    • Type:
      string
    • Description: Search keywords used to find products on Amazon.
    • Required: Yes
    • Example:
      laptop
      ,
      wireless earbuds
  2. Brand
    • Type:
      string
    • Description: Filter products by brand name.
    • Default:
      Apple
    • Example:
      Dell
      ,
      Samsung
  3. Maximum_number_of_page_turns
    • Type:
      number
    • Description: Number of search result pages to paginate through.
    • Default:
      1
  4. language
    • Type:
      string
    • Description: UI language for the Amazon browsing session.
    • Default:
      en
    • Example:
      zh-CN
      ,
      de
Agent应根据用户需求配置以下参数:
  1. KeyWords
    • 类型
      string
    • 描述:用于在亚马逊搜索商品的关键词
    • 是否必填:是
    • 示例
      laptop
      wireless earbuds
  2. Brand
    • 类型
      string
    • 描述:按品牌名称筛选商品
    • 默认值
      Apple
    • 示例
      Dell
      Samsung
  3. Maximum_number_of_page_turns
    • 类型
      number
    • 描述:要翻页获取的搜索结果页数
    • 默认值
      1
  4. language
    • 类型
      string
    • 描述:亚马逊浏览会话的UI语言
    • 默认值
      en
    • 示例
      zh-CN
      de

🚀 Usage

🚀 使用方法

Agent should use the following independent script to achieve "one-line command result":
bash
undefined
Agent应使用以下独立脚本实现“一行命令出结果”:
bash
undefined

Example Usage

Example Usage

python -u ./scripts/amazon_product_api.py "keywords" "brand" pages "language"
undefined
python -u ./scripts/amazon_product_api.py "keywords" "brand" pages "language"
undefined

⏳ Execution Monitoring

⏳ 执行监控

Since this task involves automated browser operations, it may take some time (several minutes). The script will continuously output status logs with timestamps (e.g.,
[14:30:05] Task Status: running
). Agent Instructions:
  • While waiting for the script result, keep monitoring the terminal output.
  • As long as the terminal is outputting new status logs, the task is running normally; do not mistake it for a deadlock or unresponsiveness.
  • Only if the status remains unchanged for a long time or the script stops outputting without returning a result should you consider triggering the retry mechanism.
由于该任务涉及自动化浏览器操作,可能需要一定时间(数分钟)。脚本会持续输出带时间戳的状态日志(例如
[14:30:05] Task Status: running
)。 Agent操作指引
  • 等待脚本返回结果期间,持续监控终端输出。
  • 只要终端正在输出新的状态日志,说明任务运行正常,不要误认为是死锁或无响应。
  • 仅当状态长时间未更新,或脚本停止输出且未返回结果时,才考虑触发重试机制。

📊 Data Output

📊 数据输出

Upon success, the script parses and prints the structured product data from the API response, which includes:
  • product_title
    : Full title of the product.
  • asin
    : Amazon Standard Identification Number.
  • product_url
    : URL of the Amazon product page.
  • brand
    : Brand name.
  • price_current_amount
    : Current price.
  • price_original_amount
    : Original price (if applicable).
  • rating_average
    : Average star rating.
  • rating_count
    : Total number of ratings.
  • featured
    : Badges like "Best Seller" or "Amazon's Choice".
  • color
    ,
    material
    ,
    style
    : Product attributes (if available).
执行成功时,脚本会解析并打印API响应中的结构化商品数据,包含以下字段:
  • product_title
    :商品的完整标题
  • asin
    :亚马逊标准识别码
  • product_url
    :亚马逊商品页面URL
  • brand
    :品牌名称
  • price_current_amount
    :当前价格
  • price_original_amount
    :原价(如有)
  • rating_average
    :平均星级评分
  • rating_count
    :总评分数量
  • featured
    :“Best Seller”或“Amazon's Choice”等标识
  • color
    material
    style
    :商品属性(如有)

⚠️ Error Handling & Retry

⚠️ 错误处理与重试

If an error occurs during script execution (e.g., network fluctuations or task failure), the Agent should follow this logic:
  1. Check Output Content:
    • If the output contains
      "Invalid authorization"
      , it means the API Key is invalid or expired. Do not retry; guide the user to re-check and provide the correct API Key.
    • If the output does not contain
      "Invalid authorization"
      but the task failed (e.g., output starts with
      Error:
      or returns empty results), the Agent should automatically try to re-execute the script once.
  2. Retry Limit:
    • Automatic retry is limited to one time. If the second attempt fails, stop retrying and report the specific error information to the user.
如果脚本执行过程中出现错误(例如网络波动或任务失败),Agent应遵循以下逻辑处理:
  1. 检查输出内容
    • 如果输出包含
      "Invalid authorization"
      ,说明API Key无效或已过期。不要重试,引导用户重新检查并提供正确的API Key。
    • 如果输出不包含
      "Invalid authorization"
      但任务失败(例如输出以
      Error:
      开头或返回空结果),Agent应自动尝试重新执行脚本一次
  2. 重试限制
    • 自动重试仅限一次。如果第二次执行也失败,停止重试并向用户上报具体错误信息。

🌟 Typical Use Cases

🌟 典型使用场景

  1. Market Research: Search for a specific product category to analyze top brands and pricing.
  2. Competitor Monitoring: Track product listings and price changes for specific competitor brands.
  3. Product Catalog Enrichment: Extract structured details like ASINs and specifications to build or update a product database.
  4. Rating Analysis: Find high-rated products for specific keywords to identify market leaders.
  5. Localized Research: Search Amazon in different languages to analyze international markets.
  6. Price Tracking: Monitor current and original prices to identify discount trends.
  7. Brand Performance: Evaluate the presence of a specific brand in search results across multiple pages.
  8. Attribute Extraction: Gather technical specifications like material or color for a list of products.
  9. Lead Generation: Identify popular products and their manufacturers for business outreach.
  10. Automated Data Feed: Periodically pull Amazon search results into external BI tools or dashboards.
  1. 市场调研:搜索特定商品类目,分析头部品牌和定价情况。
  2. 竞品监控:跟踪特定竞品品牌的商品列表和价格变化。
  3. 商品目录丰富:提取ASIN和规格等结构化详情,构建或更新商品数据库。
  4. 评分分析:查找特定关键词对应的高评分商品,识别市场头部玩家。
  5. 本地化调研:使用不同语言搜索亚马逊,分析国际市场。
  6. 价格跟踪:监控当前价格和原价,识别折扣趋势。
  7. 品牌表现分析:评估特定品牌在多页搜索结果中的曝光情况。
  8. 属性提取:收集商品列表的材质、颜色等技术规格。
  9. 线索生成:识别热门商品及其制造商,用于业务拓展。
  10. 自动化数据馈送:定期拉取亚马逊搜索结果到外部BI工具或看板。