Provides two tools for Xianyu product publishing operations.
Tool List
1. xianyu_publish_product - Publish a single product
Publish a single product to the Xianyu platform.
Parameters:
{
"cookie_id": "账号ID(必填)",
"title": "商品标题(可选,闲鱼页面没有标题输入框)",
"description": "商品描述(必填)",
"price": 99.99,
"images": ["图片路径1", "图片路径2"],
"category": "分类路径(可选)",
"location": "位置(可选)",
"original_price": 199.99,
"stock": 1
}
Example:
{
"cookie_id": "account_001",
"description": "全新未拆封的 iPhone 15 Pro,256GB,深空黑色。原价购买,因换新机出售。",
"price": 7999.00,
"images": ["/uploads/images/iphone1.jpg", "/uploads/images/iphone2.jpg"],
"category": "手机/数码",
"location": "北京市朝阳区",
"original_price": 8999.00,
"stock": 1
}
Returns:
{
"success": true,
"message": "商品发布成功",
"product": {
"title": "商品标题",
"price": 99.99
}
}
2. xianyu_batch_publish_products - Batch publish products
Batch publish multiple products to the Xianyu platform.
Parameters:
{
"cookie_id": "账号ID(必填)",
"products": [
{
"title": "商品1标题(可选)",
"description": "商品1描述(必填)",
"price": 99.99,
"images": ["图片路径1", "图片路径2"],
"category": "分类路径(可选)",
"location": "位置(可选)",
"original_price": 199.99,
"stock": 1
},
{
"title": "商品2标题(可选)",
"description": "商品2描述(必填)",
"price": 199.99,
"images": ["图片路径3", "图片路径4"]
}
]
}
Example:
{
"cookie_id": "account_001",
"products": [
{
"description": "全新 AirPods Pro 2,未拆封。",
"price": 1599.00,
"images": ["/uploads/images/airpods1.jpg"],
"original_price": 1899.00
},
{
"description": "二手 iPad Air 5,128GB,成色 95 新。",
"price": 3999.00,
"images": ["/uploads/images/ipad1.jpg", "/uploads/images/ipad2.jpg"],
"original_price": 4799.00
}
]
}
Returns:
{
"success": true,
"message": "批量发布完成: 成功 2/2",
"results": {
"total": 2,
"success": 2,
"failed": 0,
"details": [
{
"index": 0,
"success": true,
"message": "发布成功"
},
{
"index": 1,
"success": true,
"message": "发布成功"
}
]
}
}
Usage Flow
Publish a single product
- Prepare product information (description, price, images, etc.)
- Call the
xianyu_publish_producttool - Wait for the publishing result
Batch publish products
- Prepare a list of multiple product information entries
- Call the
xianyu_batch_publish_productstool - View the batch publishing result statistics
Notes
- cookie_id: Must be a valid Xianyu account ID, and the account Cookie must be valid
- description: The product description is required; it is recommended to describe the product condition, specifications, and other information in detail
- price: The price must be greater than 0
- images: List of image paths; it is recommended to upload at least 1 image
- title: The Xianyu page has no title input box, so this field is optional
- Permissions: The user must be logged in and have operation permissions for the corresponding account
API Endpoints
- Single publish:
POST /api/products/publish - Batch publish:
POST /api/products/batch-publish
Configuration
channels:
xianyu:
tools:
product: true # 默认启用
Permission Requirements
- The user must be logged in
- The user must have operation permissions for the corresponding account
- The account Cookie must be valid