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

1688 รายละเอียดสินค้า [URL] API (V1) ​

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

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

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

คำแนะนำ

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

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

ชื่อ ตำแหน่ง ชนิดข้อมูล จำเป็น ค่าเริ่มต้น คำอธิบาย
token query string ใช่ - โทเค็นการเข้าถึงสำหรับบริการ API นี้
url query string ใช่ - URL สินค้าบน 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-by-url/v1?token=YOUR_API_KEY&url=VALUE'
text
ฉันต้องการใช้ API "รายละเอียดสินค้า [URL] (V1)" จาก JustOneAPI.
URL หลัก: https://api.justoneapi.com.
เส้นทาง API: /api/1688/get-item-detail-by-url/v1?token=YOUR_API_KEY&url=VALUE
เอนด์พอยต์ API: BASE_URL + /api/1688/get-item-detail-by-url/v1?token=YOUR_API_KEY&url=VALUE
เมธอด HTTP: GET
การยืนยันตัวตน: เพิ่มพารามิเตอร์ "token" เข้าไปใน URL.
คำนิยาม OpenAPI: https://docs.justoneapi.com/openapi/1688/product-details-by-url-v1-th.json

พารามิเตอร์:
- token (query): โทเค็นการเข้าถึงสำหรับบริการ API นี้ (จำเป็น)
- url (query): URL สินค้าบน 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-by-url/v1?token=YOUR_API_KEY&url=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-by-url/v1?token=YOUR_API_KEY&url=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-by-url/v1?token=YOUR_API_KEY&url=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-by-url/v1?token=YOUR_API_KEY&url=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-by-url/v1?token=YOUR_API_KEY&url=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).

ผลิตภัณฑ์และสื่อ9 ฟิลด์

data

ฟิลด์ ชนิดข้อมูล คำอธิบาย
item_id integer ID ของข้อเสนอบน 1688 ถูกส่งกลับมาในรูปแบบจำนวนเต็ม
title string ชื่อสินค้าที่ส่งกลับ
product_url string URL ของหน้าสินค้า 1688.
category_id integer ID ของหมวดหมู่ที่รายงานสำหรับสินค้า.
root_category_id integer ID ของหมวดหมู่ระดับสูงที่รายงานสำหรับสินค้า.
created_at integer เวลาที่สร้างสินค้า ในรูปแบบเวลาประทับ Unix หน่วยมิลลิวินาที
main_imgs array URL ของรูปภาพที่ส่งกลับสำหรับสินค้า.
main_imgs[] string -
video_url string URL ของวิดีโอสินค้า, หากมีการส่งกลับ.
คุณสมบัติของสินค้า3 ฟิลด์

data

ฟิลด์ ชนิดข้อมูล คำอธิบาย
product_props array คุณสมบัติของสินค้า. แต่ละรายการแสดงชื่อคุณสมบัติกับค่าตัวอักษรของมัน.
product_props[] object -
product_props[].{key} string ค่าของคุณสมบัติของสินค้า, เรียงตามชื่อคุณสมบัติ.
ราคาและการขาย20 ฟิลด์

data

ฟิลด์ ชนิดข้อมูล คำอธิบาย
currency string รหัสสกุลเงินที่รายงานสำหรับราคาสินค้า
offer_unit 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 แถวการตั้งราคาขนาดสินค้า. คำตอบที่ได้รับตรวจสอบส่งกลับอาร์เรย์ว่างเปล่า.
mixed_batch object | null ข้อมูลการสั่งซื้อแบบผสม, หรือ null หากไม่มี.
mixed_batch.mix_amount integer จำนวนที่รายงานสำหรับการสั่งซื้อแบบผสม.
mixed_batch.mix_num integer ปริมาณที่รายงานสำหรับการสั่งซื้อแบบผสม.
sale_count string จำนวนการขายที่รายงานในรูปแบบข้อความแสดงผล. อาจว่างเปล่า.
sale_info object จำนวนการขายที่รายงานสำหรับสินค้า.
sale_info.sale_quantity_year integer ปริมาณการขายประจำปีที่รายงานไว้。
sale_info.sale_quantity_90days - ฟิลด์ปริมาณการขาย 90 วัน。คำตอบที่ตรวจสอบแล้วจะคืนค่า null。
SKU และสต็อก26 ฟิลด์

data

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

data

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

data

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

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

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