Skip to content

淘宝和天猫店铺详情 API (V1) ​

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

通过卖家ID和店铺ID检索淘宝店铺的主页信息、店铺分类和默认商品列表。可用于查看店铺并在查询商品前发现其分类。

使用提示 ​

使用说明 · 店铺分类与商品查询

将返回的店铺分类ID用作店铺商品列表 V5 中的catId。使用 V5 进行商品排序、筛选或分页。

请求参数 ​

参数名位置类型必填默认值说明
tokenquerystring是-此 API 服务的访问令牌。
sellerIdquerystring是-与店铺关联的淘宝卖家用户ID。
shopIdquerystring是-与卖家关联的淘宝店铺ID。

代码示例 ​

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

请求参数说明:
- token (query): 此 API 服务的访问令牌。 (必填)
- sellerId (query): 与店铺关联的淘宝卖家用户ID。 (必填)
- shopId (query): 与卖家关联的淘宝店铺ID。 (必填)

返回格式: 请根据实际 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/taobao/get-shop-detail/v1?token=YOUR_API_KEY&sellerId=VALUE&shopId=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/taobao/get-shop-detail/v1?token=YOUR_API_KEY&sellerId=VALUE&shopId=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/taobao/get-shop-detail/v1?token=YOUR_API_KEY&sellerId=VALUE&shopId=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/taobao/get-shop-detail/v1?token=YOUR_API_KEY&sellerId=VALUE&shopId=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/taobao/get-shop-detail/v1?token=YOUR_API_KEY&sellerId=VALUE&shopId=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)的主要返回字段。

店铺资料22 个字段

data.signInfoDTO

店铺资料、展示标识和公开评分。

字段类型说明
shopNamestring店铺的展示名称。
shopLogoUrlstring店铺标识随附的图片链接。
shopUrlstring店铺资料随附的店铺主页链接。
fansNumstring以展示文字返回的店铺粉丝数。
shopTagListarray店铺随附的展示标签。
shopTagList[]string店铺标签上的展示文字。
shopSignTagVOobject店铺标识及随附的文字和图片片段。
shopSignTagVO.tagListarray店铺资料中展示的标识项。
shopSignTagVO.tagList[].richTextListarray店铺标识包含的展示片段。
shopSignTagVO.tagList[].richTextList[].iconstring该标识片段随附的图标链接,可能缺省。
shopSignTagVO.tagList[].richTextList[].textstring该标识片段随附的文字,可能缺省。
endorseInfoobject店铺资料随附的推荐标识。
endorseInfo.textstring推荐标识上的展示文字。
licenseUrlstring展示的营业执照信息随附的链接。
licenseIconstring营业执照信息随附的图标链接。
businessIconUrlstring店铺经营标识随附的图片链接。
qualificationIconstring店铺资质标识随附的图片链接。
rankIconUrlstring店铺等级标识随附的图片链接。
bailIconUrlstring店铺展示的保证金信息随附的图片链接。
bailAmountstring以展示文字返回的店铺保证金金额。
ownerChangedboolean店铺资料是否带有经营者变更标记。
ownerChangePublicityUrlstring店铺经营者变更公告随附的链接,可能为空。
评分与对比6 个字段

data.signInfoDTO.evaluateList[]

店铺展示的评分项,可能包含多个评分维度。

字段类型说明
titlestring该评分维度的展示名称。
typestring以字符串返回的评分维度代码。
scorestring以字符串返回的评分。
levelstring店铺页面随附的评分等级标签。
starPicstring星级评分展示随附的图片链接,可能缺省。
peerComparisonInfostring该评分随附的同类店铺对比文字,可能缺省。
店铺分类5 个字段

data.categoryInfoDTOList[]

店铺展示的分类层级。

字段类型说明
categoryIdinteger该店铺分类返回的数字 ID。
categoryNamestring店铺分类的展示名称。
subCategoryInfoListarray当前店铺分类的下级分类。
subCategoryInfoList[].categoryIdinteger该店铺分类返回的数字 ID。
subCategoryInfoList[].categoryNamestring店铺分类的展示名称。
商品卡片38 个字段

data.itemInfoDTO.data[]

店铺结果返回的商品卡片。

字段类型说明
item_idstring商品卡片以字符串返回的商品 ID。
titlestring商品的展示标题。
auctionURLstring商品卡片随附的商品页链接。
pic_pathstring商品卡片随附的主图链接。
uprightImgstring商品卡片随附的竖版图片链接。
pricestring商品卡片中的标价字段,以字符串返回。
realSalesstring商品卡片随附的销量展示文字。
leafCategorystring商品卡片以字符串返回的末级分类 ID。
categorypstring商品卡片随附的分类标签。
priceShowobject商品卡片随附的展示价格信息。
priceShow.unitstring展示价格旁随附的金额单位或符号。
priceShow.pricestring商品卡片随附的展示价格文字。
priceShow.preTextstring展示价格前随附的文字,可能为空。
priceShow.priceDescstring商品卡片价格随附的展示标签。
priceShow.suffixTextstring展示价格后随附的文字,可能缺省。
skuThumbListarray商品卡片随附的 SKU 缩略项。
skuThumbList[].skuIdintegerSKU 缩略项返回的数字 SKU ID。
skuThumbList[].skuImageUrlstringSKU 缩略图链接。
skuThumbList[].skuPropertyTextstringSKU 缩略项随附的规格展示文字。
skuThumbList[].itemSkuUrlstring该 SKU 规格项随附的商品页链接。
hotListInfoobject商品随附的榜单标签,可能缺省。
hotListInfo.rank_short_textstring商品榜单随附的简短展示文字。
shopInfoobject商品卡片展示的店铺信息。
shopInfo.shopLogostring商品卡片随附的店铺标识图片链接。
shopInfo.titlestring商品卡片随附的店铺展示名称。
shopInfo.urlstring商品卡片随附的店铺页链接。
iconsarray商品卡片随附的展示标识。
icons[].textstring商品卡片标识随附的文字,可能缺省。
iconAbstractInfoobject商品卡片随附的摘要标识,可能缺省。
iconAbstractInfo.iconstring摘要标识随附的图片链接。
iconAbstractInfo.textstring摘要标识随附的展示文字。
secondKillInfoobject商品随附的限时优惠标识,可能缺省。
secondKillInfo.text1string限时优惠的第一项展示文字。
secondKillInfo.text3string限时优惠的补充展示文字。
secondKillInfo.iconUrlstring限时优惠随附的图标链接。
structuredUSPInfoarray商品卡片随附的商品属性名称和值。
structuredUSPInfo[].propertyNamestring商品属性的展示名称。
structuredUSPInfo[].propertyValueNamestring商品属性的展示值。
商品分页与榜单13 个字段

data

字段类型说明
moduleRankInfoDTOobject店铺随附的推荐榜单信息。
moduleRankInfoDTO.rankNamestring推荐榜单的展示名称。
moduleRankInfoDTO.resourceNamestring榜单模块随附的补充展示标签。
moduleRankInfoDTO.itemListarray推荐榜单中展示的商品。
moduleRankInfoDTO.itemList[].itemIdinteger榜单商品使用数字返回的商品 ID。
moduleRankInfoDTO.itemList[].imagestring榜单商品展示的图片链接。
moduleRankInfoDTO.itemList[].itemUrlstring榜单商品随附的商品页链接。
moduleRankInfoDTO.jumpUrlstring店铺页面随附的榜单链接。
itemInfoDTOobject店铺结果附带的商品卡片列表和分页信息。
itemInfoDTO.totalCntinteger随附列表中平台返回的商品总数。
itemInfoDTO.pageSizeinteger随附商品列表返回的每页条数。
itemInfoDTO.hasNextboolean随附商品列表是否标记还有下一页。
itemInfoDTO.pageinteger随附商品列表返回的页码。
店铺优惠与会员权益20 个字段

data.rightsInfoDTO

店铺展示的会员中心状态和优惠信息。

字段类型说明
hasMemberCenterboolean店铺是否标记有会员中心。
shopMemberCouponInfoDTOListarray店铺结果中展示的会员优惠券。
shopMemberCouponInfoDTOList[].amountstring以展示文字返回的优惠券金额。
shopMemberCouponInfoDTOList[].couponTypeinteger平台返回的优惠券类型码。
shopMemberCouponInfoDTOList[].startFeestring以字符串返回的优惠券使用金额门槛。
shopMemberCouponInfoDTOList[].startTimestring以字符串返回的优惠券开始时间。
shopMemberCouponInfoDTOList[].endTimestring以字符串返回的优惠券结束时间。
shopCouponInfoDTOListarray店铺结果中展示的店铺优惠券。
shopCouponInfoDTOList[].amountstring以展示文字返回的优惠券金额。
shopCouponInfoDTOList[].couponTypeinteger平台返回的优惠券类型码。
shopCouponInfoDTOList[].startFeestring以字符串返回的优惠券使用金额门槛。
shopCouponInfoDTOList[].startTimestring以字符串返回的优惠券开始时间。
shopCouponInfoDTOList[].endTimestring以字符串返回的优惠券结束时间。
shopMemberBenefitItemDTOListarray作为会员权益展示的商品优惠。
shopMemberBenefitItemDTOList[].benefitNamestring会员优惠的展示名称。
shopMemberBenefitItemDTOList[].benefitPricestring以展示文字返回的会员优惠价格。
shopMemberBenefitItemDTOList[].itemPicstring会员优惠商品展示的图片链接。
shopMemberBenefitItemDTOList[].itemUrlstring会员优惠商品展示的商品页链接。
shopMemberBenefitItemDTOList[].startTimestring以字符串返回的会员优惠开始时间。
shopMemberBenefitItemDTOList[].endTimestring以字符串返回的会员优惠结束时间。
店铺页面与直播14 个字段

data

淘宝店铺详情和店铺页面随附的公开商品卡片。

字段类型说明
globalInfoDTOobject店铺页面的公开展示和商品筛选信息。
globalInfoDTO.logoJumpUrlstring店铺标识随附的跳转链接。
globalInfoDTO.b2CShopboolean平台是否将该店铺标记为 B2C 店铺。
globalInfoDTO.hotSearchWordListarray店铺页面展示的推荐搜索词。
globalInfoDTO.hotSearchWordList[]string店铺页面展示的搜索词。
globalInfoDTO.filterInfoListarray店铺页面展示的商品筛选项。
globalInfoDTO.filterInfoList[].codestring店铺页面随附的筛选项代码。
globalInfoDTO.filterInfoList[].namestring该商品筛选项的展示名称。
globalInfoDTO.filterInfoList[].priorityinteger该筛选项随附的优先级数值。
globalInfoDTO.globalSearchUrlstring店铺页面随附的搜索页链接。
globalInfoDTO.logoUrlstring店铺标识的图片链接。
globalInfoDTO.inLiveboolean店铺页面是否带有正在直播的标记。
globalInfoDTO.liveIdinteger店铺直播时随附的数字直播 ID。
globalInfoDTO.liveUrlstring直播页面链接,可能缺省。

响应示例 ​

正在加载响应示例…