# KK货源 · 买家 / 只读 Agent 规范

> 版本：2026-09-17 v7.3 · 主站：https://kk666.cn  
> 摘要页：https://kk666.cn/for-agent · 发现文件：https://kk666.cn/llms.txt  
> 供应商写入规范（须 API Key）：https://kk666.cn/KK-openAi.md

**读者**：帮采购找货、比价、打开商品页的只读 Agent。  
**不要**申请商户 API Key，**不要**调用 `/api/open/products` 写接口。

---

## Base

- Base URL：`https://kk666.cn/api`
- 认证：公开目录 **无需 Key**
- 查询字符串必须 URL-encode（例：`?keyword=%E7%AB%A5%E9%9E%8B`）

## 可用接口

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | `/api/public/products` | 列表。默认 `page_size=40`（1–200）。`keyword` / `code` / `category` / `town` / `tag` / `sort` / `focus=clearance\|shop_featured` |
| GET | `/api/public/products/{code}` | 详情。`code` 是前台 slug；纯数字且 slug 未命中时回落内部 `id`。含 `skus[]`（颜色/尺码/库存/价） |
| GET | `/api/public/products/{id}/skus/` | 仅 SKU 矩阵（与详情 `skus` 同源） |
| GET | `/api/open/categories` | 平台类目树，**可匿名** |
| GET | `/api/public/policies/merchant-listing-rules` | 上架规范：允许授权导入，禁止未授权爬取 |

商品页：`https://kk666.cn/product/{code}`。列表字段 `id` 用于开放写路径；前台链接用 `code`。

## 禁止

- 把未授权爬取的公网商品写入本平台
- 用 `/api/products`（JWT 后台路由）代替公开接口
- 把只读任务做成商户开放 API 接入（那是 https://kk666.cn/ai-agent ）

## 错误体

FastAPI 风格：`{"detail":"..."}`。公开详情 404 表示不存在或已下架。
