JD.com Product Details API (V1)
Retrieve JD.com product details for a known item ID. Use it to inspect an individual product after finding its identifier.
Highlights
Capability · Price
Product price information is available.
Guidance · Attributes
Provides basic product attributes. Use V3 or V4 for a more detailed parameter list.
Guidance · SKU options
Provides current-SKU information. Use V3 or V4 for a more complete variant list.
Capability · Main and carousel images
Provides main and carousel images for the selected SKU.
Condition · Description images
A dedicated description-image list and description HTML may be absent. Use V3 for this content.
Parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
token | query | string | Yes | - | Access token for this API service. |
itemId | query | string | Yes | - | A unique product identifier on JD.com (item ID). |
Code Samples
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/jd/get-item-detail/v1?token=YOUR_API_KEY&itemId=VALUE'I want to use the "Product Details (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/jd/get-item-detail/v1?token=YOUR_API_KEY&itemId=VALUE
API Endpoint: BASE_URL + /api/jd/get-item-detail/v1?token=YOUR_API_KEY&itemId=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/jdcom/product-details-v1-en.json
Parameters:
- token (query): Access token for this API service. (Required)
- itemId (query): A unique product identifier on JD.com (item ID). (Required)
Return format: safely handle JSON or text according to the actual Content-Type.
Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set the request timeout to 120 seconds. If 120 seconds is too long for your use case, use at least 60 seconds, but a small number of requests may time out before receiving a result.
3. Business Code Reference:
- 0: Success
- 100: Invalid or Inactive Token
- 301: Collection Failed. Please Retry.
- 302: Rate Limit Exceeded
- 303: Daily Quota Exceeded
- 400: Invalid Parameters
- 500: Internal Server Error
- 600: Permission Denied
- 601: Insufficient Balance
- 602: Token Budget Exceeded
4. Code 601 means the shared account balance is insufficient. Code 602 means the current API token's own cumulative budget limit has been reached. Token budget limits do not transfer funds out of the shared account balance.
Please help me write a script in my preferred programming language to call this API and handle the response.import requests
BASE_URL = "https://api.justoneapi.com" # Provided by OpenAPI servers
url = BASE_URL + "/api/jd/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")const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/jd/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`);
}
}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"; // Provided by OpenAPI servers
final String url = BASE_URL + "/api/jd/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");
}
}
}package main
import (
"fmt"
"io"
"os"
"strings"
"net/http"
"time"
)
const BASE_URL = "https://api.justoneapi.com" // Provided by OpenAPI servers
func main() {
client := &http.Client{Timeout: 120 * time.Second}
url := BASE_URL + "/api/jd/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
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/jd/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;
}Response Fields
Key fields in a successful response (code = 0).
Product overview7 fields
data.product
Details attached to the selected SKU.
| Field | Type | Description |
|---|---|---|
skuId | string | Selected SKU identifier returned as text. |
skuName | string | Display title of the selected SKU. |
productId | string | Product ID reported for the selected SKU. |
realSpuId | string | Platform-reported SPU identifier for the selected SKU, returned as text. |
brandId | string | Brand identifier returned as text. |
brandName | string | Brand name reported for the product. |
sellPoint | string | Selling-point text displayed for the SKU. |
Specifications and categories14 fields
data.product
| Field | Type | Description |
|---|---|---|
model | string | Model information reported for the selected SKU. |
color | string | Color label reported for the selected SKU. |
size | string | Size label reported for the selected SKU. |
salesAttr | string | Sales attribute text attached to the selected SKU. |
category | string | Category hierarchy in the returned text format. |
cat1 | string | First-level category ID returned as text. |
cat2 | string | Second-level category ID returned as text. |
cat3 | string | Third-level category ID returned as text. |
upc | string | UPC barcode text returned for the product. |
productArea | string | Product-area label reported for this SKU. |
height | string | Product height value reported as text. |
length | string | Product length value reported as text. |
width | string | Product width value reported as text. |
weight | string | Product weight value reported as text. |
Product status6 fields
data.product
| Field | Type | Description |
|---|---|---|
skuStatus | string | SKU status code returned as text. |
isDelete | string | Deletion-state value reported in the SKU metadata. |
skuType | integer | Numeric SKU type code reported by the platform. |
productType | integer | Numeric product type code reported by the platform. |
saleDate | string | Sale date and time value returned as text. |
jdexpress | boolean | Whether the product information marks JD delivery. |
Images and video4 fields
data
| Field | Type | Description |
|---|---|---|
product.imageurl | string | Primary product image field as returned. |
product.mainImages | array | Image entries returned for the product carousel. |
product.mainImages[] | string | An image entry returned in the product carousel. |
mainVideoId | string | ID of the main product video, returned as text when provided. |
Price display7 fields
data
| Field | Type | Description |
|---|---|---|
priceFloor | object | Price display information returned for the product. |
priceFloor.price | string | Displayed price returned as text in the original format. |
priceFloor.type | string | Price type code reported for this display entry. |
priceFloor.ext | object | Additional price information returned for the product. |
priceFloor.ext.jdPrice | string | JD price value returned as text in the additional price information. |
commonInfo | object | Common display information returned with the product details. |
commonInfo.priceLoginText | string | Sign-in prompt text associated with the price display. |
Stock and delivery6 fields
data.stock
Stock and delivery information returned for the selected SKU.
| Field | Type | Description |
|---|---|---|
skuId | string | SKU identifier used by the stock information, returned as text. |
realSkuId | string | Resolved SKU identifier reported by the stock information, returned as text. |
StockState | integer | Numeric stock-state code reported for the selected SKU. |
code | integer | Numeric result code returned with the stock information. |
isJDexpress | boolean | Whether the stock information marks JD delivery. |
promiseResult | string | Delivery promise text returned with the stock information. |
Shop and seller21 fields
data
| Field | Type | Description |
|---|---|---|
product.shopId | string | JD shop identifier returned as text in the product metadata. |
product.venderId | string | JD merchant identifier returned as text in the product metadata. |
stock.D | object | Seller information returned with the stock information. |
stock.D.venderId | integer | JD merchant identifier returned as an integer in this seller record. |
stock.D.vender | string | Seller name shown in this merchant record. |
stock.D.shopId | integer | JD shop identifier returned as an integer in this seller record. |
stock.D.shopName | string | Name of the JD shop. |
stock.D.shopWebsite | string | Shop website link provided for this seller. |
stock.D.url | string | Shop link returned with this seller record. |
stock.self_D | object | Additional seller information returned with the stock information. |
stock.self_D.venderId | integer | JD merchant identifier returned as an integer in this seller record. |
stock.self_D.vender | string | Seller name shown in this merchant record. |
stock.self_D.shopId | integer | JD shop identifier returned as an integer in this seller record. |
stock.self_D.shopName | string | Name of the JD shop. |
stock.self_D.shopWebsite | string | Shop website link provided for this seller. |
stock.self_D.url | string | Shop link returned with this seller record. |
shopFloor | object | Shop display information when provided. |
shopFloor.shopFloorConfig | object | Display information for the shop section. |
shopFloor.shopFloorConfig.shopType | string | Shop type label returned with the shop display information. |
shopFloor.shopFloorConfig.shopTypeDesc | string | Display description of the returned shop type. |
shopFloor.shopFloorConfig.coverLogo | string | Logo image for the shop cover. |
Service information20 fields
data.stock
| Field | Type | Description |
|---|---|---|
ir | array | Service labels returned with the stock information. |
ir[] | object | A service label associated with the selected SKU. |
ir[].showName | string | Display name of the service label. |
ir[].iconTip | string | Explanatory text shown for the service label. |
ir[].picUrl | string | Image URL returned for the service label. |
ir[].helpLink | string | Help link provided for this service label. |
promiseYX | object | Delivery assurance display information returned with the stock data. |
promiseYX.showName | string | Display name of the delivery assurance. |
promiseYX.iconTip | string | Explanatory text for the delivery assurance. |
promiseYX.picUrl | string | Image URL returned for the delivery assurance. |
promiseYX.helpLink | string | Help link provided with the delivery assurance. |
unifiedServiceTag | object | Service-tag information returned with the product stock details. |
unifiedServiceTag.enable | boolean | Whether the returned service-tag information is marked enabled. |
unifiedServiceTag.tsfw | array | Service labels included in the unified service-tag information. |
unifiedServiceTag.tsfw[] | object | An entry in the unified service-tag list. |
unifiedServiceTag.tsfw[].name | string | Service name reported for this entry. |
unifiedServiceTag.tsfw[].desc | string | Service description reported for this entry. |
unifiedServiceTag.tsfw[].shortDesc | string | Short service description reported for this entry. |
unifiedServiceTag.tsfw[].logoUrl | string | Logo URL returned for this service. |
unifiedServiceTag.tsfw[].helpUrl | string | Help URL returned for this service. |
Notices and sharing10 fields
data
| Field | Type | Description |
|---|---|---|
noticeFloor | array | Display notices returned with the product details. |
noticeFloor[] | object | A display notice for the selected product. |
noticeFloor[].type | string | Type code returned for the notice. |
noticeFloor[].desc | string | Display text of the notice. |
noticeFloor[].status | string | Status value returned with the notice when provided. |
noticeFloor[].icons | array | Icon entries returned with this notice. |
noticeFloor[].icons[] | string | An icon entry returned with the notice. |
shareInfo | object | Sharing information returned for the product. |
shareInfo.title | string | Title returned for sharing the product. |
shareInfo.shortTitle | string | Short sharing title when provided. |
Lookup status3 fields
data
Details for the selected JD SKU. A status-only result can contain the requested item ID and a message.
| Field | Type | Description |
|---|---|---|
areaId | string | Area code returned with the product details. |
itemId | string | Requested item ID returned in a status-only lookup result. |
msg | string | Status message returned with the lookup result. |