> For the complete documentation index, see [llms.txt](https://developers.accesstrade.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.accesstrade.vn/api-publisher-vietnamese/tich-hop-api-publisher-at-cho-chien-dich-tiktok-shop/version-2-updated-version/tiktok-product-search-v2.md).

# Tiktok product search-v2

<https://api.accesstrade.vn/v2/tiktokshop\\_product\\_feeds?sort\\_field=HIGH\\_COMMISSION\\_RATE\\&limit=10\\&title\\_keywords=dép\\&page\\_token=b2Zmc2V0PTEw>

#### Tiktok product search

This endpoint retrieves TikTok shop product feeds with the option to sort by units sold, limit the number of results, and filter by title keywords.

**Parameters**

* `sort_field` (query parameter, required): Specifies the field to sort the results by.
  * 1\. "**RECOMMENDED**" Follow the algorithm recommended order
  * 2\. "**BEST\_SELLERS**" Sort by historical sold numbers from high to low
  * 3\. "**LOW\_PRICE**" Sort by price from low to high
  * 4\. "**HIGH\_PRICE**" Sort by price from high to low
  * 5\. "**NEWLY\_RELEASED**" Sort by the product edition time from late to early
  * 6\. "**HIGH\_COMMISSIOM\_RATE**" Sort by commission rate from high to low"
* `limit` (query parameter, required): Limits the number of results to be returned. In this example, the value is `20`.
* `title_keywords` (query parameter, required): Filters the results by title keywords. In this example, the values are `Khăn giấy` and `Khăn ướt`.

#### \[Example] Tiktok product search

```curl
curl --location -g '{{local}}/v2/tiktokshop_product_feeds?sort_field=RECOMMENDED&limit=10&title_keywords=tr%E1%BA%BB%20em&page_token=b2Zmc2V0PTEw&product_ids=1730264365926091505' \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: en-US,en;q=0.6' \
--header 'authorization: Token {{token_local}} ' \
--header 'content-type: application/json' \
--header 'origin: https://pub2.accesstrade.vn' \
--header 'priority: u=1, i' \
--header 'referer: https://pub2.accesstrade.vn/' \
--header 'sec-ch-ua: "Chromium";v="136", "Brave";v="136", "Not.A/Brand";v="99"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: same-site' \
--header 'sec-gpc: 1' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36' \
--data ''
```

**Response**

Upon a successful request, the server returns a JSON object with the following structure:

```json
{
    "data": {
        "next_page_token": "",
        "products": [
            {
                "category_chains": [
                    {
                        "id": "",
                        "is_leaf": true,
                        "local_name": "",
                        "parent_id": ""
                    }
                ],
                "commission": {
                    "amount": "",
                    "currency": "",
                    "rate": 0
                },
                "detail_link": "",
                "has_inventory": true,
                "id": "",
                "main_image_url": "",
                "original_price": {
                    "currency": "",
                    "maximum_amount": "",
                    "minimum_amount": ""
                },
                "sale_region": "",
                "sales_price": {
                    "currency": "",
                    "maximum_amount": "",
                    "minimum_amount": ""
                },
                "shop": {
                    "name": ""
                },
                "title": "",
                "units_sold": 0
            }
        ],
        "total_count": 0
    },
    "status": true
}
```

The `data` object contains the retrieved product feeds, including the `products` array, which holds the details of each product. The `total_count` indicates the total number of products available.

```
data
├── products: []
│   └── object (A list of products.)
├── shop: object
│   ├── name: string (The TikTok Shop name.)
│   └── id: string (The product identifier.)
├── has_inventory: bool (Set to true if there are more than zero units of the product in inventory. Set to false if there are zero units in inventory.)
├── units_sold: int (Total number of units sold. Units are indexed to SKU. Note that if the creator has not given permission for precise data sharing, this property will not be present.)
├── title: string (The product name.)
├── sale_region: string (The region where the product is offered for sale.)
├── main_image_url: string (The product image URL.)
├── detail_link: string (The URL for the product's detail page.)
├── original_price: object
│   ├── currency: string (The currency code.)
│   ├── minimum_amount: string (The lowest original price of all SKUs of the product.)
│   └── maximum_amount: string (The highest original price of all SKUs of the product.)
├── category_chains: []
│   └── object (A list of categories associated with the product. Maximum length of the list is 3 categories.)
│       ├── id: string (The category identifier.)
│       ├── local_name: string (The name of the product in the category.)
│       ├── is_leaf: bool (Set to true if this category is a leaf node. Set to false if not.)
│       └── parent_id: string (The category identifier of the parent category.)
├── commission: object
│   ├── rate: int (The commission rate in hundredths of a percent. For example, 3587 is a commission rate of 35.87%. This value must a minimum of 1000. The range of this value is [100, 8000].)
│   ├── currency: string (The currency code.)
│   └── amount: string (The commission amount.)
├── sales_price: object
│   ├── currency: string (The currency code.)
│   ├── minimum_amount: string (The lowest promotion price of all SKUs of this product.)
│   └── maximum_amount: string (The highest promotion price of all SKUs of this product.)
├── next_page_token: string (An opaque token used to retrieve the next page of a paginated result set.)
└── total_count: int (Total count of products meeting the search criteria expressed in the request body.)
```

**Example**

```http
GET https://api-v1.dev.accesstrade.me/v1/tiktokshop_product_feeds?sort_field=units_sold&limit=20&title_keywords=Khăn giấy &title_keywords=Khăn ướt
```

| **Tên Header**         | **Giá trị**                                                                                                             |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **accept**             | application/json, text/plain, */*                                                                                       |
| **accept-language**    | en-US,en;q=0.6                                                                                                          |
| **authorization**      | Token {{token\_local}} *(Token của user lấy tại link)*                                                                  |
| **content-type**       | application/json                                                                                                        |
| **origin**             | <https://pub2.accesstrade.vn>                                                                                           |
| **priority**           | u=1, i                                                                                                                  |
| **referer**            | <https://pub2.accesstrade.vn/>                                                                                          |
| **sec-ch-ua**          | "Chromium";v="136", "Brave";v="136", "Not.A/Brand";v="99"                                                               |
| **sec-ch-ua-mobile**   | ?0                                                                                                                      |
| **sec-ch-ua-platform** | "macOS"                                                                                                                 |
| **sec-fetch-dest**     | empty                                                                                                                   |
| **sec-fetch-mode**     | cors                                                                                                                    |
| **sec-fetch-site**     | same-site                                                                                                               |
| **sec-gpc**            | 1                                                                                                                       |
| **user-agent**         | Mozilla/5.0 (Macintosh; Intel Mac OS X 10\_15\_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 |

| **Trường**          | **Giá trị**                                                                                               |
| ------------------- | --------------------------------------------------------------------------------------------------------- |
| **sort\_field**     | HIGH\_COMMISSION\_RATE                                                                                    |
|                     | *Mặc định nếu bỏ trống sẽ là "RECOMMENDED"*                                                               |
|                     | **Các giá trị hợp lệ:**                                                                                   |
|                     | - "RECOMMENDED" – Sắp xếp theo thứ tự đề xuất của thuật toán                                              |
|                     | - "BEST\_SELLERS" – Sắp xếp theo số lượng bán trong lịch sử từ cao đến thấp                               |
|                     | - "LOW\_PRICE" – Sắp xếp theo giá từ thấp đến cao                                                         |
|                     | - "HIGH\_PRICE" – Sắp xếp theo giá từ cao đến thấp                                                        |
|                     | - "NEWLY\_RELEASED" – Sắp xếp theo thời gian ra mắt sản phẩm từ mới đến cũ                                |
|                     | - "HIGH\_COMMISSION\_RATE" – Sắp xếp theo tỷ lệ hoa hồng từ cao đến thấp                                  |
| **limit**           | 10                                                                                                        |
| **title\_keywords** | dép                                                                                                       |
| **page\_token**     | <p>b2Zmc2V0PTEw<br>\<sub>Token của trang tiếp theo được trả trong response "next\_page\_token"\</sub></p> |
| **product\_ids**    | 1730264365926091505                                                                                       |
