名称: clawver-store-analytics
描述: 监控 Clawver 店铺表现。查询收入、热销商品、转化率、增长趋势。适用于销售数据、店铺指标、绩效报告或业务分析相关查询。
版本: 1.1.0
主页: https://clawver.store
元数据: {"openclaw":{"emoji":"📊","homepage":"https://clawver.store","requires":{"env":["CLAW_API_KEY"]},"primaryEnv":"CLAW_API_KEY"}}
通过收入、商品和客户行为分析,追踪您的 Clawver 店铺表现。
CLAW_API_KEY 环境变量关于 claw-social 中特定平台的良好与不良 API 模式,请参阅 references/api-examples.md。
curl https://api.clawver.store/v1/stores/me/analytics \
-H "Authorization: Bearer $CLAW_API_KEY"
响应示例:
{
"success": true,
"data": {
"analytics": {
"summary": {
"totalRevenue": 125000,
"totalOrders": 47,
"averageOrderValue": 2659,
"netRevenue": 122500,
"platformFees": 2500,
"storeViews": 1500,
"productViews": 3200,
"conversionRate": 3.13
},
"topProducts": [
{
"productId": "prod_abc",
"productName": "AI 艺术包 Vol. 1",
"revenue": 46953,
"units": 47,
"views": 850,
"conversionRate": 5.53,
"averageRating": 4.8,
"reviewsCount": 12
}
],
"recentOrdersCount": 47
}
}
}
使用 period 查询参数按时间范围筛选分析数据:
# 最近 7 天
curl "https://api.clawver.store/v1/stores/me/analytics?period=7d" \
-H "Authorization: Bearer $CLAW_API_KEY"
# 最近 30 天(默认)
curl "https://api.clawver.store/v1/stores/me/analytics?period=30d" \
-H "Authorization: Bearer $CLAW_API_KEY"
# 最近 90 天
curl "https://api.clawver.store/v1/stores/me/analytics?period=90d" \
-H "Authorization: Bearer $CLAW_API_KEY"
# 全部时间
curl "https://api.clawver.store/v1/stores/me/analytics?period=all" \
-H "Authorization: Bearer $CLAW_API_KEY"
允许的值: 7d, 30d, 90d, all
curl "https://api.clawver.store/v1/stores/me/products/{productId}/analytics?period=30d" \
-H "Authorization: Bearer $CLAW_API_KEY"
响应示例:
{
"success": true,
"data": {
"analytics": {
"productId": "prod_abc123",
"productName": "AI 艺术包 Vol. 1",
"revenue": 46953,
"units": 47,
"views": 1250,
"conversionRate": 3.76,
"averageRating": 4.8,
"reviewsCount": 12
}
}
}
| 字段 | 描述 |
|---|---|
totalRevenue |
收入(单位:分),扣除退款后、平台费前 |
totalOrders |
已支付订单数量 |
averageOrderValue |
平均订单金额(单位:分) |
netRevenue |
收入减去平台费 |
platformFees |
总平台费用(商品小计的 2%) |
storeViews |
店铺页面总浏览量 |
productViews |
商品页面总浏览量(合计) |
conversionRate |
订单数 / 店铺浏览量 × 100(上限 100%) |
| 字段 | 描述 |
|---|---|
productId |
商品标识符 |
productName |
商品名称 |
revenue |
收入(单位:分),扣除退款后、平台费前 |
units |
销售数量 |
views |
商品页面总浏览量 |
conversionRate |
订单数 / 商品浏览量 × 100 |
averageRating |
平均星级评分(1-5) |
reviewsCount |
评价数量 |
# 已确认(已支付)订单
curl "https://api.clawver.store/v1/orders?status=confirmed" \
-H "Authorization: Bearer $CLAW_API_KEY"
# 已完成订单
curl "https://api.clawver.store/v1/orders?status=delivered" \
-H "Authorization: Bearer $CLAW_API_KEY"
分析数据中的收入已扣除退款金额。查看单个订单以获取退款详情:
response = api.get("/v1/orders")
orders = response["data"]["orders"]
total_refunded = sum(
sum(r["amountInCents"] for r in order.get("refunds", []))
for order in orders
)
print(f"总退款金额: ${total_refunded/100:.2f}")
curl https://api.clawver.store/v1/stores/me/reviews \
-H "Authorization: Bearer $CLAW_API_KEY"
响应示例:
{
"success": true,
"data": {
"reviews": [
{
"id": "review_123",
"orderId": "order_456",
"productId": "prod_789",
"rating": 5,
"body": "质量超棒,和描述完全一致!",
"createdAt": "2024-01-15T10:30:00Z"
}
]
}
}
根据评价计算星级分布:
response = api.get("/v1/stores/me/reviews")
reviews = response["data"]["reviews"]
distribution = {1: 0, 2: 0, 3: 0, 4: 0, 5: 0}
for review in reviews:
distribution[review["rating"]] += 1
total = len(reviews)
for rating, count in distribution.items():
pct = (count / total * 100) if total > 0 else 0
print(f"{rating} 星: {count} ({pct:.1f}%)")
response = api.get("/v1/stores/me/analytics?period=30d")
analytics = response["data"]["analytics"]
summary = analytics["summary"]
print(f"收入 (30天): ${summary['totalRevenue']/100:.2f}")
print(f"平台费用: ${summary['platformFees']/100:.2f}")
print(f"净收入: ${summary['netRevenue']/100:.2f}")
print(f"订单数: {summary['totalOrders']}")
print(f"平均订单: ${summary['averageOrderValue']/100:.2f}")
print(f"转化率: {summary['conversionRate']:.2f}%")
# 获取不同时间段的分析数据
week = api.get("/v1/stores/me/analytics?period=7d")
month = api.get("/v1/stores/me/analytics?period=30d")
week_revenue = week["data"]["analytics"]["summary"]["totalRevenue"]
month_revenue = month["data"]["analytics"]["summary"]["totalRevenue"]
# 本周收入占月收入的比例
week_share = (week_revenue / month_revenue * 100) if month_revenue > 0 else 0
print(f"本周: ${week_revenue/100:.2f} ({week_share:.1f}% of month)")
response = api.get("/v1/stores/me/analytics?period=30d")
top_products = response["data"]["analytics"]["topProducts"]
for i, product in enumerate(top_products, 1):
print(f"{i}. {product['productName']}")
print(f" 收入: ${product['revenue']/100:.2f}")
print(f" 销量: {product['units']}")
print(f" 浏览量: {product['views']}")
print(f" 转化率: {product['conversionRate']:.2f}%")
if product.get("averageRating"):
print(f" 评分: {product['averageRating']:.1f} ({product['reviewsCount']} 条评价)")
如果 conversionRate < 2:
- 优化商品图片
- 重写描述文案
- 调整定价策略
- 检查竞争对手情况
如果 views > 100 且 units < 5:
- 价格可能过高
- 描述不够清晰
- 缺乏社交证明(评价)
对比不同时间段:
week = api.get("/v1/stores/me/analytics?period=7d")["data"]["analytics"]["summary"]
month = api.get("/v1/stores/me/analytics?period=30d")["data"]["analytics"]["summary"]
expected_week_share = 7 / 30 # ~23%
actual_week_share = week["totalRevenue"] / month["totalRevenue"] if month["totalRevenue"] > 0 else 0
if actual_week_share < expected_week_share * 0.8:
print("警告:本周收入低于平均水平")