淘宝和天猫店铺详情 API (V1)
接口健康状态
健康 可用 少量可用 基本不可用 暂无数据
正在加载健康状态…
通过卖家ID和店铺ID检索淘宝店铺的主页信息、店铺分类和默认商品列表。可用于查看店铺并在查询商品前发现其分类。
使用提示
使用说明 · 店铺分类与商品查询
将返回的店铺分类ID用作店铺商品列表 V5 中的catId。使用 V5 进行商品排序、筛选或分页。
请求参数
| 参数名 | 位置 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|---|
token | query | string | 是 | - | 此 API 服务的访问令牌。 |
sellerId | query | string | 是 | - | 与店铺关联的淘宝卖家用户ID。 |
shopId | query | string | 是 | - | 与卖家关联的淘宝店铺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
店铺资料、展示标识和公开评分。
| 字段 | 类型 | 说明 |
|---|---|---|
shopName | string | 店铺的展示名称。 |
shopLogoUrl | string | 店铺标识随附的图片链接。 |
shopUrl | string | 店铺资料随附的店铺主页链接。 |
fansNum | string | 以展示文字返回的店铺粉丝数。 |
shopTagList | array | 店铺随附的展示标签。 |
shopTagList[] | string | 店铺标签上的展示文字。 |
shopSignTagVO | object | 店铺标识及随附的文字和图片片段。 |
shopSignTagVO.tagList | array | 店铺资料中展示的标识项。 |
shopSignTagVO.tagList[].richTextList | array | 店铺标识包含的展示片段。 |
shopSignTagVO.tagList[].richTextList[].icon | string | 该标识片段随附的图标链接,可能缺省。 |
shopSignTagVO.tagList[].richTextList[].text | string | 该标识片段随附的文字,可能缺省。 |
endorseInfo | object | 店铺资料随附的推荐标识。 |
endorseInfo.text | string | 推荐标识上的展示文字。 |
licenseUrl | string | 展示的营业执照信息随附的链接。 |
licenseIcon | string | 营业执照信息随附的图标链接。 |
businessIconUrl | string | 店铺经营标识随附的图片链接。 |
qualificationIcon | string | 店铺资质标识随附的图片链接。 |
rankIconUrl | string | 店铺等级标识随附的图片链接。 |
bailIconUrl | string | 店铺展示的保证金信息随附的图片链接。 |
bailAmount | string | 以展示文字返回的店铺保证金金额。 |
ownerChanged | boolean | 店铺资料是否带有经营者变更标记。 |
ownerChangePublicityUrl | string | 店铺经营者变更公告随附的链接,可能为空。 |
评分与对比6 个字段
data.signInfoDTO.evaluateList[]
店铺展示的评分项,可能包含多个评分维度。
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 该评分维度的展示名称。 |
type | string | 以字符串返回的评分维度代码。 |
score | string | 以字符串返回的评分。 |
level | string | 店铺页面随附的评分等级标签。 |
starPic | string | 星级评分展示随附的图片链接,可能缺省。 |
peerComparisonInfo | string | 该评分随附的同类店铺对比文字,可能缺省。 |
店铺分类5 个字段
data.categoryInfoDTOList[]
店铺展示的分类层级。
| 字段 | 类型 | 说明 |
|---|---|---|
categoryId | integer | 该店铺分类返回的数字 ID。 |
categoryName | string | 店铺分类的展示名称。 |
subCategoryInfoList | array | 当前店铺分类的下级分类。 |
subCategoryInfoList[].categoryId | integer | 该店铺分类返回的数字 ID。 |
subCategoryInfoList[].categoryName | string | 店铺分类的展示名称。 |
商品卡片38 个字段
data.itemInfoDTO.data[]
店铺结果返回的商品卡片。
| 字段 | 类型 | 说明 |
|---|---|---|
item_id | string | 商品卡片以字符串返回的商品 ID。 |
title | string | 商品的展示标题。 |
auctionURL | string | 商品卡片随附的商品页链接。 |
pic_path | string | 商品卡片随附的主图链接。 |
uprightImg | string | 商品卡片随附的竖版图片链接。 |
price | string | 商品卡片中的标价字段,以字符串返回。 |
realSales | string | 商品卡片随附的销量展示文字。 |
leafCategory | string | 商品卡片以字符串返回的末级分类 ID。 |
categoryp | string | 商品卡片随附的分类标签。 |
priceShow | object | 商品卡片随附的展示价格信息。 |
priceShow.unit | string | 展示价格旁随附的金额单位或符号。 |
priceShow.price | string | 商品卡片随附的展示价格文字。 |
priceShow.preText | string | 展示价格前随附的文字,可能为空。 |
priceShow.priceDesc | string | 商品卡片价格随附的展示标签。 |
priceShow.suffixText | string | 展示价格后随附的文字,可能缺省。 |
skuThumbList | array | 商品卡片随附的 SKU 缩略项。 |
skuThumbList[].skuId | integer | SKU 缩略项返回的数字 SKU ID。 |
skuThumbList[].skuImageUrl | string | SKU 缩略图链接。 |
skuThumbList[].skuPropertyText | string | SKU 缩略项随附的规格展示文字。 |
skuThumbList[].itemSkuUrl | string | 该 SKU 规格项随附的商品页链接。 |
hotListInfo | object | 商品随附的榜单标签,可能缺省。 |
hotListInfo.rank_short_text | string | 商品榜单随附的简短展示文字。 |
shopInfo | object | 商品卡片展示的店铺信息。 |
shopInfo.shopLogo | string | 商品卡片随附的店铺标识图片链接。 |
shopInfo.title | string | 商品卡片随附的店铺展示名称。 |
shopInfo.url | string | 商品卡片随附的店铺页链接。 |
icons | array | 商品卡片随附的展示标识。 |
icons[].text | string | 商品卡片标识随附的文字,可能缺省。 |
iconAbstractInfo | object | 商品卡片随附的摘要标识,可能缺省。 |
iconAbstractInfo.icon | string | 摘要标识随附的图片链接。 |
iconAbstractInfo.text | string | 摘要标识随附的展示文字。 |
secondKillInfo | object | 商品随附的限时优惠标识,可能缺省。 |
secondKillInfo.text1 | string | 限时优惠的第一项展示文字。 |
secondKillInfo.text3 | string | 限时优惠的补充展示文字。 |
secondKillInfo.iconUrl | string | 限时优惠随附的图标链接。 |
structuredUSPInfo | array | 商品卡片随附的商品属性名称和值。 |
structuredUSPInfo[].propertyName | string | 商品属性的展示名称。 |
structuredUSPInfo[].propertyValueName | string | 商品属性的展示值。 |
商品分页与榜单13 个字段
data
| 字段 | 类型 | 说明 |
|---|---|---|
moduleRankInfoDTO | object | 店铺随附的推荐榜单信息。 |
moduleRankInfoDTO.rankName | string | 推荐榜单的展示名称。 |
moduleRankInfoDTO.resourceName | string | 榜单模块随附的补充展示标签。 |
moduleRankInfoDTO.itemList | array | 推荐榜单中展示的商品。 |
moduleRankInfoDTO.itemList[].itemId | integer | 榜单商品使用数字返回的商品 ID。 |
moduleRankInfoDTO.itemList[].image | string | 榜单商品展示的图片链接。 |
moduleRankInfoDTO.itemList[].itemUrl | string | 榜单商品随附的商品页链接。 |
moduleRankInfoDTO.jumpUrl | string | 店铺页面随附的榜单链接。 |
itemInfoDTO | object | 店铺结果附带的商品卡片列表和分页信息。 |
itemInfoDTO.totalCnt | integer | 随附列表中平台返回的商品总数。 |
itemInfoDTO.pageSize | integer | 随附商品列表返回的每页条数。 |
itemInfoDTO.hasNext | boolean | 随附商品列表是否标记还有下一页。 |
itemInfoDTO.page | integer | 随附商品列表返回的页码。 |
店铺优惠与会员权益20 个字段
data.rightsInfoDTO
店铺展示的会员中心状态和优惠信息。
| 字段 | 类型 | 说明 |
|---|---|---|
hasMemberCenter | boolean | 店铺是否标记有会员中心。 |
shopMemberCouponInfoDTOList | array | 店铺结果中展示的会员优惠券。 |
shopMemberCouponInfoDTOList[].amount | string | 以展示文字返回的优惠券金额。 |
shopMemberCouponInfoDTOList[].couponType | integer | 平台返回的优惠券类型码。 |
shopMemberCouponInfoDTOList[].startFee | string | 以字符串返回的优惠券使用金额门槛。 |
shopMemberCouponInfoDTOList[].startTime | string | 以字符串返回的优惠券开始时间。 |
shopMemberCouponInfoDTOList[].endTime | string | 以字符串返回的优惠券结束时间。 |
shopCouponInfoDTOList | array | 店铺结果中展示的店铺优惠券。 |
shopCouponInfoDTOList[].amount | string | 以展示文字返回的优惠券金额。 |
shopCouponInfoDTOList[].couponType | integer | 平台返回的优惠券类型码。 |
shopCouponInfoDTOList[].startFee | string | 以字符串返回的优惠券使用金额门槛。 |
shopCouponInfoDTOList[].startTime | string | 以字符串返回的优惠券开始时间。 |
shopCouponInfoDTOList[].endTime | string | 以字符串返回的优惠券结束时间。 |
shopMemberBenefitItemDTOList | array | 作为会员权益展示的商品优惠。 |
shopMemberBenefitItemDTOList[].benefitName | string | 会员优惠的展示名称。 |
shopMemberBenefitItemDTOList[].benefitPrice | string | 以展示文字返回的会员优惠价格。 |
shopMemberBenefitItemDTOList[].itemPic | string | 会员优惠商品展示的图片链接。 |
shopMemberBenefitItemDTOList[].itemUrl | string | 会员优惠商品展示的商品页链接。 |
shopMemberBenefitItemDTOList[].startTime | string | 以字符串返回的会员优惠开始时间。 |
shopMemberBenefitItemDTOList[].endTime | string | 以字符串返回的会员优惠结束时间。 |
店铺页面与直播14 个字段
data
淘宝店铺详情和店铺页面随附的公开商品卡片。
| 字段 | 类型 | 说明 |
|---|---|---|
globalInfoDTO | object | 店铺页面的公开展示和商品筛选信息。 |
globalInfoDTO.logoJumpUrl | string | 店铺标识随附的跳转链接。 |
globalInfoDTO.b2CShop | boolean | 平台是否将该店铺标记为 B2C 店铺。 |
globalInfoDTO.hotSearchWordList | array | 店铺页面展示的推荐搜索词。 |
globalInfoDTO.hotSearchWordList[] | string | 店铺页面展示的搜索词。 |
globalInfoDTO.filterInfoList | array | 店铺页面展示的商品筛选项。 |
globalInfoDTO.filterInfoList[].code | string | 店铺页面随附的筛选项代码。 |
globalInfoDTO.filterInfoList[].name | string | 该商品筛选项的展示名称。 |
globalInfoDTO.filterInfoList[].priority | integer | 该筛选项随附的优先级数值。 |
globalInfoDTO.globalSearchUrl | string | 店铺页面随附的搜索页链接。 |
globalInfoDTO.logoUrl | string | 店铺标识的图片链接。 |
globalInfoDTO.inLive | boolean | 店铺页面是否带有正在直播的标记。 |
globalInfoDTO.liveId | integer | 店铺直播时随附的数字直播 ID。 |
globalInfoDTO.liveUrl | string | 直播页面链接,可能缺省。 |
响应示例
正在加载响应示例…