GEO-商品-保存
接口信息
- 接口地址:
{your-site-url}/api/skill/geo/product-save - 基础 URL:
{your-site-url}需替换为你自己的独立站 URL 地址,如https://your-domain.com/apimanager666 - 请求方式:
POST - Content-Type:
application/json - 说明: 创建或更新商品 GEO 数据。
认证
请求头中需要携带 skill-access-token:
| Header | 值 |
|---|---|
skill-access-token |
{your-skill-access-token} (请替换为你自己的 token) |
请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id |
int | 否 | 主键 ID。传入则按 ID 保存;不传则按 product_id 查找,存在则更新、不存在则创建 |
product_id |
int | 是 | 商品 ID。一个商品只允许存在一份 GEO 数据 |
language_code |
string | 否 | GEO 语言代码,缺省为 en |
summary |
string | 否 | AI 生成的商品简洁摘要,必须基于商品真实数据生成 |
semantic_content |
string | 否 | AI 生成的商品完整语义化正文 |
product_type |
string | 否 | 商品核心产品类型 |
category_path |
array[string] | 否 | AI 语义分类路径(JSON),建议 2-5 级 |
key_features |
array[string] | 否 | 商品核心特征(JSON) |
benefits |
array[string] | 否 | 商品实际价值(JSON) |
purchase_reasons |
array[string] | 否 | 用户选择该商品的理由(JSON) |
differentiators |
array[string] | 否 | 差异化特征(JSON),无信息可为空 |
applications |
array[string] | 否 | 适用行业、领域或应用方向(JSON) |
use_cases |
array[string] | 否 | 具体使用场景(JSON) |
solution_scenarios |
array[object] | 否 | 用户需求与商品解决方案对应关系(JSON) |
target_users |
array[string] | 否 | 目标用户或采购对象(JSON) |
product_attributes |
object | 否 | 通用商品语义属性(JSON) |
specifications |
object | 否 | 结构化商品规格(JSON) |
compatibility |
array[object] | 否 | 兼容性、适配性和使用条件(JSON) |
limitations |
array[string] | 否 | 已知限制、使用条件或能力边界(JSON) |
not_suitable_for |
array[string] | 否 | 明确不适用的用户、场景、设备或用途(JSON) |
commercial_info |
object | 否 | 商业和采购相关语义信息(JSON) |
faq |
array[object] | 否 | 商品 FAQ(JSON) |
search_terms |
array[string] | 否 | AI 检索语义数据(JSON) |
geo_score |
number | 否 | GEO 数据完整度评分(0-100) |
source_content_hash |
string | 否 | 生成 GEO 时商品源数据的内容 hash(最大长度 64) |
请求示例
cURL
curl --location --request POST '{your-site-url}/api/skill/geo/product-save' \
--header 'skill-access-token: {your-skill-access-token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"product_id": 10820,
"summary": "A cotton shirt dress designed with a comfortable fit and versatile style for daily wear.",
"semantic_content": "This product is a cotton shirt dress featuring a lightweight fabric, practical design, and comfortable wearing experience.",
"product_type": "Shirt Dress",
"category_path": ["Apparel", "Women's Clothing", "Dresses", "Shirt Dresses"],
"key_features": ["Cotton fabric", "Shirt-style design"],
"geo_score": 85.5,
"source_content_hash": "8f7a9d3e6c4b2a1f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b7a"
}'
返回结果
code 为 200 表示调用成功;code 不为 200 表示调用失败。
成功响应
{
"code": 200,
"data": {
"id": 2,
"shop_id": 359,
"product_id": 10820,
"language_code": "en",
"summary": "A cotton shirt dress designed with a comfortable fit and versatile style for daily wear.",
"product_type": "Shirt Dress",
"category_path": ["Apparel", "Women's Clothing", "Dresses", "Shirt Dresses"],
"key_features": ["Cotton fabric", "Shirt-style design"],
"geo_score": 85.5,
"source_content_hash": "8f7a9d3e6c4b2a1f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b7a",
"created_at": "2026-08-20 00:41:15",
"updated_at": "2026-08-20 21:54:09"
},
"message": "success"
}
返回字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
code |
int | 状态码,200 表示成功 |
message |
string | 执行结果的文字描述 |
data |
object | 保存后的商品 GEO 数据(字段同请求参数,并包含 id、shop_id、created_at、updated_at) |
注意事项
- 保存逻辑:如果传递了
id且不为空,则通过id保存;如果id为空,则通过product_id查询是否已存在数据,存在则更新、不存在则创建 product_id为必填,其余字段选填- 一个商品只允许存在一份 GEO 数据
返回
data中的 JSON 语义字段(category_path、key_features等)为已解析后的数组/对象product_id缺失时返回错误码100304007(product geo save fail | product_id can not empty)