Skip to content

1688商品详情 API (V1) ​

GET
接口健康状态
健康 可用 少量可用 基本不可用 暂无数据
正在加载健康状态…

通过商品ID获取1688批发商品的公开详情。用于在产品采购或目录研究时审查已知报价。

请求参数 ​

参数名位置类型必填默认值说明
tokenquerystring是-此 API 服务的访问令牌。
itemIdquerystring是-1688上的唯一商品标识符。

代码示例 ​

bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/1688/get-item-detail/v1?token=YOUR_API_KEY&itemId=VALUE'
text
我想使用 JustOneAPI 提供的“商品详情 (V1)”接口。
接入地址: https://api.justoneapi.com。
接口路径: /api/1688/get-item-detail/v1?token=YOUR_API_KEY&itemId=VALUE
接口地址: BASE_URL + /api/1688/get-item-detail/v1?token=YOUR_API_KEY&itemId=VALUE
HTTP 方法: GET
身份验证: 在 URL 中传入 token 查询参数。
OpenAPI 定义: https://docs.justoneapi.com/openapi/1688/product-details-v1-zh.json

请求参数说明:
- token (query): 此 API 服务的访问令牌。 (必填)
- itemId (query): 1688上的唯一商品标识符。 (必填)

返回格式: 请根据实际 Content-Type 安全处理 JSON 或文本响应。

响应处理与错误码:
1. 需通过返回体中的 "code" 字段判断业务结果(code 为 0 表示成功)。
2. 超时建议:建议将请求超时时间设置为 120 秒;如果 120 秒偏长,请至少设置为 60 秒,但可能会有少量请求因超时而未接收到结果。
3. 业务码说明:
   - 0: 成功
   - 100: Token 无效或已失效
   - 301: 采集失败,请重试
   - 302: 超出速率限制
   - 303: 超出每日配额
   - 400: 参数错误
   - 500: 内部服务器错误
   - 600: 权限不足
   - 601: 账户余额不足
   - 602: TOKEN 限额超限
4. code 601 表示账户共享余额不足。code 602 表示当前 API TOKEN 自身的累计消费上限已达到。TOKEN 限额不是资金划拨,多个 TOKEN 仍共享同一个账户余额。

请帮我用我擅长的编程语言写一个脚本来调用这个接口,并处理返回结果。
python
import requests

BASE_URL = "https://api.justoneapi.com"  # 由 OpenAPI servers 提供

url = BASE_URL + "/api/1688/get-item-detail/v1?token=YOUR_API_KEY&itemId=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
    content_type = response.headers.get("content-type", "").lower()
    if "json" in content_type:
        try:
            print(response.json())
        except ValueError:
            print(response.text)
    elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
        print(response.text)
    else:
        with open("response.bin", "wb") as output:
            output.write(response.content)
        print(f"Saved {len(response.content)} bytes to response.bin")
js
const BASE_URL = "https://api.justoneapi.com"; // 由 OpenAPI servers 提供
const url = BASE_URL + "/api/1688/get-item-detail/v1?token=YOUR_API_KEY&itemId=VALUE";

const response = await fetch(url, {
  method: "GET",
  signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
  const contentType = (response.headers.get("content-type") || "").toLowerCase();
  const mediaType = contentType.split(";", 1)[0].trim();
  const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
  if (textual) {
    const responseText = new TextDecoder().decode(responseBytes);
    let data = responseText;
    if (contentType.includes("json")) {
      try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
    }
    console.log(data);
  } else {
    console.log(`Received ${responseBytes.byteLength} binary bytes`);
  }
}
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void main(String[] args) throws Exception {
        final String BASE_URL = "https://api.justoneapi.com"; // 由 OpenAPI servers 提供
        final String url = BASE_URL + "/api/1688/get-item-detail/v1?token=YOUR_API_KEY&itemId=VALUE";

        HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
        HttpRequest.Builder builder = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(120))
            .method("GET", HttpRequest.BodyPublishers.noBody());

        HttpRequest request = builder.build();

        HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
        System.out.println(response.statusCode());
        String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
        String mediaType = contentType.split(";", 2)[0].trim();
        if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
            System.out.println(new String(response.body(), StandardCharsets.UTF_8));
        } else {
            Files.write(Path.of("response.bin"), response.body());
            System.out.println("Saved " + response.body().length + " bytes to response.bin");
        }
    }
}
go
package main

import (
	"fmt"
	"io"
	"os"
	"strings"
	"net/http"
	"time"
)

const BASE_URL = "https://api.justoneapi.com" // 由 OpenAPI servers 提供

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/1688/get-item-detail/v1?token=YOUR_API_KEY&itemId=VALUE"
	req, _ := http.NewRequest("GET", url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	fmt.Println(resp.StatusCode)
	bodyBytes, _ := io.ReadAll(resp.Body)
	contentType := strings.ToLower(resp.Header.Get("Content-Type"))
	mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
	if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
		fmt.Println(string(bodyBytes))
	} else {
		os.WriteFile("response.bin", bodyBytes, 0600)
		fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
	}
}
php
<?php
$BASE_URL = 'https://api.justoneapi.com'; // 由 OpenAPI servers 提供
$url = $BASE_URL . '/api/1688/get-item-detail/v1?token=YOUR_API_KEY&itemId=VALUE';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
    echo $response;
} else {
    file_put_contents('response.bin', $response);
    echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}

返回字段 ​

业务成功时(code = 0)的主要返回字段。

商品与店铺15 个字段

data

以下字段适用于对象类型的 data,描述查询的 1688 商品。接口调用成功但未返回商品详情时,data 可能为空字符串。

字段类型说明
itemobject商品基本信息及商家的店铺展示资料。
item.offerIdstring1688 商品 ID,以文本返回。
item.offerTitlestring商品的展示标题。
item.companyNamestring商家展示的企业名称。
item.winportUrlstring商家展示的店铺链接。
item.defaultOfferImgstring商品默认展示图片的链接。
item.offerUnitstring商品展示的销售单位。
item.saleOutboolean商品是否标记为售罄。
item.pricestring商品概要返回的价格展示文本。
item.saledCountinteger商品信息返回的销量。
item.saledCountStrstring商品返回的销量展示文本。
item.topCategoryIdstring商品返回的顶级类目 ID,以文本返回。
item.postCategoryIdstring商品返回的发布类目 ID,以文本返回。
item.businessTypestring该商品条目返回的业务类型标签。
item.consignOfferboolean商品条目是否标记为分销商品。
商品图与视频45 个字段

data

字段类型说明
mainPicobject使用此媒体布局时返回的商品图片组。
mainPic.offerIdstring1688 商品 ID,以文本返回。
mainPic.isPrivacyboolean媒体组是否标记为私密。
mainPic.videoUrlstring媒体组返回的视频链接,可能为空字符串。
mainPic.videoIdinteger媒体组返回的数字视频 ID。
mainPic.offerImgListarray该媒体组中的商品图片链接。
mainPic.offerImgList[]string媒体组中一张商品图片的链接。
mainPic.offerImagesarray带类型标记的商品图片。
mainPic.offerImages[]object该商品媒体组中的一张图片。
mainPic.offerImages[].imgUrlstring商品图片链接。
mainPic.offerImages[].typestring商品图片类型代码,以文本返回。
mainPic.offerImages[].typeDesstring商品图片类型的展示描述。
mainPic.offerInfoModelobject该媒体组附带的商品概要。
mainPic.offerInfoModel.offerIdinteger1688 商品 ID,以整数返回。
mainPic.offerInfoModel.titlestring媒体组返回的商品标题。
mainPic.offerInfoModel.pricestring媒体组返回的价格展示文本。
mainPic.skuImagesarray与 SKU 规格选项名称关联的图片。
mainPic.skuImages[]object一张 SKU 规格选项图片。
mainPic.skuImages[].imgUrlstringSKU 规格选项图片链接。
mainPic.skuImages[].namestring与该图片关联的 SKU 规格选项展示名称。
mainPic.skuImages[].typestringSKU 规格选项图片的类型代码。
videoobject视频媒体组。当商品媒体通过 mainPic 返回时,此对象可能为空。
video.offerIdstring1688 商品 ID,以文本返回。
video.isPrivacyboolean媒体组是否标记为私密。
video.videoUrlstring媒体组返回的视频链接,可能为空字符串。
video.videoIdinteger媒体组返回的数字视频 ID。
video.offerImgListarray该媒体组中的商品图片链接。
video.offerImgList[]string媒体组中一张商品图片的链接。
video.offerImagesarray带类型标记的商品图片。
video.offerImages[]object该商品媒体组中的一张图片。
video.offerImages[].imgUrlstring商品图片链接。
video.offerImages[].typestring商品图片类型代码,以文本返回。
video.offerImages[].typeDesstring商品图片类型的展示描述。
video.offerInfoModelobject该媒体组附带的商品概要。
video.offerInfoModel.offerIdinteger1688 商品 ID,以整数返回。
video.offerInfoModel.titlestring媒体组返回的商品标题。
video.offerInfoModel.pricestring媒体组返回的价格展示文本。
imagesarray商品图片条目及其不同规格的链接。
images[]object一项商品图片。
images[].imageURIstring商品图片返回的主链接。
images[].fullPathImageURIstring商品图片返回的完整链接。
images[].size220x220ImageURIstring220×220 规格字段返回的图片链接。
images[].size310x310ImageURIstring310×310 规格字段返回的图片链接。
images[].searchImageURIstring搜索展示使用的图片链接。
images[].summImageURIstring商品返回的摘要图链接。
商品描述与属性23 个字段

data

字段类型说明
titleobject商品标题和展示标签。
title.offerIdinteger1688 商品 ID,以整数返回。
title.titlestring商品页标题区显示的标题。
title.selledNumberstring标题附近展示的销量文本。
title.wantBuystring标题附近展示的购买意向文字,有数据时返回。
title.tagListarray标题附近展示的标签,数组可能为空。
title.tagList[]string商品展示标签的文本。
title.scrollListarray商品标题区返回的滚动展示文本。
title.scrollList[]object标题区的一项展示文字。
title.scrollList[].prefixstring主体标签之前展示的文字。
title.scrollList[].textstring标题区该展示条目的主体文字。
title.scrollList[].suffixstring主体标签之后展示的文字。
descriptionobject商品详情描述信息。
description.detailUrlstring商品扩展详情描述的平台链接。
description.isUseNewDetailboolean商品详情描述是否使用较新的详情格式。
attributeobject商品属性及其展示值。
attribute.offerIdinteger1688 商品 ID,以整数返回。
attribute.titlestring商品属性区展示的标题。
attribute.propsListarray商品展示的属性名称和值。
attribute.propsList[]object一项展示的商品属性。
attribute.propsList[].namestring商品属性的展示名称。
attribute.propsList[].valuestring商品属性的展示值。
attribute.propsList[].showboolean该属性是否标记为展示。
价格与数量阶梯18 个字段

data

字段类型说明
priceobject商品价格、展示单位和数量阶梯。
price.displayTypestring商品返回的价格展示类型标签。
price.unitstring商品价格旁展示的单位。
price.priceModelobject商品按数量返回的价格阶梯。
price.priceModel.priceDisplayTypestring价格模型中的展示类型代码。
price.priceModel.currentPricesarray按订购数量返回的当前价格阶梯。
price.priceModel.currentPrices[]object一个起订数量对应的价格档位。
price.priceModel.currentPrices[].pricestring该数量档位的价格,以展示文本返回。
price.priceModel.currentPrices[].beginAmountinteger该价格档位对应的起订数量。
price.priceModel.originalPricesarray按订购数量返回的原价阶梯,有数据时返回。
price.priceModel.originalPrices[]object一个起订数量对应的价格档位。
price.priceModel.originalPrices[].pricestring该数量档位的价格,以展示文本返回。
price.priceModel.originalPrices[].beginAmountinteger该价格档位对应的起订数量。
price.priceModel.originalPriceDisplaystring原价展示文本,有数据时返回。
price.priceModel.currentPricesWithOnePiecearray包含单件价格的当前数量阶梯,有数据时返回。
price.priceModel.currentPricesWithOnePiece[]object一个起订数量对应的价格档位。
price.priceModel.currentPricesWithOnePiece[].pricestring该数量档位的价格,以展示文本返回。
price.priceModel.currentPricesWithOnePiece[].beginAmountinteger该价格档位对应的起订数量。
优惠券与促销27 个字段

data

字段类型说明
couponobject | array有数据时返回优惠券信息。此字段也可能返回空数组。
coupon.offerIdinteger1688 商品 ID,以整数返回。
coupon.buttonNamestring优惠券操作按钮的展示文字。
coupon.pageNamestring优惠券区域的展示名称。
coupon.couponRuleLinkTextstring优惠券规则链接的展示文字。
coupon.couponListarray商品条目附带的优惠券标签。
coupon.couponList[]object一项优惠券展示标签。
coupon.couponList[].couponTypestring该优惠券返回的类型代码。
coupon.couponList[].couponContentstring该优惠券的展示文字。
coupon.couponInfoListarray优惠券的详细展示组,有数据时返回。
coupon.couponInfoList[]object一组优惠券详细展示信息。
coupon.couponInfoList[].namestring优惠券分组的展示名称。
coupon.couponInfoList[].summarystring优惠券分组的展示摘要。
coupon.couponInfoList[].buttonNamestring优惠券分组操作按钮的展示文字。
coupon.couponInfoList[].typestring优惠券分组返回的类型代码。
coupon.couponInfoList[].promotionItemsarray该优惠券展示组内的促销条目。
coupon.couponInfoList[].promotionItems[]object一项优惠券促销条目。
coupon.couponInfoList[].promotionItems[].summarystring促销活动展示的摘要。
coupon.couponInfoList[].promotionItems[].labelstring促销活动返回的展示标签。
coupon.couponInfoList[].promotionItems[].promotionDisplayNamestring优惠券中展示的促销活动名称。
coupon.couponInfoList[].promotionItems[].availablePeriodstring促销活动展示的可用时段。
coupon.couponInfoList[].promotionItems[].startTimestring促销开始时间,以文本返回。
coupon.couponInfoList[].promotionItems[].endTimestring促销结束时间,以文本返回。
coupon.couponInfoList[].promotionItems[].detailstring促销活动的详细展示文字。
coupon.couponInfoList[].promotionItems[].discountFeestring折扣金额,以展示文本返回。
coupon.couponInfoList[].promotionItems[].appliedboolean促销活动是否标记为已应用。
coupon.couponInfoList[].promotionItems[].canApplyboolean促销活动是否标记为可应用。
配送与保障30 个字段

data

字段类型说明
deliveryobject商品条目返回的发货与买家保障信息。
delivery.offerIdinteger1688 商品 ID,以整数返回。
delivery.locationstring商品展示的发货地。
delivery.logisticsstring商品返回的物流展示文本。
delivery.deliveryLimitTxtstring发货或送达承诺的展示文本。
delivery.postFreeboolean本次响应是否将运费标记为免费。
delivery.postFeeValueinteger该商品条目返回的数字运费值。
delivery.templateIdinteger返回的运费模板标识。
delivery.unitWeightinteger发货信息返回的单位重量值。
delivery.skuWeightobject以返回的 SKU 标识为键的重量值。
delivery.skuWeight.{key}number该 SKU 键对应的重量值。
delivery.deliveryLimitTimeModelobject该商品条目返回的发货时效承诺详情。
delivery.deliveryLimitTimeModel.limitTimeDayinteger发货时效限制返回的天数。
delivery.deliveryLimitTimeModel.limitTimeDescstring发货时效限制的展示说明。
delivery.deliveryLimitTimeModel.expectTimeDescstring预计发货时间的展示说明。
delivery.protectionInfosarray发货信息中的保障服务。
delivery.protectionInfos[]object一项展示的服务或保障。
delivery.protectionInfos[].serviceNamestring服务的展示名称。
delivery.protectionInfos[].serviceCodestring服务返回的代码。
delivery.protectionInfos[].descriptionstring保障服务的展示说明。
delivery.protectionInfos[].longDescriptionstring保障服务的详细说明。
delivery.protectionInfos[].buyerDescriptionstring面向买家的保障服务说明。
delivery.protectionInfos[].agreeDeliveryHoursinteger返回的约定时效,单位为小时。
delivery.buyerProtectionModelarray发货信息中另行展示的买家保障条目。
delivery.buyerProtectionModel[]object一项展示的服务或保障。
delivery.buyerProtectionModel[].serviceNamestring服务的展示名称。
delivery.buyerProtectionModel[].serviceCodestring服务返回的代码。
delivery.buyerProtectionModel[].enabledboolean买家保障条目是否标记为启用。
delivery.buyerProtectionModel[].shortBuyerDescstring面向买家的简短说明。
delivery.buyerProtectionModel[].textDescstring买家保障条目的展示说明。
商品服务与购买方式21 个字段

data

字段类型说明
serviceobject商品展示的服务及说明。
service.offerIdinteger1688 商品 ID,以整数返回。
service.service1string商品返回的第一项服务展示文字。
service.service2string第二项服务展示文字,有数据时返回。
service.service3string第三项服务展示文字,有数据时返回。
service.serviceDetailarray已展示服务的详细信息。
service.serviceDetail[]object一项展示的服务或保障。
service.serviceDetail[].serviceNamestring服务的展示名称。
service.serviceDetail[].serviceCodestring服务返回的代码。
service.serviceDetail[].descriptionstring服务展示的说明。
service.serviceDescarray商品条目附带的服务说明项。
service.serviceDesc[]object一项展示的服务或保障。
service.serviceDesc[].serviceNamestring服务的展示名称。
service.serviceDesc[].serviceCodestring服务返回的代码。
service.serviceDesc[].typestring服务说明项返回的类型标签。
orderobject商品条目展示的购买方式。
order.sceneListarray商品展示的购买方式。
order.sceneList[]object一项展示的购买选项。
order.sceneList[].sceneNamestring购买方式的展示名称。
order.selectedSceneobject商品条目中标记为已选的购买方式。
order.selectedScene.sceneNamestring已选购买方式的展示名称。

响应示例 ​

正在加载响应示例…