---
title: "Kênh chính thức WeChat Tìm kiếm Bài viết API (V2)"
description: "Tìm kiếm các bài viết trên tài khoản chính thức WeChat bằng từ khóa trong một danh mục cụ thể như tài khoản được theo dõi, mới nhất, bài viết được đọc gần nhất hoặc hot, với tính năng phân trang tiếp tục. Sử dụng để tập trung khám phá các bài viết trong một lĩnh vực cụ thể."
lastUpdated: false
aiUsagePrompt: true
---

# Kênh chính thức WeChat Tìm kiếm Bài viết API \(V2\)

<ApiTester
  method="POST"
  :path='JSON.parse("\"/api/weixin/search-article/v2\"")'
  :summary='JSON.parse("\"Tìm kiếm Bài viết (V2)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/wechat-official-accounts/article-search-v2-vi.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[]")'
  :requestBody='JSON.parse("{\"content\":{\"application/x-www-form-urlencoded\":{\"schema\":{\"type\":\"object\",\"properties\":{\"token\":{\"type\":\"string\",\"description\":\"Token truy cập cho dịch vụ API này.\"},\"keyword\":{\"type\":\"string\",\"description\":\"Từ khóa tìm kiếm cho bài viết trên WeChat Official Account được phân loại trong tìm kiếm web.\"},\"subSearchType\":{\"type\":\"string\",\"default\":\"ALL\",\"description\":\"Tùy chọn lọc phụ loại cho bài viết trên WeChat Official Account được phân loại trong tìm kiếm web.\\n\\nGiá trị có sẵn:\\n- `ALL`: Tất cả\\n- `FOLLOWED`: Những tài khoản được theo dõi\\n- `LATEST`: Thời gian mới nhất\\n- `RECENT_READ`: Được đọc gần nhất\\n- `HOT`: Nóng\",\"enum\":[\"ALL\",\"FOLLOWED\",\"LATEST\",\"RECENT_READ\",\"HOT\"]},\"currentPage\":{\"type\":\"integer\",\"format\":\"int32\",\"default\":1,\"description\":\"Số trang hiện tại bắt đầu từ 1 cho việc lọc kết quả tìm kiếm trên WeChat web.\"},\"offset\":{\"type\":\"integer\",\"format\":\"int32\",\"default\":0,\"description\":\"Khoảng trống kết quả tìm kiếm được trả về từ phản hồi trước. Sử dụng 0 cho trang đầu tiên.\"},\"cookies_buffer\":{\"type\":\"string\",\"default\":\"\",\"description\":\"Trạng thái phân trang được trả về từ phản hồi tìm kiếm web WeChat trước đó. Để trống khi lấy trang đầu tiên. Với điểm cuối POST này, hãy gửi giá trị đó trong nội dung biểu mẫu application/x-www-form-urlencoded.\"}},\"required\":[\"keyword\",\"token\"]}}},\"required\":true}")'
  :responses='JSON.parse("{\"200\":{\"description\":\"OK\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"type\":\"object\",\"description\":\"Kết quả tìm kiếm và thông tin tiếp tục cho trang yêu cầu. Đáp ứng API thành công có thể chứa đối tượng rỗng khi trạng thái tiếp tục không thể sử dụng.\",\"properties\":{\"data\":{\"type\":\"array\",\"description\":\"Nhóm kết quả bài viết được trả về cho trang yêu cầu.\",\"items\":{\"type\":\"object\",\"description\":\"Một nhóm kết quả tìm kiếm bài viết.\",\"properties\":{\"count\":{\"type\":\"integer\",\"description\":\"Số lượng bài viết được báo cáo trong nhóm này cho trang hiện tại.\"},\"totalCount\":{\"type\":\"integer\",\"description\":\"Tổng số báo cáo về nhóm kết quả. Số này có thể thay đổi giữa các trang.\"},\"items\":{\"type\":\"array\",\"description\":\"Bài viết được bao gồm trong nhóm này trên trang hiện tại.\",\"items\":{\"type\":\"object\",\"description\":\"Một bài viết trong nhóm kết quả tìm kiếm.\",\"properties\":{\"docID\":{\"type\":\"string\",\"description\":\"Định danh tài liệu được báo cáo cho kết quả tìm kiếm bài viết này.\"},\"title\":{\"type\":\"string\",\"description\":\"Tiêu đề bài viết được hiển thị trong kết quả tìm kiếm.\"},\"desc\":{\"type\":\"string\",\"description\":\"Trích dẫn bài viết được hiển thị trong kết quả tìm kiếm.\"},\"doc_url\":{\"type\":\"string\",\"description\":\"Liên kết đến tài khoản chính thức WeChat của bài viết.\"},\"thumbUrl\":{\"type\":\"string\",\"description\":\"Liên kết đến hình nền được hiển thị cho kết quả tìm kiếm.\"},\"timestamp\":{\"type\":\"integer\",\"description\":\"Thời gian bài viết được báo cáo theo giây thời gian Unix.\"},\"date\":{\"type\":\"integer\",\"description\":\"Giá trị ngày bài viết số học được trả về trong kết quả tìm kiếm.\"},\"docType\":{\"type\":\"integer\",\"description\":\"Mã loại tài liệu số được báo cáo cho kết quả tìm kiếm.\"},\"src_type\":{\"type\":\"integer\",\"description\":\"Mã loại nguồn số được báo cáo cho bài viết.\"},\"source\":{\"type\":\"object\",\"description\":\"Thông tin nguồn xuất bản được hiển thị cho bài viết.\",\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"Tên hiển thị của nguồn bài viết, khi được trả về.\"},\"dateTime\":{\"type\":\"string\",\"description\":\"Thời gian được định dạng hiển thị cùng với nguồn bài viết.\"},\"tag\":{\"type\":\"array\",\"description\":\"Thẻ hiển thị liên quan đến nguồn này.\",\"items\":{\"type\":\"object\",\"description\":\"Một thẻ hiển thị cho nguồn.\",\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"Văn bản hiển thị của thẻ nguồn.\"},\"type\":{\"type\":\"integer\",\"description\":\"Mã loại số được báo cáo cho thẻ nguồn.\"},\"noBg\":{\"type\":\"boolean\",\"description\":\"Liệu thẻ nguồn có được đánh dấu để hiển thị không có nền hay không.\"}}}}}}}}}}}},\"continueFlag\":{\"type\":\"integer\",\"description\":\"Thẻ chỉ định xem liệu báo cáo tìm kiếm có thêm các trang nữa hay không. Giá trị được ghi là 1 cho thêm trang và 0 ở cuối. Trang cuối cùng vẫn có thể chứa các bài viết.\"},\"offset\":{\"type\":\"integer\",\"description\":\"Chênh lệch để gửi trong yêu cầu tiếp theo khi có trang mới sẵn sàng.\"},\"pageNumber\":{\"type\":\"integer\",\"description\":\"Số trang được báo cáo cho phản hồi tìm kiếm hiện tại.\"},\"cookies\":{\"type\":\"string\",\"contentMediaType\":\"application/json\",\"contentSchema\":{\"type\":\"object\",\"description\":\"Đối tượng tiếp tục được mã hóa bên trong chuỗi phản hồi.\"},\"description\":\"Dữ liệu tiếp theo được mã hóa dưới dạng JSON. Đối với trang tiếp theo, phân tích chuỗi này và truyền giá trị cookies_buffer của nó vào phần nội dung yêu cầu cùng với chênh lệch và currentPage tiếp theo.\"},\"ret\":{\"type\":\"integer\",\"description\":\"Mã trạng thái tìm kiếm được báo cáo bên trong dữ liệu kết quả.\"},\"query\":{\"type\":\"string\",\"description\":\"Văn bản truy vấn tìm kiếm được phản hồi trong kết quả.\"},\"lang\":{\"type\":\"string\",\"description\":\"Thẻ ngôn ngữ được báo cáo cho dữ liệu kết quả.\"},\"timeStamp\":{\"type\":\"integer\",\"description\":\"Thời điểm được báo cáo cho phản hồi tìm kiếm dưới dạng giây Unix epoch.\"},\"nomoreText\":{\"type\":\"string\",\"description\":\"Thông báo hiển thị ở cuối kết quả tìm kiếm, khi có sẵn.\"},\"category\":{\"type\":\"array\",\"description\":\"Thẻ loại tìm kiếm được trả về cùng với kết quả, khi có sẵn.\",\"items\":{\"type\":\"object\",\"description\":\"Một loại tìm kiếm.\",\"properties\":{\"word\":{\"type\":\"string\",\"description\":\"Nhãn hiển thị của danh mục tìm kiếm.\"},\"type\":{\"type\":\"integer\",\"description\":\"Mã loại loại tìm kiếm được trả về bởi tìm kiếm.\"},\"selected\":{\"type\":\"integer\",\"description\":\"Thẻ đánh dấu lựa chọn số cho loại này, khi được trả về.\"}}}},\"slideFilter\":{\"type\":\"object\",\"description\":\"Thông tin metadata của các bộ lọc được hiển thị cùng với kết quả tìm kiếm.\",\"properties\":{\"filters\":{\"type\":\"array\",\"description\":\"Các bộ lọc được hiển thị cùng với danh sách kết quả.\",\"items\":{\"type\":\"object\",\"description\":\"Một bộ lọc kết quả được hiển thị.\",\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"Tiêu đề hiển thị của bộ lọc tìm kiếm.\"},\"options\":{\"type\":\"array\",\"description\":\"Tùy chọn hiển thị được báo cáo cho bộ lọc.\",\"items\":{\"type\":\"object\",\"description\":\"Một tùy chọn hiển thị cho bộ lọc tìm kiếm.\",\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"Nhãn hiển thị của tùy chọn bộ lọc.\"},\"selected\":{\"type\":\"integer\",\"description\":\"Thẻ chỉ định chọn số cho tùy chọn bộ lọc này, khi được trả về.\"},\"iconUrl\":{\"type\":\"string\",\"description\":\"Liên kết biểu tượng được hiển thị cho tùy chọn bộ lọc này.\"},\"selectedIconUrl\":{\"type\":\"string\",\"description\":\"Liên kết biểu tượng cho trạng thái được chọn của tùy chọn bộ lọc.\"}}}}}}}}}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"Các tham số hoặc nội dung yêu cầu không hợp lệ.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"Tài khoản truy cập không hợp lệ hoặc không hoạt động.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"Quyền truy cập bị từ chối.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"Tốc độ yêu cầu hoặc giới hạn hàng ngày đã vượt quá.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"Lỗi máy chủ nội bộ.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"Dịch vụ tạm thời không khả dụng.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"API sản xuất toàn cục (mặc định)\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/weixin/search-article/v2\"")' />

<p>Tìm kiếm các bài viết trên tài khoản chính thức WeChat bằng từ khóa trong một danh mục cụ thể như tài khoản được theo dõi, mới nhất, bài viết được đọc gần nhất hoặc hot, với tính năng phân trang tiếp tục. Sử dụng để tập trung khám phá các bài viết trong một lĩnh vực cụ thể.</p>

## Nội dung yêu cầu

<div class="api-doc-table api-doc-table--params">

| Tên | Vị trí | Kiểu dữ liệu | Bắt buộc | Mặc định | Mô tả |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | form | <code>string</code> | Đúng | - | Token truy cập cho dịch vụ API này. |
| <code>keyword</code> | form | <code>string</code> | Đúng | - | Từ khóa tìm kiếm cho bài viết trên WeChat Official Account được phân loại trong tìm kiếm web. |
| <code>subSearchType</code> | form | <code>string</code> | Không | <code>ALL</code> | Tùy chọn lọc phụ loại cho bài viết trên WeChat Official Account được phân loại trong tìm kiếm web.<br /><br><br>Giá trị có sẵn:<br /><br>- <code>ALL</code>: Tất cả<br /><br>- <code>FOLLOWED</code>: Những tài khoản được theo dõi<br /><br>- <code>LATEST</code>: Thời gian mới nhất<br /><br>- <code>RECENT_READ</code>: Được đọc gần nhất<br /><br>- <code>HOT</code>: Nóng |
| <code>currentPage</code> | form | <code>integer</code> | Không | <code>1</code> | Số trang hiện tại bắt đầu từ 1 cho việc lọc kết quả tìm kiếm trên WeChat web. |
| <code>offset</code> | form | <code>integer</code> | Không | <code>0</code> | Khoảng trống kết quả tìm kiếm được trả về từ phản hồi trước. Sử dụng 0 cho trang đầu tiên. |
| <code>cookies_buffer</code> | form | <code>string</code> | Không | <code></code> | Trạng thái phân trang được trả về từ phản hồi tìm kiếm web WeChat trước đó. Để trống khi lấy trang đầu tiên. Với điểm cuối POST này, hãy gửi giá trị đó trong nội dung biểu mẫu application/x-www-form-urlencoded. |

</div>

## Ví dụ mã hóa

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X POST 'https://api.justoneapi.com/api/weixin/search-article/v2' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'token=YOUR_API_KEY&keyword=string&subSearchType=ALL&currentPage=1&offset=0&cookies_buffer='
```

```text [🤖 Lời hướng dẫn AI]
Tôi muốn sử dụng API "Tìm kiếm Bài viết (V2)" từ JustOneAPI.
URL cơ sở: https://api.justoneapi.com.
Đường dẫn API: /api/weixin/search-article/v2
Điểm cuối API: BASE_URL + /api/weixin/search-article/v2
Phương thức HTTP: POST
Xác thực: Gửi "token" dưới dạng trường nội dung kiểu application/x-www-form-urlencoded.
Định nghĩa OpenAPI: https://docs.justoneapi.com/openapi/wechat-official-accounts/article-search-v2-vi.json
Phần tiêu đề yêu cầu:
- Content-Type: application/x-www-form-urlencoded

Nội dung yêu cầu (Biểu mẫu):
- token (form): Token truy cập cho dịch vụ API này. (Bắt buộc)
- keyword (form): Từ khóa tìm kiếm cho bài viết trên WeChat Official Account được phân loại trong tìm kiếm web. (Bắt buộc)
- subSearchType (form): Tùy chọn lọc phụ loại cho bài viết trên WeChat Official Account được phân loại trong tìm kiếm web.

Giá trị có sẵn:
- `ALL`: Tất cả
- `FOLLOWED`: Những tài khoản được theo dõi
- `LATEST`: Thời gian mới nhất
- `RECENT_READ`: Được đọc gần nhất
- `HOT`: Nóng
- currentPage (form): Số trang hiện tại bắt đầu từ 1 cho việc lọc kết quả tìm kiếm trên WeChat web.
- offset (form): Khoảng trống kết quả tìm kiếm được trả về từ phản hồi trước. Sử dụng 0 cho trang đầu tiên.
- cookies_buffer (form): Trạng thái phân trang được trả về từ phản hồi tìm kiếm web WeChat trước đó. Để trống khi lấy trang đầu tiên. Với điểm cuối POST này, hãy gửi giá trị đó trong nội dung biểu mẫu application/x-www-form-urlencoded.

Định dạng trả về: Xử lý an toàn phản hồi JSON hoặc văn bản dựa trên Content-Type thực tế.

Xử lý phản hồi và mã lỗi:
1. Đọc kết quả xử lý từ trường "code" trong nội dung phản hồi (mã 0 là thành công).
2. Thời gian chờ đề xuất: 120 giây. Nếu 120 giây quá dài, hãy dành ít nhất 60 giây. Một số yêu cầu có thể hết thời gian chờ trước khi có kết quả.
3. Mã kết quả:
   - 0: Thành công
   - 100: Token không hợp lệ hoặc đã bị vô hiệu hóa
   - 301: Không lấy được dữ liệu. Hãy thử lại.
   - 302: Vượt giới hạn tần suất gọi
   - 303: Vượt hạn mức trong ngày
   - 400: Tham số không hợp lệ
   - 500: Lỗi nội bộ máy chủ
   - 600: Không có quyền truy cập
   - 601: Không đủ số dư
   - 602: Đã chạm giới hạn ngân sách token
4. Mã 601 nghĩa là số dư dùng chung của tài khoản không đủ. Mã 602 nghĩa là token API đã chạm giới hạn ngân sách tích lũy riêng. Việc đặt ngân sách cho token không chuyển tiền khỏi số dư dùng chung.

Xin hãy giúp tôi viết một script bằng ngôn ngữ lập trình yêu thích để gọi API này và xử lý phản hồi.
```

```python [🐍 Python]
import requests

BASE_URL = "https://api.justoneapi.com"  # Được cung cấp bởi các server OpenAPI

url = BASE_URL + "/api/weixin/search-article/v2"
headers = {
    "Content-Type": "application/x-www-form-urlencoded"
}
data = "token=YOUR_API_KEY&keyword=string&subSearchType=ALL&currentPage=1&offset=0&cookies_buffer="
response = requests.post(url, headers=headers, data=data, 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 [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // Được cung cấp bởi các server OpenAPI
const url = BASE_URL + "/api/weixin/search-article/v2";

const response = await fetch(url, {
  method: "POST",
  headers: Object.fromEntries([
    ["Content-Type", "application/x-www-form-urlencoded"],
  ]),
  body: "token=YOUR_API_KEY&keyword=string&subSearchType=ALL&currentPage=1&offset=0&cookies_buffer=",
  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 [☕ 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"; // Được cung cấp bởi các server OpenAPI
        final String url = BASE_URL + "/api/weixin/search-article/v2";

        HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
        HttpRequest.Builder builder = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(120))
            .header("Content-Type", "application/x-www-form-urlencoded")
            .method("POST", HttpRequest.BodyPublishers.ofString("token=YOUR_API_KEY&keyword=string&subSearchType=ALL&currentPage=1&offset=0&cookies_buffer="));

        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 [🐹 Go]
package main

import (
	"fmt"
	"io"
	"os"
	"strings"
	"net/http"
	"time"
)

const BASE_URL = "https://api.justoneapi.com" // Được cung cấp bởi các server OpenAPI

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/weixin/search-article/v2"
	var data = strings.NewReader("token=YOUR_API_KEY&keyword=string&subSearchType=ALL&currentPage=1&offset=0&cookies_buffer=")
	req, _ := http.NewRequest("POST", url, data)
	req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
	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]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Được cung cấp bởi các server OpenAPI
$url = $BASE_URL . '/api/weixin/search-article/v2';

$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, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, 'token=YOUR_API_KEY&keyword=string&subSearchType=ALL&currentPage=1&offset=0&cookies_buffer=');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/x-www-form-urlencoded',
]);
$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;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/wechat-official-accounts/article-search-v2-vi.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[Định nghĩa OpenAPI (JSON)]</a>
</div>

## Các trường trong phản hồi

Các trường chính trong phản hồi thành công (`code = 0`).

<div class="api-doc-table api-doc-table--response">

| Đường dẫn trường | Kiểu dữ liệu | Mô tả |
| --- | --- | --- |
| <code>data</code> | <code>object</code> | Kết quả tìm kiếm và thông tin tiếp tục cho trang yêu cầu. Đáp ứng API thành công có thể chứa đối tượng rỗng khi trạng thái tiếp tục không thể sử dụng. |
| <code>data.data</code> | <code>array</code> | Nhóm kết quả bài viết được trả về cho trang yêu cầu. |
| <code>data.data[]</code> | <code>object</code> | Một nhóm kết quả tìm kiếm bài viết. |
| <code>data.data[].count</code> | <code>integer</code> | Số lượng bài viết được báo cáo trong nhóm này cho trang hiện tại. |
| <code>data.data[].totalCount</code> | <code>integer</code> | Tổng số báo cáo về nhóm kết quả. Số này có thể thay đổi giữa các trang. |
| <code>data.data[].items</code> | <code>array</code> | Bài viết được bao gồm trong nhóm này trên trang hiện tại. |
| <code>data.data[].items[]</code> | <code>object</code> | Một bài viết trong nhóm kết quả tìm kiếm. |
| <code>data.data[].items[].docID</code> | <code>string</code> | Định danh tài liệu được báo cáo cho kết quả tìm kiếm bài viết này. |
| <code>data.data[].items[].title</code> | <code>string</code> | Tiêu đề bài viết được hiển thị trong kết quả tìm kiếm. |
| <code>data.data[].items[].desc</code> | <code>string</code> | Trích dẫn bài viết được hiển thị trong kết quả tìm kiếm. |
| <code>data.data[].items[].doc_url</code> | <code>string</code> | Liên kết đến tài khoản chính thức WeChat của bài viết. |
| <code>data.data[].items[].thumbUrl</code> | <code>string</code> | Liên kết đến hình nền được hiển thị cho kết quả tìm kiếm. |
| <code>data.data[].items[].timestamp</code> | <code>integer</code> | Thời gian bài viết được báo cáo theo giây thời gian Unix. |
| <code>data.data[].items[].date</code> | <code>integer</code> | Giá trị ngày bài viết số học được trả về trong kết quả tìm kiếm. |
| <code>data.data[].items[].docType</code> | <code>integer</code> | Mã loại tài liệu số được báo cáo cho kết quả tìm kiếm. |
| <code>data.data[].items[].src_type</code> | <code>integer</code> | Mã loại nguồn số được báo cáo cho bài viết. |
| <code>data.data[].items[].source</code> | <code>object</code> | Thông tin nguồn xuất bản được hiển thị cho bài viết. |
| <code>data.data[].items[].source.title</code> | <code>string</code> | Tên hiển thị của nguồn bài viết, khi được trả về. |
| <code>data.data[].items[].source.dateTime</code> | <code>string</code> | Thời gian được định dạng hiển thị cùng với nguồn bài viết. |
| <code>data.data[].items[].source.tag</code> | <code>array</code> | Thẻ hiển thị liên quan đến nguồn này. |
| <code>data.data[].items[].source.tag[]</code> | <code>object</code> | Một thẻ hiển thị cho nguồn. |
| <code>data.data[].items[].source.tag[].title</code> | <code>string</code> | Văn bản hiển thị của thẻ nguồn. |
| <code>data.data[].items[].source.tag[].type</code> | <code>integer</code> | Mã loại số được báo cáo cho thẻ nguồn. |
| <code>data.data[].items[].source.tag[].noBg</code> | <code>boolean</code> | Liệu thẻ nguồn có được đánh dấu để hiển thị không có nền hay không. |
| <code>data.continueFlag</code> | <code>integer</code> | Thẻ chỉ định xem liệu báo cáo tìm kiếm có thêm các trang nữa hay không. Giá trị được ghi là 1 cho thêm trang và 0 ở cuối. Trang cuối cùng vẫn có thể chứa các bài viết. |
| <code>data.offset</code> | <code>integer</code> | Chênh lệch để gửi trong yêu cầu tiếp theo khi có trang mới sẵn sàng. |
| <code>data.pageNumber</code> | <code>integer</code> | Số trang được báo cáo cho phản hồi tìm kiếm hiện tại. |
| <code>data.cookies</code> | <code>string</code> | Dữ liệu tiếp theo được mã hóa dưới dạng JSON. Đối với trang tiếp theo, phân tích chuỗi này và truyền giá trị cookies_buffer của nó vào phần nội dung yêu cầu cùng với chênh lệch và currentPage tiếp theo. |
| <code>data.cookies (JSON)</code> | <code>object</code> | Đối tượng tiếp tục được mã hóa bên trong chuỗi phản hồi. |
| <code>data.ret</code> | <code>integer</code> | Mã trạng thái tìm kiếm được báo cáo bên trong dữ liệu kết quả. |
| <code>data.query</code> | <code>string</code> | Văn bản truy vấn tìm kiếm được phản hồi trong kết quả. |
| <code>data.lang</code> | <code>string</code> | Thẻ ngôn ngữ được báo cáo cho dữ liệu kết quả. |
| <code>data.timeStamp</code> | <code>integer</code> | Thời điểm được báo cáo cho phản hồi tìm kiếm dưới dạng giây Unix epoch. |
| <code>data.nomoreText</code> | <code>string</code> | Thông báo hiển thị ở cuối kết quả tìm kiếm, khi có sẵn. |
| <code>data.category</code> | <code>array</code> | Thẻ loại tìm kiếm được trả về cùng với kết quả, khi có sẵn. |
| <code>data.category[]</code> | <code>object</code> | Một loại tìm kiếm. |
| <code>data.category[].word</code> | <code>string</code> | Nhãn hiển thị của danh mục tìm kiếm. |
| <code>data.category[].type</code> | <code>integer</code> | Mã loại loại tìm kiếm được trả về bởi tìm kiếm. |
| <code>data.category[].selected</code> | <code>integer</code> | Thẻ đánh dấu lựa chọn số cho loại này, khi được trả về. |
| <code>data.slideFilter</code> | <code>object</code> | Thông tin metadata của các bộ lọc được hiển thị cùng với kết quả tìm kiếm. |
| <code>data.slideFilter.filters</code> | <code>array</code> | Các bộ lọc được hiển thị cùng với danh sách kết quả. |
| <code>data.slideFilter.filters[]</code> | <code>object</code> | Một bộ lọc kết quả được hiển thị. |
| <code>data.slideFilter.filters[].title</code> | <code>string</code> | Tiêu đề hiển thị của bộ lọc tìm kiếm. |
| <code>data.slideFilter.filters[].options</code> | <code>array</code> | Tùy chọn hiển thị được báo cáo cho bộ lọc. |
| <code>data.slideFilter.filters[].options[]</code> | <code>object</code> | Một tùy chọn hiển thị cho bộ lọc tìm kiếm. |
| <code>data.slideFilter.filters[].options[].title</code> | <code>string</code> | Nhãn hiển thị của tùy chọn bộ lọc. |
| <code>data.slideFilter.filters[].options[].selected</code> | <code>integer</code> | Thẻ chỉ định chọn số cho tùy chọn bộ lọc này, khi được trả về. |
| <code>data.slideFilter.filters[].options[].iconUrl</code> | <code>string</code> | Liên kết biểu tượng được hiển thị cho tùy chọn bộ lọc này. |
| <code>data.slideFilter.filters[].options[].selectedIconUrl</code> | <code>string</code> | Liên kết biểu tượng cho trạng thái được chọn của tùy chọn bộ lọc. |

</div>

## Ví dụ phản hồi

<ApiExampleSection :api='JSON.parse("\"/api/weixin/search-article/v2\"")' />

