TaobaoとTmall 商品詳細 API (V11)
APIの健康状態
正常 利用可能 限られた数 ほとんど利用できない データなし
健康状態を読み込んでいます...
商品IDごとにTaobaoの商品詳細を取得します。カタログ調査や監視のために商品情報を検索するのに使用します。
ハイライト
機能 · 製品カバレッジ
商品IDによるすべてのTaobao製品の詳細検索をサポートします。
機能 · 価格
利用可能な場合、表示される製品価格とSKU価格を提供します。
機能 · SKUオプション
SKU識別子、仕様オプション、報告された在庫量を提供します。
機能 · 商品の画像と動画
利用可能な場合、製品画像とビデオを提供します。
機能 · 配送
利用可能な場合、配送元と表示される郵便料金を提供します。
パラメータ
| 名前 | パラメーターの場所 | タイプ | 必須 | デフォルト | 説明 |
|---|---|---|---|---|---|
token |
query | string |
はい | - | このAPIサービスのアクセストークン。 |
itemId |
query | string |
はい | - | 淘宝の商品ID。 |
コードサンプル
bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/taobao/get-item-detail/v11?token=YOUR_API_KEY&itemId=VALUE'
text
私はJustOneAPIの"商品詳細 (V11)" APIを使用したいです。
基本URL: https://api.justoneapi.com.
APIパス: /api/taobao/get-item-detail/v11?token=YOUR_API_KEY&itemId=VALUE
APIエンドポイント: BASE_URL + /api/taobao/get-item-detail/v11?token=YOUR_API_KEY&itemId=VALUE
HTTPメソッド: GET
認証: "token"クエリパラメーターをURLに追加します。
OpenAPI定義: https://docs.justoneapi.com/openapi/taobao-and-tmall/product-details-v11-ja.json
パラメーター:
- token (query): このAPIサービスのアクセストークン。 (必須)
- itemId (query): 淘宝の商品ID。 (必須)
返信形式:実際のContent-Typeに応じて、JSONまたはテキストを安全に処理する。
レスポンスの処理とエラーコード:
1. API の処理結果はレスポンス本文の「code」フィールドで判定します。code が 0 なら成功です。
2. 推奨タイムアウト:リクエストのタイムアウトは 120 秒に設定してください。120 秒が長すぎる場合でも、最低 60 秒を確保してください。一部のリクエストは、結果を受け取る前にタイムアウトすることがあります。
3. 処理結果コード:
- 0: 成功
- 100: 無効または停止中のトークン
- 301: データの取得に失敗しました。再試行してください。
- 302: 呼び出し頻度の上限を超えました
- 303: 日次の利用上限を超えました
- 400: パラメーターが無効です
- 500: サーバー内部エラー
- 600: アクセス権限がありません
- 601: 残高不足
- 602: トークンの予算上限に達しました
4. コード 601 はアカウントの共有残高不足を示します。コード 602 は使用中の API トークン固有の累積予算上限に達したことを示します。トークンに予算上限を設定しても、共有残高から資金が移動することはありません。
お手伝いください。私が好むプログラミング言語でこのAPIを呼び出し、レスポンスを処理するスクリプトを作成してください。
python
import requests
BASE_URL = "https://api.justoneapi.com" # オープンAPIサーバーによって提供される
url = BASE_URL + "/api/taobao/get-item-detail/v11?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"; // オープンAPIサーバーによって提供される
const url = BASE_URL + "/api/taobao/get-item-detail/v11?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"; // オープンAPIサーバーによって提供される
final String url = BASE_URL + "/api/taobao/get-item-detail/v11?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" // オープンAPIサーバーによって提供される
func main() {
client := &http.Client{Timeout: 120 * time.Second}
url := BASE_URL + "/api/taobao/get-item-detail/v11?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'; // オープンAPIサーバーによって提供される
$url = $BASE_URL . '/api/taobao/get-item-detail/v11?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)。
| フィールドパス | タイプ | 説明 |
|---|---|---|
data |
object |
要求されたTaobao商品の詳細。正常に検索できた場合は、商品詳細が利用できなかったことを示します。 |
data.exists |
boolean |
要求された商品IDの商品詳細が見つかったかどうか。 |
data.reason |
string |
商品詳細が利用できなかった場合に返される理由。 |
data.item |
object |
商品のタイトル、メディアおよび表示ラベル。 |
data.item.title |
string |
商品タイトル。 |
data.item.titleIcon |
string |
商品タイトルに関連するアイコン。 |
data.item.images |
array |
報告された商品画像。 |
data.item.images[] |
string |
商品画像の URL。 |
data.item.videos |
array |
報告された商品動画。 |
data.item.videos[] |
object |
一つの商品ビデオ。 |
data.item.videos[].videoId |
string |
商品動画の識別コードとしてのテキスト。 |
data.item.videos[].type |
string |
報告された動画の種類。 |
data.item.videos[].url |
string |
商品動画のURL。 |
data.item.videos[].videoThumbnailURL |
string |
動画のサムネイルの URL。 |
data.item.videos[].spatialVideoDimension |
string |
報告された動画のサイズとしてのテキスト。 |
data.item.videos[].weexRecommendUrl |
string |
この動画に関連するコンテンツのURL。 |
data.item.videoDetail |
object |
商品動画の詳細。 |
data.item.videoDetail.videoId |
string |
商品動画の識別コードとしてのテキスト。 |
data.item.videoDetail.type |
string |
報告された動画の種類。 |
data.item.videoDetail.url |
string |
商品動画のURL。 |
data.item.videoDetail.videoThumbnailURL |
string |
動画のサムネイルの URL。 |
data.item.videoDetail.spatialVideoDimension |
string |
報告された動画のサイズとしてのテキスト。 |
data.item.videoDetail.mainPicList |
array |
動画の詳細と共に返される商品画像。 |
data.item.videoDetail.mainPicList[] |
string |
商品画像の URL。 |
data.item.vagueSellCount |
string |
商品ページに表示される販売数。省略可能。 |
data.item.skuText |
string |
SKU選択に表示されるテキスト。 |
data.item.showShopActivitySize |
string |
報告されたショップ活動の表示数としてのテキスト。 |
data.price |
object |
報告された商品の価格と価格ラベル。 |
data.price.price |
object |
主要に表示される商品価格。 |
data.price.price.priceText |
string |
主要価格の表示テキスト。 |
data.price.price.type |
string |
報告された価格コード。 |
data.price.extraPrices |
array |
商品の追加価格。 |
data.price.extraPrices[] |
object |
追加の価格。 |
data.price.extraPrices[].priceText |
string |
この価格に対する表示テキスト。 |
data.price.extraPrices[].priceTitle |
string |
この価格で表示されるラベル。 |
data.price.extraPrices[].lineThrough |
string |
価格が下線のついたテキストとして表示されるかどうか。 |
data.price.extraPrices[].type |
string |
報告された価格コード。 |
data.price.priceTag |
array |
商品価格の近くに表示されるラベル。 |
data.price.priceTag[] |
object |
価格ラベル。 |
data.price.priceTag[].text |
string |
ラベル上に表示されるテキスト。 |
data.price.priceTag[].bgColor |
string |
ラベルの背景色。 |
data.price.transmitPrice |
object |
追加の価格詳細。 |
data.price.transmitPrice.priceText |
string |
この価格に対する表示テキスト。 |
data.skuBase |
object |
商品バリエーションの識別子とその仕様オプション。 |
data.skuBase.props |
array |
商品で利用可能な仕様プロパティ。 |
data.skuBase.props[] |
object |
一つの仕様プロパティ。 |
data.skuBase.props[].pid |
string |
仕様プロパティIDがテキストとして返されます。 |
data.skuBase.props[].name |
string |
仕様属性の表示名。 |
data.skuBase.props[].values |
array |
このプロパティのオプション。 |
data.skuBase.props[].values[] |
object |
仕様オプション。 |
data.skuBase.props[].values[].vid |
string |
仕様オプションのIDをテキストとして。 |
data.skuBase.props[].values[].name |
string |
選択肢の表示名。 |
data.skuBase.props[].values[].image |
string |
該当オプションに関連する画像のURL。 |
data.skuBase.skus |
array |
SKUの識別子とその仕様組み合わせ。 |
data.skuBase.skus[] |
object |
SKUの組み合わせ。 |
data.skuBase.skus[].skuId |
string |
SKU IDをテキストとして。これを使用してskuCore.sku2info内の対応するエントリを検索します。 |
data.skuBase.skus[].propPath |
string |
このSKUのプロパティとオプションIDのエンコードされたパス。 |
data.skuCore |
object |
報告されたバリエーションの価格、数量、配送情報。 |
data.skuCore.sku2info |
object |
SKU IDとその報告された価格および数量レコードのマップ。 |
data.skuCore.sku2info.{key} |
object |
SKUエントリの報告された値。 |
data.skuCore.sku2info.{key}.quantity |
string |
このエントリの報告された在庫数量をテキストとして。 |
data.skuCore.sku2info.{key}.price |
object |
このエントリの報告された価格。 |
data.skuCore.sku2info.{key}.price.priceMoney |
string |
報告された価格の数値表現、テキストとして返されます。 |
data.skuCore.sku2info.{key}.price.priceText |
string |
報告された価格の表示テキスト。 |
data.skuCore.sku2info.{key}.price.type |
string |
報告された価格コード。 |
data.skuCore.sku2info.{key}.logisticsTime |
string |
このエントリの配送時間に関する報告テキスト。 |
data.skuCore.skuItem |
object |
バリアント選択器に表示される配送情報。 |
data.skuCore.skuItem.location |
string |
バリアント選択器に表示される場所テキスト。 |
data.skuCore.skuItem.showAddressTaobao |
string |
アドレス表示フラグがテキストとして表される。 |
data.skuCore.abSwitch |
object |
追加のバリアント表示設定。 |
data.skuCore.atmosphere |
object |
追加のバリアント表示メタデータ。 |
data.skuTransform |
object |
バリアント選択器の追加表示コンテンツ。 |
data.skuTransform.extraText |
string |
バリアント選択時に表示される追加テキスト。 |
data.skuTransform.skuContents |
array |
バリアント選択時に表示される追加コンテンツ。 |
data.skuTransform.skuContents[] |
object |
バリアントコンテンツの入力。 |
data.skuTransform.skuContents[].img |
string |
バリアント選択時に表示される画像のURL。 |
data.delivery |
object |
商品の配送情報に関する報告。 |
data.delivery.from |
string |
配送元に関する報告テキスト。 |
data.delivery.to |
string |
配送先に関する報告テキスト。 |
data.delivery.completedTo |
string |
追加の配送先テキスト。 |
data.delivery.areaId |
string |
配送エリア識別子がテキストとして表される。 |
data.delivery.postage |
string |
表示される配送料金または郵便料金の説明。 |
data.delivery.addressWeexUrl |
string |
配送アドレスインターフェースに返されるURL。 |
data.delivery.overseaContraBandFlag |
string |
海外配送制限フラグがテキストとして表される。 |
data.delivery.extras |
object |
追加の配送情報。 |
data.consumerProtection |
object |
商品に関する消費者保護情報が表示される。 |
data.consumerProtection.items |
array |
表示される消費者保護エントリ。 |
data.consumerProtection.items[] |
object |
消費者保護のエントリ。 |
data.consumerProtection.items[].title |
string |
保護エントリのタイトル。 |
data.consumerProtection.items[].desc |
string |
保護エントリに表示される説明。 |
data.consumerProtection.channel |
object |
商品に関する追加の消費者保護情報が表示されます。 |
data.consumerProtection.channel.logo |
string |
消費者保護チャンネルのロゴのURLが表示されます。 |
data.consumerProtection.channel.title |
string |
消費者保護チャンネルのタイトルが表示されます。 |
data.consumerProtection.passValue |
string |
消費者保護情報と共に追加のテキストが返されます。 |
data.promotion |
object |
商品に関するプロモーション情報が表示されます。 |
data.promotion.entranceTip |
string |
プロモーションエントリーポイントに関するテキストが表示されます。 |
data.promotion.entranceUrl |
string |
プロモーションエントリーポイントのURLが表示されます。 |
data.promotion.items |
array |
表示されるプロモーションエントリがあります。 |
data.promotion.items[] |
object |
表示されるプロモーションエントリ。 |
data.promotion.items[].content |
string |
主要なプロモーションテキストが表示されます。 |
data.promotion.items[].scontent |
string |
追加のプロモーションテキストが表示されます。 |
data.promotion.items[].bgImage |
string |
主要なプロモーション背景画像のURLが表示されます。 |
data.promotion.items[].sbgImage |
string |
追加のプロモーション背景画像のURLが表示されます。 |
data.promotion.items[].textColor |
string |
プロモーションエントリのテキスト色が表示されます。 |
data.promotion.items[].type |
string |
報告されたプロモーションの種類が表示されます。 |
data.promotionFloatingData |
object |
プロモーションオーバーレイの表示情報が表示されます。 |
data.promotionFloatingData.promotionName |
string |
表示されるプロモーション名が表示されます。 |
data.promotionFloatingData.showNow |
string |
現在のプロモーション表示フラグがテキストとして表示されます。 |
data.promotionFloatingData.showWarm |
string |
プロモーションプレビューの表示フラグがテキストとして表示されます。 |
data.promotionFloatingData.detailPromotionTimeDO |
object |
プロモーション表示メタデータが表示されます。 |
data.promotionFloatingData.detailPromotionTimeDO.promotionType |
string |
報告されたプロモーションの種類が表示されます。 |
data.resource |
object |
クーポン、プロモーション、プレゼンテーションに関する追加リソースが表示されます。 |
data.resource.coupon |
object |
商品と共に返されるクーポンリソースが表示されます。 |
data.resource.coupon.h5LinkUrl |
string |
クーポンページの URL。 |
data.resource.promsCalcInfo |
object |
報告されたプロモーションの計算情報が表示されます。 |
data.resource.promsCalcInfo.cheapestMoney |
string |
このプロモーションの計算における最低金額がテキストとして返されます。 |
data.resource.promsCalcInfo.hasCoupon |
string |
クーポンの利用可能性を示すインジケータがテキストとして表示されます。 |
data.resource.promsCalcInfo.hitPromItems |
array |
計算によって返されるプロモーションエントリ。 |
data.resource.promsCalcInfo.promTip |
object |
プロモーション計算の表示詳細。 |
data.resource.promsCalcInfo.promTip.icon |
string |
プロモーションヒントと共に返されるアイコン。 |
data.resource.promsCalcInfo.promTip.title |
string |
プロモーションヒントのテキスト。 |
data.resource.promsCalcInfo.promTip.useHuaBian |
string |
プロモーションヒントの追加表示設定。 |
data.resource.shopProm |
array |
商品と共に返されるショッププロモーション。 |
data.resource.shopProm[] |
object |
一つのショッププロモーション。 |
data.resource.shopProm[].title |
string |
ショップのプロモーションのタイトル。 |
data.resource.shopProm[].content |
array |
プロモーションに表示されるテキスト。 |
data.resource.shopProm[].content[] |
string |
一つのプロモーションテキストエントリ。 |
data.resource.shopProm[].actionUrl |
string |
プロモーションに関連するURL。 |
data.resource.shopProm[].icon |
string |
プロモーションに表示されるアイコン。 |
data.resource.shopProm[].iconText |
string |
プロモーションアイコンと共に表示されるテキスト。 |
data.resource.entrances |
object |
追加のリソースエントリポイント。 |
data.resource.floatView |
object |
フローティング表示のためのリソース。 |
data.resource.floatView.list |
array |
フローティング表示のために返されるエントリ。 |
data.resource.newBigPromotion |
object |
追加のプロモーションメタデータ。 |
data.trade |
object |
購入およびカートアクションの利用可能性とリンク。 |
data.trade.buyEnable |
string |
テキストとして表される購入利用可能性フラグ。 |
data.trade.buyUrl |
string |
購入アクションのURL。 |
data.trade.buyParam |
object |
追加の購入アクションパラメーター。 |
data.trade.cartEnable |
string |
カートに追加の利用可能性フラグとして表されるフラグ。 |
data.trade.cartJumpUrl |
string |
カートアクションのURL。 |
data.trade.cartParam |
object |
追加のカートアクションパラメーター。 |
data.trade.isBanSale4Oversea |
string |
海外購入制限フラグとして表されるテキスト。 |
data.vertical |
object |
商品と共に返される追加のコンテンツモジュール。 |
data.vertical.askAll |
object |
商品に関する質問と回答のエントポイント。 |
data.vertical.askAll.title |
string |
商品の質問セクションの表示タイトル。 |
data.vertical.askAll.askText |
string |
商品に関する質問エントポイントで表示されるテキスト。 |
data.vertical.askAll.askIcon |
string |
商品に関する質問エントポイントで表示されるアイコン。 |
data.vertical.askAll.questNum |
string |
報告された質問数をテキストとして表示。 |
data.vertical.askAll.linkUrl |
string |
商品の質問セクションの URL。 |
data.vertical.groupChat |
object |
グループチャット情報がある場合。 |
data.vertical.groupChat.title |
string |
表示されるグループチャットのタイトル。 |
data.vertical.groupChat.desc |
string |
表示されるグループチャットの説明。 |
data.vertical.groupChat.image |
string |
グループチャットの画像URL。 |
data.vertical.groupChat.fansCount |
string |
表示されるフォロワー数をテキストとして表示。 |
data.vertical.groupChat.url |
string |
グループチャットへの入口の URL。 |
data.vertical.transparentBroadcast |
object |
ライブビデオ情報がある場合。 |
data.vertical.transparentBroadcast.liveId |
string |
ライブ放送の識別子をテキストとして表示。 |
data.vertical.transparentBroadcast.playUrl |
string |
ライブ動画の再生の URL。 |
data.vertical.transparentBroadcast.jumpUrl |
string |
ライブ配信への入口の URL。 |
data.vertical.overSeas |
object |
海外ショッピングに関する追加情報。 |
data.vertical.videoFlow |
object |
ビデオモジュールに関する追加情報。 |
data.vertical.vipComment |
object |
レビューコンテンツのメタデータ。 |
data.gallery |
object |
商品ギャラリーに関する追加情報。 |
data.feature |
object |
商品ページの機能設定。 |
data.layout |
object |
商品ページのレイアウト情報。 |
data.layout.layoutId |
string |
報告されたレイアウト識別子をテキストとして表示。 |
data.extendedData |
object |
レスポンスに返される追加の商品詳細。 |
data.diversion |
object |
追加の商品推薦メタデータ。 |
data.hybrid |
object |
追加の埋め込みコンテンツメタデータ。 |
data.skuVertical |
object |
追加のSKUモジュール情報。 |
data.weappData |
object |
追加のアプリプレゼンテーションデータ。 |
data.debug |
object |
商品詳細に返される診断メタデータ。 |
data.params |
object |
追加の商品ページメタデータ。 |
data.traceDatas |
object |
商品詳細と共に返されるトレースメタデータ。 |
レスポンス例
レスポンスのサンプルを読み込んでいます...