---
title: "Kênh chính thức WeChat Tìm kiếm Bài viết API (V1)"
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, với các bộ lọc thời gian công bố và thứ tự, cùng tính năng phân trang bằng trang, số lùi và trạng thái tiếp tục. Sử dụng để khám phá các bài viết gần đây hoặc có tính thú vị cao cho việc nghiên cứu chủ đề và theo dõi nội dung."
lastUpdated: false
aiUsagePrompt: true
---

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

<ApiTester
  method="POST"
  :path='JSON.parse("\"/api/weixin/search-article/v1\"")'
  :summary='JSON.parse("\"Tìm kiếm Bài viết (V1)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/wechat-official-accounts/article-search-v1-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.\"},\"publishTimeType\":{\"type\":\"string\",\"default\":\"ALL\",\"description\":\"Tùy chọn lọc thời gian xuất bản cho bài viết trên WeChat Official Account trong tìm kiếm web.\\n\\nGiá trị có sẵn:\\n- `ALL`: Tất cả thời gian\\n- `ONE_DAY`: Ngày cuối\\n- `SEVEN_DAYS`: Bảy ngày trước\\n- `HALF_YEAR`: Nửa năm trước\",\"enum\":[\"ALL\",\"ONE_DAY\",\"SEVEN_DAYS\",\"HALF_YEAR\"]},\"sortType\":{\"type\":\"string\",\"default\":\"COMPREHENSIVE\",\"description\":\"Thứ tự trả về kết quả tìm kiếm bài viết trên WeChat Official Account trong tìm kiếm web.\\n\\nGiá trị có sẵn:\\n- `COMPREHENSIVE`: Sắp xếp toàn diện\\n- `LATEST`: Đầu tiên theo thời gian mới nhất\\n- `HOT`: Đầu tiên theo trạng thái nóng\",\"enum\":[\"COMPREHENSIVE\",\"LATEST\",\"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 bài viết trên Tài khoản WeChat chính thức và thông tin tiếp tục cho từ khóa yêu cầu.\",\"properties\":{\"continueFlag\":{\"type\":\"integer\",\"description\":\"Thẻ tiếp tục được báo cáo bởi tìm kiếm. Giá trị 1 đi kèm với trạng thái tiếp tục trong các phản hồi được xác thực.\"},\"pageNumber\":{\"type\":\"integer\",\"description\":\"Số trang để sử dụng làm currentPage khi tiếp tục. Trong trình tự được xác thực, trang 1 trả về 2 và trang 2 trả về 3.\"},\"offset\":{\"type\":\"integer\",\"description\":\"Chỉ số để gửi trong trường offset khi yêu cầu trang tiếp theo.\"},\"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 tục được mã hóa dưới dạng JSON. Phân tích chuỗi này và truyền giá trị cookies_buffer không thay đổi vào phần nội dung tiếp theo. Sử dụng chỉ số offset và pageNumber như offset và currentPage.\"},\"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.\"},\"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\":\"Số tổng kết quả được báo cáo bởi nhóm này. Các mục trên trang được liệt kê trong items.\"},\"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\":\"Ngày bài viết theo giây thời gian Unix. Điều này trùng khớp với thời gian đánh dấu trong các phản hồi được xác thực.\"},\"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.\"}}}}}},\"itemShowType\":{\"type\":\"integer\",\"description\":\"Mã trình bày số được báo cáo cho mục tìm kiếm bài viết.\"},\"bizContent\":{\"type\":\"object\",\"description\":\"Thông tin metadata bổ sung của nhà xuất bản cho bài viết, khi được trả về.\",\"properties\":{\"mediaType\":{\"type\":\"integer\",\"description\":\"Mã loại phương tiện được báo cáo cho nội dung nhà xuất bả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ề.\"}}}}}}}},\"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/v1\"")' />

<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, với các bộ lọc thời gian công bố và thứ tự, cùng tính năng phân trang bằng trang, số lùi và trạng thái tiếp tục. Sử dụng để khám phá các bài viết gần đây hoặc có tính thú vị cao cho việc nghiên cứu chủ đề và theo dõi nội dung.</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. |
| <code>publishTimeType</code> | form | <code>string</code> | Không | <code>ALL</code> | Tùy chọn lọc thời gian xuất bản cho bài viết trên WeChat Official Account trong tìm kiếm web.<br /><br><br>Giá trị có sẵn:<br /><br>- <code>ALL</code>: Tất cả thời gian<br /><br>- <code>ONE_DAY</code>: Ngày cuối<br /><br>- <code>SEVEN_DAYS</code>: Bảy ngày trước<br /><br>- <code>HALF_YEAR</code>: Nửa năm trước |
| <code>sortType</code> | form | <code>string</code> | Không | <code>COMPREHENSIVE</code> | Thứ tự trả về kết quả tìm kiếm bài viết trên WeChat Official Account trong tìm kiếm web.<br /><br><br>Giá trị có sẵn:<br /><br>- <code>COMPREHENSIVE</code>: Sắp xếp toàn diện<br /><br>- <code>LATEST</code>: Đầu tiên theo thời gian mới nhất<br /><br>- <code>HOT</code>: Đầu tiên theo trạng thái 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/v1' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'token=YOUR_API_KEY&keyword=string&publishTimeType=ALL&sortType=COMPREHENSIVE&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 (V1)" từ JustOneAPI.
URL cơ sở: https://api.justoneapi.com.
Đường dẫn API: /api/weixin/search-article/v1
Điểm cuối API: BASE_URL + /api/weixin/search-article/v1
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-v1-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. (Bắt buộc)
- publishTimeType (form): Tùy chọn lọc thời gian xuất bản cho bài viết trên WeChat Official Account trong tìm kiếm web.

Giá trị có sẵn:
- `ALL`: Tất cả thời gian
- `ONE_DAY`: Ngày cuối
- `SEVEN_DAYS`: Bảy ngày trước
- `HALF_YEAR`: Nửa năm trước
- sortType (form): Thứ tự trả về kết quả tìm kiếm bài viết trên WeChat Official Account trong tìm kiếm web.

Giá trị có sẵn:
- `COMPREHENSIVE`: Sắp xếp toàn diện
- `LATEST`: Đầu tiên theo thời gian mới nhất
- `HOT`: Đầu tiên theo trạng thái 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/v1"
headers = {
    "Content-Type": "application/x-www-form-urlencoded"
}
data = "token=YOUR_API_KEY&keyword=string&publishTimeType=ALL&sortType=COMPREHENSIVE&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/v1";

const response = await fetch(url, {
  method: "POST",
  headers: Object.fromEntries([
    ["Content-Type", "application/x-www-form-urlencoded"],
  ]),
  body: "token=YOUR_API_KEY&keyword=string&publishTimeType=ALL&sortType=COMPREHENSIVE&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/v1";

        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&publishTimeType=ALL&sortType=COMPREHENSIVE&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/v1"
	var data = strings.NewReader("token=YOUR_API_KEY&keyword=string&publishTimeType=ALL&sortType=COMPREHENSIVE&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/v1';

$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&publishTimeType=ALL&sortType=COMPREHENSIVE&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-v1-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 bài viết trên Tài khoản WeChat chính thức và thông tin tiếp tục cho từ khóa yêu cầu. |
| <code>data.continueFlag</code> | <code>integer</code> | Thẻ tiếp tục được báo cáo bởi tìm kiếm. Giá trị 1 đi kèm với trạng thái tiếp tục trong các phản hồi được xác thực. |
| <code>data.pageNumber</code> | <code>integer</code> | Số trang để sử dụng làm currentPage khi tiếp tục. Trong trình tự được xác thực, trang 1 trả về 2 và trang 2 trả về 3. |
| <code>data.offset</code> | <code>integer</code> | Chỉ số để gửi trong trường offset khi yêu cầu trang tiếp theo. |
| <code>data.cookies</code> | <code>string</code> | Dữ liệu tiếp tục được mã hóa dưới dạng JSON. Phân tích chuỗi này và truyền giá trị cookies_buffer không thay đổi vào phần nội dung tiếp theo. Sử dụng chỉ số offset và pageNumber như offset và currentPage. |
| <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.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> | Số tổng kết quả được báo cáo bởi nhóm này. Các mục trên trang được liệt kê trong items. |
| <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> | Ngày bài viết theo giây thời gian Unix. Điều này trùng khớp với thời gian đánh dấu trong các phản hồi được xác thực. |
| <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.data[].items[].itemShowType</code> | <code>integer</code> | Mã trình bày số được báo cáo cho mục tìm kiếm bài viết. |
| <code>data.data[].items[].bizContent</code> | <code>object</code> | Thông tin metadata bổ sung của nhà xuất bản cho bài viết, khi được trả về. |
| <code>data.data[].items[].bizContent.mediaType</code> | <code>integer</code> | Mã loại phương tiện được báo cáo cho nội dung nhà xuất bả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ề. |

</div>

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

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

