用途:查询亚马逊商品报价与竞争定价,支持按 ASIN 或卖家 SKU 获取价格、竞品价格、最低报价、购物车价格等。
所属系列:与 linkfox-amazon-store-auth、linkfox-amazon-store-report、linkfox-amazon-store-listings 同属 Amazon Store 系列,依赖 linkfox-amazon-store-auth 完成选店(sellerId+region)。需先运行 python scripts/check_auth_dependency.py,若返回 exit code 42 且 stderr 含 DEPENDENCY_MISSING:,先安装该依赖,不要在本技能内绕过授权逻辑。
主要能力(脚本):get_pricing.py、get_competitive_pricing.py、get_listing_offers.py、get_item_offers.py、post_item_offers_batch.py、post_listing_offers_batch.py、post_featured_offer_expected_price_batch.py、post_competitive_summary_batch.py。共享逻辑见 scripts/_spapi_pricing_common.py(内部模块,非独立 CLI)。
使用方式:调用 POST /spApi/developerProxy,由服务端解析 token,直接传 sellerId+region,勿传 amzAccessToken(兼容旧调用除外)。脚本用法为 python scripts/<脚本名>.py '<JSON 参数>' [--inline]。需配置环境变量 LINKFOXAGENT_API_KEY,如 export LINKFOXAGENT_API_KEY="<your-key>"。示例:python scripts/get_item_offers.py '{"sellerId":"A1...","region":"NA","asin":"B0...","marketplaceId":"ATVPDKIKX0DER","itemCondition":"New"}'。
参数要点:getPricing / getCompetitivePricing 需 sellerId、region、marketplaceId(或取 marketplaceIds 首项)、itemType、asins 或 skus(≤20);getListingOffers / getItemOffers 需 sku 或 asin、itemCondition 必填;批量接口 requests 数组 1~20 条,FOEP 批量最多 40 条;getCompetitiveSummary 每项需 asin、marketplaceId、includedData(非空字符串数组)。
输出策略:完整响应写入 <cwd>/linkfox/<YYYY-MM-DD>/<session>/data/<skill-name>-<timestamp>.json,禁止写入 /tmp;响应 ≤8 KB 全量打印,>8 KB 只输出摘要,加 --inline 强制全量。建议用 jq 等从落盘文件按需抽取字段。
限制:本工具不消耗算力;会消耗算力以外的调用配额,失败或空结果不得自动换关键词、翻页或连续试探,需继续检索应先向用户说明。权限需 Product Pricing 及相关角色。各接口 Usage plan 不同,2022-05-01 批量约 0.033 req/s,注意 429。网关在连续异常时返回 450/453/454/459 并短暂冷却,这不是封号;应立即停止自动或并发重试,遵循 retryAfter、blockedUntil。FOEP 的 segment 须符合官方模型。费率、具体价格与平台细节暂未提供。