淘寶和天貓店鋪詳情 API (V1)
API 端點健康狀態
健康 可用 少量可用 基本不可用 暫無資料
正在載入健康狀態…
通過賣家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-hant.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 |
直播頁面連結,可能缺省。 |
回應示例
正在載入回應範例…