| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- {
- "name": "product-detail-query",
- "displayName": "Amazon 产品详情查询",
- "description": "根据 ASIN 获取 Amazon 产品详情,包括标题、价格、评分、销量、BSR、品牌、类目、变体、趋势等完整信息。用于竞品分析、市场全景、定价策略。",
- "category": "voc",
- "version": "1.3.0",
- "endpoint": {
- "method": "POST",
- "url": "https://server.fmode.cn/api/voc-ecom/forward",
- "headers": {
- "Content-Type": "application/json",
- "Authorization": "Bearer {{vocToken}}"
- }
- },
- "parameters": {
- "type": "object",
- "required": [
- "ASIN"
- ],
- "properties": {
- "ASIN": {
- "type": "string",
- "description": "Amazon 产品唯一标识符(10位字母数字),必须大写。例:B0CSVRWJ1H",
- "pattern": "^[A-Z0-9]{10}$"
- },
- "domain": {
- "type": "integer",
- "description": "Amazon 站点 ID: 1=amazon.com, 2=amazon.co.uk, 3=amazon.de, 4=amazon.co.jp, 5=amazon.fr, 6=amazon.it, 7=amazon.es, 8=amazon.ca",
- "default": 1,
- "enum": [
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8
- ]
- },
- "Trend": {
- "type": "integer",
- "description": "是否返回趋势数据: 1=是, 0=否",
- "default": 1,
- "enum": [
- 0,
- 1
- ]
- },
- "QueryTrendStartDt": {
- "type": "string",
- "description": "趋势数据起始日期,格式 YYYYMMDD,留空则使用默认范围",
- "default": ""
- },
- "QueryTrendEndDt": {
- "type": "string",
- "description": "趋势数据结束日期,格式 YYYYMMDD,留空则使用默认范围",
- "default": ""
- }
- }
- },
- "requestTransform": {
- "description": "将参数转换为 Sorftime forward 格式",
- "template": {
- "path": "/api/ProductRequest",
- "method": "POST",
- "query": {
- "domain": "{{domain}}"
- },
- "body": {
- "ASIN": "{{ASIN}}",
- "Trend": "{{Trend}}",
- "QueryTrendStartDt": "{{QueryTrendStartDt}}",
- "QueryTrendEndDt": "{{QueryTrendEndDt}}"
- }
- }
- },
- "response": {
- "type": "object",
- "description": "产品详情对象",
- "properties": {
- "Title": {
- "type": "string",
- "description": "产品标题"
- },
- "Price": {
- "type": "number",
- "description": "当前售价(美元)"
- },
- "SalesPrice": {
- "type": "number",
- "description": "促销价(美元)"
- },
- "Brand": {
- "type": "string",
- "description": "品牌名称"
- },
- "StoreName": {
- "type": "string",
- "description": "店铺名称"
- },
- "Rating": {
- "type": "number",
- "description": "平均评分 (0-5)"
- },
- "RatingsCount": {
- "type": "integer",
- "description": "评论总数"
- },
- "fiveStartRatings": {
- "type": "number",
- "description": "5星评分百分比"
- },
- "fourStartRatings": {
- "type": "number",
- "description": "4星评分百分比"
- },
- "threeStartRatings": {
- "type": "number",
- "description": "3星评分百分比"
- },
- "twoStartRatings": {
- "type": "number",
- "description": "2星评分百分比"
- },
- "oneStartRatings": {
- "type": "number",
- "description": "1星评分百分比"
- },
- "MonthlySales": {
- "type": "integer",
- "description": "月销量估算"
- },
- "BSR": {
- "type": "integer",
- "description": "Best Sellers Rank 大类排名"
- },
- "Category": {
- "type": "array",
- "description": "类目层级"
- },
- "BsrCategory": {
- "type": "array",
- "description": "BSR 类目层级"
- },
- "Photo": {
- "type": "array",
- "description": "产品图片 URL 列表"
- },
- "Feature": {
- "type": "object",
- "description": "产品 Bullet Points 卖点"
- },
- "Description": {
- "type": "string",
- "description": "产品描述"
- },
- "Property": {
- "type": "string",
- "description": "产品属性(JSON 字符串)"
- },
- "VariationASIN": {
- "type": "array",
- "description": "变体 ASIN 列表"
- },
- "Size": {
- "type": "array",
- "description": "尺寸选项"
- },
- "ShipsFrom": {
- "type": "string",
- "description": "发货地"
- },
- "ProductType": {
- "type": "string",
- "description": "配送类型 (FBA/FBM)"
- },
- "DealType": {
- "type": "string",
- "description": "促销类型"
- },
- "UpdateDate": {
- "type": "string",
- "description": "数据更新日期"
- }
- }
- },
- "usageExamples": [
- {
- "name": "查询单个产品详情",
- "input": {
- "ASIN": "B0CSVRWJ1H",
- "domain": 1,
- "Trend": 1
- },
- "description": "获取美国站产品 B0CSVRWJ1H 的完整信息和趋势数据"
- }
- ],
- "reportMapping": {
- "slides": [
- "市场全景(Slide3)",
- "竞品对标(Slide4)",
- "品类矩阵(Slide6)"
- ],
- "dataPoints": [
- "价格",
- "评分",
- "月销量",
- "BSR",
- "品牌",
- "类目"
- ]
- },
- "timeout": 60000,
- "retry": {
- "maxAttempts": 3,
- "delay": 1000,
- "backoffMultiplier": 2
- },
- "tokenConfig": {
- "type": "bearer",
- "configFile": "~/.openclaw/voc-credentials.json",
- "tokenField": "vocToken",
- "resolutionOrder": [
- "configFile"
- ],
- "apigId": "7HwdQZk55B",
- "paymentUrlResolution": {
- "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
- "steps": [
- "1. 从 voc-credentials.json 获取当前 session token",
- "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
- "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=7HwdQZk55B&fun_id=HOkkX72PMF",
- "4. 将该URL展示给用户,引导扫码支付"
- ],
- "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
- "userResolveHeaders": {
- "X-Parse-Application-Id": "ncloudmaster",
- "X-Parse-Session-Token": "{vocToken}"
- },
- "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
- "paymentParams": {
- "user": "{resolvedUserId}",
- "apigid": "7HwdQZk55B",
- "fun_id": "HOkkX72PMF"
- },
- "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
- },
- "onMissing": {
- "action": "showPaymentQR",
- "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=7HwdQZk55B&fun_id=HOkkX72PMF",
- "title": "扫码开通 VOC-AI 数据服务",
- "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
- "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
- "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
- },
- "onBalanceInsufficient": {
- "action": "resolveUserThenShowPayment",
- "title": "VOC-AI Token 余额不足,请扫码充值",
- "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
- }
- },
- "errorHandling": {
- "balanceInsufficient": {
- "conditions": [
- {
- "responseField": "code",
- "operator": "in",
- "value": [
- -2,
- -3,
- -10,
- 402,
- 429
- ]
- },
- {
- "responseField": "msg",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance",
- "quota",
- "没有开通",
- "权限或余额"
- ]
- },
- {
- "responseField": "mess",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance",
- "quota",
- "没有开通",
- "权限或余额"
- ]
- },
- {
- "responseField": "message",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance",
- "没有开通",
- "权限或余额"
- ]
- }
- ],
- "matchMode": "any",
- "trigger": "tokenConfig.onBalanceInsufficient"
- },
- "unauthorized": {
- "conditions": [
- {
- "responseField": "code",
- "operator": "in",
- "value": [
- 401,
- 403
- ]
- },
- {
- "responseField": "msg",
- "operator": "contains",
- "value": [
- "unauthorized",
- "token",
- "invalid",
- "auth"
- ]
- }
- ],
- "matchMode": "any",
- "trigger": "tokenConfig.onMissing"
- }
- }
- }
|