# Tin tức

* /api/article/search: Tính năng này được sử dụng để lấy danh sách bài viết trên Nhanh, phân trang tối đa 50 tin tức/page, hỗ trợ lấy theo id bài viết > id bài viết truyền lên, hỗ trợ lọc bài viết theo danh mục.

## Request

* Xem các [common request params](/v2/readme.md#request-params)
* Các key của mảng **data array** dùng để tạo **data** json string:
*

| Param             | Type | Description                                                                               |
| ----------------- | ---- | ----------------------------------------------------------------------------------------- |
| page              | int  | Phân trang (giá trị mặc định là 1)                                                        |
| icpp              | int  | Số lượng bài viết trên 1 trang. Mặc định là 10. Tối đa không quá 50.                      |
| lastId            | int  | Tìm kiếm bài viết lấy từ bài viết có id > lastId                                          |
| categoryId        | int  | Tìm kiếm theo danh mục bài viết                                                           |
| status            | int  | Tìm kiếm theo trạng thái bài viết: 1 - hiện, 2 - ẩn                                       |
| fromPublishedDate | date | Tìm kiếm ngày đăng bài viết >= fromPublishedDate. Format yyyy-mm-dd (.e.g. 2015-07-16)    |
| toPublishedDate   | date | Tìm kiếm ngày đăng bài viết viết <= toPublishedDate. Format yyyy-mm-dd (.e.g. 2015-07-16) |
| fromExpiredDate   | date | Tìm kiếm ngày hết hạn bài viết >= fromExpiredDate. Format yyyy-mm-dd (.e.g. 2015-07-16)   |
| toExpiredDate     | date | Tìm kiếm ngày hết hạn bài viết <= toExpiredDate. Format yyyy-mm-dd (.e.g. 2015-07-16)     |

## Response

JSON decode the response to get the structure:

| Key      | Type  | Description                               |
| -------- | ----- | ----------------------------------------- |
| code     | int   | 1 = success or 0 = failed                 |
| messages | array | is an array of error messages if code = 0 |
| data     | array | is an array of articles                   |

```javascript
[
    "totalPages" => int, //tổng số page
    "page" => int, // page hiện tại
    "result" => [ // Kết quả trả về
        // article 1
        [
            "id" => int, //id bài viết
            "categoryId" => int, // category id
            "status" => int, // Trạng thái
            "title" => string, // tiêu đề bài viêt
            "intro" => string, // giới thiệu ngắn gọn bài viết
            "content" => string, // Nội dung bài viết,
            "publishedDate" => string, // Ngày đăng bài viết
            "expiredDate" => string, // Ngày hết hạn bài viết
        ],
        // article 2
    ]
]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.nhanh.vn/v2/website/article.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
