开发文档
1688 API 参考:6 个操作
1688 API 参考文档:6 个操作各自的端点、各输入的默认值与取值范围(如有),以及每个操作返回的字段。
另见: 1688 批发市场 API 概览与价格 · 1688 API 指南:搜索与商品的采购流程
本页内容
1688 API 请求结构与共用输入
在 body 中适用以下规则:
- 也接受替代名称:
q和keyword代替body.query,offerId代替body.offer_id,categoryId代替body.category_id,pageNo代替body.page,lang代替body.language。 - 每个操作都接受
body.max_rotations,它设定一次调用在放弃之前最多尝试的次数。 body.max_rotations的值超出取值范围时会被拒绝,不会被自动调整。
除非调用过早放弃,否则让 body.max_rotations 保持默认值即可。
本节涉及的字段(2)
body, body.max_rotations
类目树:post-1688-categories
body.language 决定类目名称的语言:zh 按 1688 发布的中文原文返回名称,其他取值返回由 1688 自行翻译的名称,列表之外的值会被拒绝。无论选择哪种语言,每个节点都在 name_zh 中保留中文名称,可以直接用作中文搜索词。body.depth 决定返回的层级:
- 深度为 1 时返回 54 个一级类目
- 深度为 2 时增加中间层级
- 深度为 3 时返回完整类目树,约 2.4 MB
节点带有嵌套的 children 或只带 child_count,level 表示其所在层级,is_leaf 标记没有子类目的节点。节点的 id 就是类目商品中 body.category_id 应传入的值。
本节涉及的字段(4)
post-1688-categories, body.language, body.depth, body.category_id
类目商品:post-1688-category-offers
body.category_id 也可以取自关键词搜索结果行的类目 id。body.page 从 1 开始计数,大于 200 的页码会被拒绝。
一页的长度固定为 30 行,相邻两页之间没有重复的商品 id,因此可以逐页浏览一个类目,而不只是抽样;has_next 告诉客户端类目何时到底。每一行中:
fulfilment列出供应商的履约承诺certifications列出商品所带的跨境资质证书moq是起订量listed_on是商品的上架时间price以人民币计,旁边附有price_display
这些行是该类目未经推广的视图。
本节涉及的字段(3)
post-1688-category-offers, body.category_id, body.page
商品详情:post-1688-product-detail
body.offer_id 可以是商品 id 的数字,例如 864971848115,也可以是完整的商品链接;任何关键词搜索行或类目商品行的 id 都可以使用。
price 是以人民币计的数值,price_type 说明适用哪种价格:
- 为
rangePrice时,所有变体共用price_tiers中的一套数量阶梯价,每档给出min_qty、max_qty和price - 为
skuPrice时,每个变体在variants中有自己的价格
moq 给出带 unit 的起订量,stock 是可订购的总库存。mix 包含混批条件,sold_count 是已售数量。attributes 以 name 和 value 对的形式给出规格参数表,例如材质、品牌或型号。
seller 用会员 id、登录 id 和店铺 url 标识供应商公司。variants 列出颜色、尺码或规格维度,以及每个可售 SKU 各自的价格、库存和 weight_kg,供应商没有公布重量时该值为 null。
本节涉及的字段(2)
post-1688-product-detail, body.offer_id
买家评价:post-1688-product-reviews
post-1688-product-reviews 接受与商品详情相同的 body.offer_id。rating 是满分 5 分的平均星级数值,并附有 rating_scale;good_percent 是好评率数值,并附有 good_percent_display。review_count 附有 review_count_display,当 1688 将评价数显示为 100+ 时,review_count 是下限而不是确切总数。
reviews 包含一页单条评价,每条评价中:
content是评价正文buyer是由 1688 遮蔽的买家昵称quantity是购买数量spec是所选规格images是买家图片
该操作没有页码输入,每次调用都返回这一页。没有评价的商品会返回空列表和零计数,这是有效结果而不是错误。
本节涉及的字段(2)
post-1688-product-reviews, body.offer_id
关键词搜索:post-1688-search
body.query 接受自由文本:蓝牙耳机 这类中文搜索词返回的结果远比其他语言丰富,英文或拼音搜索词也能匹配。每个关键词的结果是约 20 个商品组成的一份短名单:没有页码输入,has_next 始终为 false,重复调用会返回轮换的选集,累计不同商品数趋于约 38 个。每一行中:
price是以人民币计的数值并带有unitattributes是卖家发布的名称与值对offer_repurchase_rate属于该商品自身,shop_repurchase_rate属于整个店铺seller给出公司名称和years_on_1688category_ids按从宽到细排列is_ad标记付费推广位;对多数关键词而言,每一行的该值都为 true
结果行不含起订量和阶梯价,需要时请调用商品详情。
本节涉及的字段(2)
post-1688-search, body.query
工厂搜索:post-1688-supplier-search
post-1688-supplier-search 查找生产某种商品的厂家,而不是销售该商品的商品条目。body.query 的表现与关键词搜索相同。
结果来自 1688 为该关键词维护的精选厂家短名单,而不是完整索引,因此返回的是寥寥几行而不是一整页。每一行中:
workers是工厂的工人数floor_area_sqm是以平方米计的厂房面积makes是工厂生产的产品medal与medal_level是工厂的金牌厂家奖牌及其等级reply_rate_30d是 30 天回复率third_party_audit表示工厂是否经 SGS 等机构审核offer_ids可以传给商品详情
items 为空列表表示该关键词的短名单中没有工厂;这是有效结果,重复相同的查询不会改变它。
本节涉及的字段(2)
post-1688-supplier-search, body.query
{
"body": {
"category_id": "1031910",
"page": 2
}
}{
"body": {
"language": "en",
"depth": 1
}
}操作
公共网关操作统一使用 POST /api/v1/{project}/{action}。
使用 JSON 对象,按文档将参数放入 path、query、headers 和 body,省略未使用的位置。input.headers 是供操作使用的 JSON 数据,不是浏览器请求头。请勿在此填写凭证。按文档保留 body 的数组、标量或 null;省略与 null 含义不同。
类目树
POST /api/v1/alibaba-1688/post-1688-categories
返回 1 到 3 层的 1688 类目节点,名称可选 9 种语言之一,并在每个节点旁保留中文原名。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.depth | integer | 可选 | 2 | — | 1–3 |
body.language | string | 可选 | "en" | "zh""en""ru""es""pt""fr""de""ja""ko" | — |
body.max_rotations | integer | 可选 | 4 | — | 1–8 |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/alibaba-1688/post-1688-categories' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"depth":1,"language":"ru"}}'响应字段
items[]idnamename_zhlevelis_leafchildren[]child_count
countlanguagedepth
类目商品
POST /api/v1/alibaba-1688/post-1688-category-offers
分页浏览某个 1688 类目下的商品,一页 30 条,最多 200 页;每行含人民币价格、起订量、上架日期、履约承诺和证书信息。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.category_id | string | 必填 | — | — | — |
body.max_rotations | integer | 可选 | 4 | — | 1–8 |
body.page | integer | 可选 | 1 | — | 1–200 |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/alibaba-1688/post-1688-category-offers' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"category_id":"1031910"}}'响应字段
items[]idtitleurlimagepriceprice_displaycurrencymoqlisted_onfulfilment[]certifications[]sales
countcategory_idpagehas_next
商品详情
POST /api/v1/alibaba-1688/post-1688-product-detail
针对一个商品 id 或链接,返回标题、图片、人民币价格与定价方式、数量阶梯价、起订量、库存、混批条件、属性、卖家信息以及各规格 SKU。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.offer_id | string | 必填 | — | — | — |
body.max_rotations | integer | 可选 | 4 | — | 1–8 |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/alibaba-1688/post-1688-product-detail' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"offer_id":"864971848115"}}'响应字段
idtitleurlimages[]priceprice_displaycurrencyunitprice_typeprice_tiers[]min_qtymax_qtypriceprice_display
moqquantityunit
stockmixsupportedmin_qtymin_amount
sold_countcategorytop_idpost_id
attributes[]namevalue
sellermember_iduser_idlogin_idnameurl
in_stockvariantsaxes[]namevalues[]
skus[]sku_idspecpricediscount_pricestocksold_countweight_kg
countprice_rangeprice_typeship_from_code
买家评价
POST /api/v1/alibaba-1688/post-1688-product-reviews
针对一个商品 id,返回满分 5 分的平均评分、好评率、评价数,以及一页包含正文、购买数量、规格、图片和日期的单条评价。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.offer_id | string | 必填 | — | — | — |
body.max_rotations | integer | 可选 | 4 | — | 1–8 |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/alibaba-1688/post-1688-product-reviews' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"offer_id":"864971848115"}}'响应字段
ratingrating_scalegood_percentgood_percent_displayreview_countreview_count_displayreviews[]contentbuyerquantityspecimages[]dateplus_user
关键词搜索
POST /api/v1/alibaba-1688/post-1688-search
按关键词搜索 1688 商品,返回约 20 个商品的短名单,每行含价格、卖家公司、两种复购率、属性、类目 id 和广告标记。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.query | string | 必填 | — | — | — |
body.max_rotations | integer | 可选 | 4 | — | 1–8 |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/alibaba-1688/post-1688-search' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"query":"蓝牙耳机"}}'响应字段
items[]idtitleurlimageimages[]videopriceprice_displaycurrencyunitsold_displayattributes[]namevalue
service_tags[]offer_repurchase_rateshop_repurchase_ratesellercompanylogin_idmember_idyears_on_1688
category_ids[]is_ad
countqueryquery_echohas_next
工厂搜索
POST /api/v1/alibaba-1688/post-1688-supplier-search
按关键词搜索 1688 精选的生产厂家名单,返回所在地、工人数、厂房面积、奖牌、回头率、准时率、验厂状态和商品 id。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.query | string | 必填 | — | — | — |
body.max_rotations | integer | 可选 | 4 | — | 1–8 |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/alibaba-1688/post-1688-supplier-search' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"query":"蓝牙耳机"}}'响应字段
items[]namemember_idurllocationyears_on_1688workersfloor_area_sqmmakes[]medalmedal_levelrepeat_buyer_rateon_time_ratereply_rate_30dthird_party_auditis_super_factoryoffer_ids[]
countquerynote
调用方式
- 使用
POST /api/v1/alibaba-1688/<action>,并携带x-api-key、Content-Type: application/json和必需的Idempotency-Key。 - 调用成功时返回
ok: true:data是操作的结果,meta.requestId标识已记录的请求,meta.chargedCreditUnits是实际扣费金额。否则ok为false,error.code说明原因;请读取ok和error.code,不要只依赖 HTTP 状态码。每个网关响应都带有供支持使用的请求 ID:meta.requestId;没有meta的响应(如受理前被拒绝)则为顶层requestId。 - 只有调用成功才按标价扣费。失败不扣费;结果无法确认时,最多 900 秒后释放,不扣费。
- 请求完成后,以同一个 Idempotency-Key 重复发送相同请求,24 小时内返回已保存的响应,不会再次扣费。
网关调用参考: