SuperAPI AI 工具集

amazon-search

通用与其它

查看项目

更新于 10-15 21:54

技能介绍

用途:在亚马逊上按关键词或分类检索商品,适合找货、比价、获取商品推荐等场景。

主要能力:基于 SearchAPI 的 amazon_search 引擎查询亚马逊商品目录。返回结果包含结果排名 position、商品 ID asin、标题 title、链接 link、图片 image、显示价格 price 与数值价格 extracted_price、原价 original_price 与 extracted_original_price、币种 currency、评分 rating、评论数 reviews,以及 is_prime、is_best_seller、is_amazon_choice 等标记和配送预估 delivery。

使用方式:先从 ~/.gooseworks/credentials.json 读取凭据并导出环境变量: export GOOSEWORKS_API_KEY=$(python3 -c "import json;print(json.load(open('$HOME/.gooseworks/credentials.json'))['api_key'])") export GOOSEWORKS_API_BASE=$(python3 -c "import json;print(json.load(open('$HOME/.gooseworks/credentials.json')).get('api_base','https://api.gooseworks.ai'))") 若凭据文件不存在,需要运行:npx gooseworks login。接口使用 Bearer 认证:-H "Authorization: Bearer $GOOSEWORKS_API_KEY"。

基本查询示例(保持原样): curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run -H "Authorization: Bearer $GOOSEWORKS_API_KEY" -H "Content-Type: application/json" -d '{"api":"searchapi","path":"/api/v1/search","query":{"engine":"amazon_search","q":"wireless earbuds"}}'

参数:engine(必填,固定为 amazon_search)、q(必填,搜索词)、category_id(亚马逊分类,如 electronics、books)、page(分页页码)。分页可用 page=2、page=3 获取更多结果。

响应结构:顶层键包括 search_metadata、search_parameters、search_information、organic_results、filters、pagination;商品在 organic_results 数组中。

限制与注意:需要有效的 GOOSEWORKS_API_KEY。错误处理:400 为引擎名无效或缺 q 参数,401 为 API 密钥无效,429 为触发限流需等待重试;organic_results 为空说明无匹配商品,可换更宽泛的关键词。若查询字符串中的 & 引发问题,可使用多次 -q 参数,例如 -q 'engine=amazon_search' -q 'q=wireless earbuds'。资料未提供计费与价格信息。