API Taobao yêu cầu gói đăng ký trả phí còn hiệu lực. Dùng thử miễn phí 7 ngày chỉ bao gồm 1688 và Weidian. Khi chưa có gói phù hợp, lệnh gọi Taobao trả về HTTP 403 với mã PAID_SUBSCRIPTION_REQUIRED. Nâng cấp gói trong trung tâm nhà phát triển và tiếp tục dùng cùng khóa API.

API tìm kiếm sản phẩm bằng từ khóa

Tương thích: GET /v1/products/search vẫn tồn tại nhưng được đánh dấu lỗi thời trong mã vận hành. Nó dùng tham số q thay cho keyword và trả cấu trúc chuẩn. Tích hợp mới dùng hợp đồng POST JSON bên dưới; GET cũ không hỗ trợ currency hoặc chuyển response_format của POST.

POST /v1/products/search — keyword search returning a paginated product list.

  • Taobao → upstream /traffic/item/search
  • 1688 → upstream product.search.keywordQuery

Related: Product detail · Product response models · Response format

Existing channel-specific fields may be ignored by other channels. The new rating_start validates its channel and response format and returns HTTP 400 when unsupported.

Common request fields

FieldRequiredDescription
channelYes1688 | taobao
keywordYesSearch term
rating_startNoĐiểm trade_score tối thiểu tùy chọn trên trang 1688 hiện tại; số JSON ≥ 0, chỉ định dạng chuẩn. Xem lọc điểm 1688.
languageNoDefault en
page / page_sizeNoPagination (Taobao max 20 per page)
response_formatNostandard (default) or upstream
sort_fieldNoprice | sales | credit (credit is 1688-only; Taobao ignores)
sort_orderNoasc | desc (default asc; use with sort_field)
price_start / price_endNoPrice range in yuan (decimals allowed, e.g. 19.9)
ship_within_hoursNo0 (same day) | 24 | 48
category_idsNoComma-separated category IDs. 1688 only; Taobao ignores. See 1688 categories
product_collection_idNoBusiness pool ID. 1688 only; Taobao ignores

Sort (sort_field + sort_order)

sort_fieldsort_order→ 1688→ Taobao
priceasc / desc{"bid":"asc|desc"}PRICE_ASC / PRICE_DESC
salesasc / desc{"sale":"asc|desc"}SALE_QTY_ASC / SALE_QTY_DESC
creditasc / desc{"credit":"asc|desc"}Ignored

Legacy aliases for sort_field: bid → price, sale → sales.

Price

  • Gateway always uses yuan (decimals OK).
  • 1688 → priceStart / priceEnd.
  • Taobao → filters min_price / max_price in fen (Math.round(yuan * 100)).

Shipping (ship_within_hours)

Value→ 1688 filter→ Taobao filters
0shipInTodayIgnored
24shipIn24Hours24shipping
48shipIn48Hours48shipping

1688-only filters (Taobao ignores)

FieldTypeDescription
experience_score_levelinteger1…4 → totalEpScoreLv1…Lv4
product_attrsstringComma-separated: isOnePsale, isOnePsaleFreePost, new7, new30, 1688Selection, isQqyx
filterstringAdvanced comma-separated tags; merged with semantic fields above
sale_filtersobject[]Maps to saleFilterList (sale_type: sales7 | sales14 | sales30 | totalSales, optional sale_start / sale_end)
keyword_translatebooleanWhether the keyword is already translated

Deprecated aliases: category_id, category_id_list (prefer category_ids).

Examples

1688

POST /v1/products/search
{
  "channel": "1688",
  "keyword": "phone case",
  "language": "en",
  "page": 1,
  "page_size": 20,
  "sort_field": "sales",
  "sort_order": "desc",
  "price_start": 10.5,
  "price_end": 99.9,
  "ship_within_hours": 24,
  "experience_score_level": 2,
  "product_attrs": "isOnePsale,1688Selection",
  "filter": "noReason7DReturn",
  "category_ids": "123,456",
  "product_collection_id": "262105288"
}

Taobao

POST /v1/products/search
{
  "channel": "taobao",
  "keyword": "帽子",
  "language": "en",
  "page": 1,
  "page_size": 20,
  "sort_field": "price",
  "sort_order": "asc",
  "price_start": 20,
  "price_end": 100,
  "ship_within_hours": 24
}

Response

StandardProductList — summary cards in items[]. Call product detail for full SKU matrix and stock.

id / mi_id Taobao thay đổi định kỳ. Đừng cache lâu. Id cũ sẽ làm detail, similar và đơn hàng thất bại. Lấy lại trước khi checkout.

With response_format: "upstream", the response is the channel vendor payload wrapped by HIOBuy (see Response format).

Điểm 1688: lọc trong trang hiện tại

Với POST /v1/products/search và POST /v1/products/seller/search, channel=1688, kết quả chuẩn có items[].trade_score lấy từ tradeScore của tìm kiếm nguồn dưới dạng chuỗi số. Điểm thiếu hoặc không hợp lệ là null; khác với điểm "0" thực. Không gọi thêm API chi tiết sản phẩm.

rating_start tùy chọn phải là số JSON hữu hạn, không âm (ví dụ 4.0). Chỉ giữ sản phẩm có trade_score >= rating_start trong trang nguồn hiện tại, loại điểm thiếu hoặc sai. Bỏ tham số để giữ nguyên trang. Chỉ hỗ trợ channel=1688 và response_format=standard (mặc định); kênh khác hoặc upstream trả HTTP 400 sau khi xác thực và kiểm tra quyền. Weidian không thay đổi.

Đây không phải lọc toàn danh mục hay sắp xếp theo điểm. Giữ thứ tự nguồn; không tải trang khác để bù kết quả. experience_score_level là bộ lọc nguồn khác, không tương đương rating_start.

page, page_size, total giữ ý nghĩa trước lọc (nếu nguồn thiếu tổng số, total là số mục ban đầu trên trang). rating_filter.source_count là số trước lọc, returned_count là số sau lọc. rating_filter.scope luôn là current_page. Siêu dữ liệu chỉ xuất hiện khi yêu cầu lọc.

Kết quả có thể ít hoặc items rỗng dù vẫn còn trang sau. has_next, nếu có, dựa trên phân trang nguồn chưa lọc. Nếu thiếu, chưa biết phân trang; không suy ra trang cuối từ số mục sau lọc. Đặt giới hạn số trang phía máy khách.

Ví dụ tìm theo từ khóa

POST /v1/products/search
{
  "channel": "1688",
  "keyword": "phone case",
  "page": 1,
  "page_size": 20,
  "rating_start": 4.0,
  "response_format": "standard"
}

Ví dụ tìm trong cửa hàng

POST /v1/products/seller/search
{
  "channel": "1688",
  "seller_open_id": "YOUR_1688_SELLER_OPEN_ID",
  "page": 1,
  "page_size": 20,
  "rating_start": 4.0
}

Ví dụ phản hồi đã lọc

{
  "request_id": "req_example_rating",
  "channel": "1688",
  "keyword": "phone case",
  "page": 1,
  "page_size": 20,
  "total": 120,
  "has_next": true,
  "items": [
    {
      "id": "1234567890",
      "channel": "1688",
      "source_product_id": "1234567890",
      "source_url": "https://detail.1688.com/offer/1234567890.html",
      "title": {
        "original": "手机壳",
        "translated": "Phone case",
        "language": "en"
      },
      "price": {
        "original_currency": "CNY",
        "original_amount": 5.45,
        "display_currency": "CNY",
        "display_amount": 5.45
      },
      "image": "https://example.com/product.jpg",
      "seller": {
        "name": "Example seller"
      },
      "trade_score": "4.8"
    }
  ],
  "rating_filter": {
    "rating_start": 4,
    "scope": "current_page",
    "source_count": 20,
    "returned_count": 1
  }
}

Get Support

Need integration help? Contact Developer Support at support@hiobuy.com · Response within 1–2 business days

Email support