ข้ามไปยังเนื้อหา

1688 รายละเอียดสินค้า API (V2) ​

GET
สถานะสุขภาพของ API
สถานะดี มีสภาพ จำกัด ส่วนใหญ่ไม่มีสภาพ ไม่มีข้อมูล
กำลังโหลดสถานะสุขภาพ...

ดึงข้อมูลรายละเอียดสินค้าใน 1688 โดยใช้ ID ของสินค้า พร้อมตัวเลือกภาษาที่ต้องการและสถานการณ์การขายแบบดรอปเปอร์ชิป ใช้เพื่อตรวจสอบสินค้าที่รู้จักขณะทำการหาสินค้าและวิจัยแคตตาล็อก

สิ่งที่น่าสนใจ ​

คำแนะนำ

ผลลัพธ์ “สินค้าไม่พบ” คือการค้นหาที่สำเร็จและสามารถคำนวณค่าได้ และจะส่งค่าที่เป็น null กลับมา

พารามิเตอร์ ​

ชื่อ ตำแหน่ง ชนิดข้อมูล จำเป็น ค่าเริ่มต้น คำอธิบาย
token query string ใช่ - โทเค็นการเข้าถึงสำหรับบริการ API นี้
itemId query string ใช่ - ID สินค้าบน 1688
scene query string ไม่ใช่ - สถานการณ์การตั้งราคาสำหรับการขายแบบ dropshipping ทางเลือก


ค่าที่มีอยู่:

- drop_shipping: การขายแบบ dropshipping
optimizeTitle query boolean ไม่ใช่ false ปรับปรุงชื่อเรื่องสินค้าจีนโดยการลบคำที่ไม่สำคัญ
language query string ไม่ใช่ zh ภาษาที่ใช้แสดงผล


ค่าที่มีอยู่:

- en: ภาษาอังกฤษ

- zh: ภาษาจีน

- ru: ภาษารัสเซีย

- th: ภาษาไทย

- pt: ภาษาโปรตุเกส

- es: ภาษาสเปน

- tr: ภาษาตุรกี

- vi: ภาษาเวียดนาม

- ja: ภาษาญี่ปุ่น

- ko: ภาษาเกาหลี

ตัวอย่างโค้ด ​

bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/1688/get-item-detail/v2?token=YOUR_API_KEY&itemId=VALUE'
text
ฉันต้องการใช้ API "รายละเอียดสินค้า (V2)" จาก JustOneAPI.
URL หลัก: https://api.justoneapi.com.
เส้นทาง API: /api/1688/get-item-detail/v2?token=YOUR_API_KEY&itemId=VALUE
เอนด์พอยต์ API: BASE_URL + /api/1688/get-item-detail/v2?token=YOUR_API_KEY&itemId=VALUE
เมธอด HTTP: GET
การยืนยันตัวตน: เพิ่มพารามิเตอร์ "token" เข้าไปใน URL.
คำนิยาม OpenAPI: https://docs.justoneapi.com/openapi/1688/product-details-v2-th.json

พารามิเตอร์:
- token (query): โทเค็นการเข้าถึงสำหรับบริการ API นี้ (จำเป็น)
- itemId (query): ID สินค้าบน 1688 (จำเป็น)
- scene (query): สถานการณ์การตั้งราคาสำหรับการขายแบบ dropshipping ทางเลือก

ค่าที่มีอยู่:
- `drop_shipping`: การขายแบบ dropshipping
- optimizeTitle (query): ปรับปรุงชื่อเรื่องสินค้าจีนโดยการลบคำที่ไม่สำคัญ
- language (query): ภาษาที่ใช้แสดงผล

ค่าที่มีอยู่:
- `en`: ภาษาอังกฤษ
- `zh`: ภาษาจีน
- `ru`: ภาษารัสเซีย
- `th`: ภาษาไทย
- `pt`: ภาษาโปรตุเกส
- `es`: ภาษาสเปน
- `tr`: ภาษาตุรกี
- `vi`: ภาษาเวียดนาม
- `ja`: ภาษาญี่ปุ่น
- `ko`: ภาษาเกาหลี

รูปแบบที่ส่งกลับ: จัดการ JSON หรือข้อความอย่างปลอดภัยตามค่า Content-Type ที่ได้รับจริง

การจัดการผลตอบกลับและรหัสข้อผิดพลาด:
1. ตรวจสอบผลการทำงานจากฟิลด์ "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"  # ให้โดยเซิร์ฟเวอร์ OpenAPI

url = BASE_URL + "/api/1688/get-item-detail/v2?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"; // ให้โดยเซิร์ฟเวอร์ OpenAPI
const url = BASE_URL + "/api/1688/get-item-detail/v2?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"; // ให้โดยเซิร์ฟเวอร์ OpenAPI
        final String url = BASE_URL + "/api/1688/get-item-detail/v2?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" // ให้โดยเซิร์ฟเวอร์ OpenAPI

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/1688/get-item-detail/v2?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'; // ให้โดยเซิร์ฟเวอร์ OpenAPI
$url = $BASE_URL . '/api/1688/get-item-detail/v2?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).

สินค้าและสถานะว่าง12 ฟิลด์

data

ฟิลด์ต่อไปนี้ใช้กับข้อมูลของอ็อบเจกต์ หากสินค้าไม่พบ จะส่งค่า null กลับมา

ฟิลด์ ชนิดข้อมูล คำอธิบาย
item_id integer ID ของสินค้า 1688 ถูกส่งกลับมาในรูปแบบจำนวนเต็ม
title string ชื่อที่ใช้แสดงสินค้า ภาษาและการปรับแต่งชื่อที่ขออาจส่งผลต่อข้อความนี้
category_id integer ID ของหมวดหมู่ที่กำหนดให้กับสินค้า
root_category_id integer ID ของหมวดหมู่ระดับสูงที่กำหนดให้กับสินค้า
offer_unit string หน่วยการขายที่แสดงสำหรับสินค้า
sale_count string ข้อความแสดงจำนวนการขาย ซึ่งอาจว่างเปล่าได้
sale_info object ตัวชี้วัดการขายที่ส่งกลับมาสำหรับสินค้า
sale_info.sale_quantity_year integer ปริมาณการขายประจำปีที่รายงานสำหรับสินค้า
stock integer ปริมาณสินค้าคงคลังที่รายงานระดับสินค้า
is_sold_out boolean ว่าสินค้านั้นถูกระบุว่าเสียสต็อกหรือไม่
created_at integer เวลาการสร้างสินค้าในรูปแบบมิลลิวินาทีตาม Unix epoch
product_url string ลิงก์ไปยังหน้าสินค้าบน 1688
คุณสมบัติของสินค้าและสื่อ6 ฟิลด์

data

ฟิลด์ ชนิดข้อมูล คำอธิบาย
product_props array คีย์ของคุณสมบัติสินค้าที่แสดงตามชื่อคุณสมบัติที่แสดง ภาษาที่ขออาจส่งผลต่อชื่อและค่าที่แสดง
product_props[] object อ็อบเจกต์คุณสมบัติที่มีคีย์เป็นชื่อคุณสมบัติที่แสดง
product_props[].{key} string ค่าเท็มเพลตสำหรับชื่อคุณสมบัติที่แสดงในคีย์。
main_imgs array URL ของรูปภาพของสินค้า.
main_imgs[] string URL ของรูปสินค้า
video_url string URL ของวิดีโอสินค้า อาจเป็นสตริงว่าง
การตั้งราคาและคำสั่งซื้อขั้นต่ำ18 ฟิลด์

data

ฟิลด์ ชนิดข้อมูล คำอธิบาย
currency string รหัสสกุลเงินที่รายงานสำหรับราคาสินค้า
moq integer ปริมาณการสั่งซื้อขั้นต่ำที่รายงานสำหรับสินค้า
price_info object ราคาในระดับผลิตภัณฑ์ ถูกส่งกลับมาในรูปแบบข้อความ
price_info.price string ราคาที่รายงานในระดับผลิตภัณฑ์ ถูกส่งกลับมาในรูปแบบข้อความ
price_info.price_min string ราคาขั้นต่ำที่รายงานสำหรับผลิตภัณฑ์ ถูกส่งกลับมาในรูปแบบข้อความ
price_info.price_max string ราคาสูงสุดที่รายงานสำหรับผลิตภัณฑ์ ถูกส่งกลับมาในรูปแบบข้อความ
price_info.origin_price_min string ราคาเดิมขั้นต่ำที่รายงานสำหรับผลิตภัณฑ์ ถูกส่งกลับมาในรูปแบบข้อความ
price_info.origin_price_max string ราคาเดิมสูงสุดที่รายงานสำหรับผลิตภัณฑ์ ถูกส่งกลับมาในรูปแบบข้อความ
price_info.discount_price string ราคาพิเศษที่รายงาน ถูกส่งกลับมาในรูปแบบข้อความ ซึ่งอาจเป็นสตริงว่าง
tiered_price_info object ราคาที่กำหนดตามปริมาณของผลิตภัณฑ์
tiered_price_info.begin_num integer ปริมาณการสั่งซื้อเริ่มต้นที่รายงานในข้อมูลการตั้งราคาแบบระดับ
tiered_price_info.prices array ระดับราคาที่รายงานตามปริมาณการสั่งซื้อ รายการนี้อาจว่างได้
tiered_price_info.prices[] object ระดับราคาหนึ่งและปริมาณที่เหมาะสมสำหรับระดับนั้น
tiered_price_info.prices[].beginAmount string ปริมาณการสั่งซื้อเริ่มต้นสำหรับระดับนี้ ถูกส่งกลับมาในรูปแบบข้อความ
tiered_price_info.prices[].price string ราคาที่รายงานสำหรับปริมาณนี้ ถูกส่งกลับมาในรูปแบบข้อความ
mixed_batch object | null ข้อมูลการซื้อแบบผสม ถูกส่งกลับมาในรูปแบบอ็อบเจกต์หรือ null
mixed_batch.mix_amount integer | null จำนวนที่รายงานสำหรับการซื้อแบบผสม อาจเป็น null
mixed_batch.mix_num integer ปริมาณการสั่งซื้อที่รายงานในกฎการซื้อแบบผสม
โปรโมชั่น8 ฟิลด์

data

ฟิลด์ ชนิดข้อมูล คำอธิบาย
promotions array โปรโมชั่นที่รายงานสำหรับผลิตภัณฑ์ รายการนี้อาจว่างได้
promotions[] object โปรโมชั่นผลิตภัณฑ์หนึ่งที่รายงาน
promotions[].promotion_id string ID ของโปรโมชั่น อาจเป็นสตริงว่าง
promotions[].title string ชื่อเรื่องที่แสดงของโปรโมชัน
promotions[].content string ข้อความที่อธิบายเกี่ยวกับโปรโมชั่น
promotions[].start_time integer เวลาเริ่มต้นของโปรโมชั่นที่รายงาน
promotions[].type string รหัสประเภทโปรโมชั่นที่รายงานโดยแพลตฟอร์ม
promotions[].type_name string ชื่อที่ปรากฏของประเภทโปรโมชั่น
ตัวเลือก SKU9 ฟิลด์

data

ฟิลด์ ชนิดข้อมูล คำอธิบาย
sku_props array คุณสมบัติของข้อกำหนดและตัวเลือกที่มีอยู่。
sku_props[] object คุณสมบัติที่เป็นข้อมูลสำหรับผลิตภัณฑ์
sku_props[].pid string ID ของคุณสมบัติของข้อกำหนด ถูกส่งกลับมาในรูปแบบสตริง。
sku_props[].prop_name string ชื่อที่แสดงของแอตทริบิวต์ข้อมูลจำเพาะ
sku_props[].values array ตัวเลือกที่มีอยู่สำหรับคุณสมบัติของข้อกำหนดนี้。
sku_props[].values[] object ตัวเลือกข้อกำหนดที่สามารถเลือกได้หนึ่งตัว。
sku_props[].values[].vid string ID ของตัวเลือกข้อกำหนด ถูกส่งกลับมาในรูปแบบสตริง。
sku_props[].values[].name string ชื่อที่แสดงของตัวเลือกข้อมูลจำเพาะ
sku_props[].values[].imageUrl string URL ของรูปภาพสำหรับตัวเลือก อาจเป็นสตริงว่างได้。
ราคา SKU, สต็อกและบรรจุภัณฑ์15 ฟิลด์

data

ฟิลด์ ชนิดข้อมูล คำอธิบาย
skus array ตัวเลือก SKU และราคา รวมถึงปริมาณสินค้าคงคลังที่รายงาน。
skus[] object ตัวเลือก SKU หนึ่งตัวพร้อมคุณสมบัติที่เลือกไว้。
skus[].skuid string ID SKU ถูกส่งกลับมาในรูปแบบสตริง。
skus[].specid string ตัวระบุสำหรับการรวมกันของคุณสมบัติ SKU ถูกส่งกลับมาในรูปแบบสตริง
skus[].sale_price string ราคาขายที่รายงานสำหรับ SKU ถูกส่งกลับมาในรูปแบบข้อความ
skus[].origin_price string ราคาเดิมที่รายงานสำหรับ SKU ถูกส่งกลับมาในรูปแบบข้อความ
skus[].stock integer ปริมาณสินค้าคงคลังที่มีอยู่สำหรับ SKU ถูกรายงาน
skus[].props_ids string ข้อความที่มี ID ของคุณสมบัติและตัวเลือกที่เลือกสำหรับ SKU นี้
skus[].props_names string ข้อความที่มีชื่อของคุณสมบัติและตัวเลือกที่แสดงสำหรับ SKU นี้
skus[].package_info object ขนาดและน้ำหนักของบรรจุภัณฑ์สำหรับ SKU นี้ถูกรายงาน
skus[].package_info.width number ความกว้างของบรรจุภัณฑ์สำหรับ SKU นี้ถูกรายงาน
skus[].package_info.height number ความสูงของบรรจุภัณฑ์สำหรับ SKU นี้ถูกรายงาน
skus[].package_info.length number ความยาวของบรรจุภัณฑ์สำหรับ SKU นี้ถูกรายงาน
skus[].package_info.volume number ปริมาณของบรรจุภัณฑ์สำหรับ SKU นี้ถูกรายงาน
skus[].package_info.weight number น้ำหนักของบรรจุภัณฑ์สำหรับ SKU นี้ถูกรายงาน
ร้านค้า, การจัดส่งและบริการ14 ฟิลด์

data

ฟิลด์ ชนิดข้อมูล คำอธิบาย
shop_info object ตัวระบุของร้านค้าและผู้ขายบน 1688 สำหรับสินค้า
shop_info.shop_name string ชื่อที่แสดงของหน้าร้าน 1688
shop_info.shop_url string ลิงก์ไปยังหน้าร้าน 1688
shop_info.seller_login_id string ชื่อผู้เข้าสู่ระบบของผู้ขายที่แสดงโดยแพลตฟอร์ม
shop_info.seller_user_id string ID ของผู้ขายบน 1688 ถูกส่งกลับมาในรูปแบบสตริง
shop_info.seller_member_id string ID ของสมาชิกผู้ขายบน 1688 ถูกส่งกลับมาในรูปแบบสตริง
delivery_info object ข้อมูลการจัดส่งสำหรับสินค้า
delivery_info.location string ข้อความแสดงต้นทางการจัดส่ง
delivery_info.location_code string รหัสภูมิภาคสำหรับต้นทางการจัดส่งที่รายงาน
delivery_info.delivery_fee number ค่าธรรมเนียมการจัดส่งสำหรับสินค้า
delivery_info.unit_weight number | null น้ำหนักของหน่วยที่รายงาน สามารถเป็น null ได้
delivery_info.template_id string ตัวระบุของเทมเพลตการจัดส่งของแพลตฟอร์ม
service_tags array หมายเลขบริการที่แสดงสำหรับสินค้า
service_tags[] string ข้อความแสดงของหมายเลขบริการ

ตัวอย่างผลการตอบกลับ ​

กำลังโหลดตัวอย่างการตอบกลับ...