# Lazada API - Search for products based on keywords or category.

## API Overview

- Get a list of products based on category or keyword
- Total number of products
- Product details
- See More

## API URL

`GET https://api.tmapi.io/lazada/search/items`

## Request Parameters

### Query

| Field | Type | Explanation | Required |
| --- | --- | --- | --- |
| site | string | Region name abbreviation, for example, Thailand is 'th'.<br/>Optional values: `my`, `th`, `ph`, `id`, `vn`, `sg` | true |
| keywords | string | Search keywords | false |
| cat_url | string | This parameter can be used to retrieve category products. It is mutually exclusive with the `keywords` parameter; you can use either one but not both. | false |
| sort | string | Optional values: `pop`, `sales`, `price_up`, `price_down`<br/>Default value: pop | false |
| page | integer | Page number<br/>Default value: 1 | false |
| start_key | string | If you need to perform continuous paging, it's better to start specifying this parameter from the second page. This value can be obtained from the `start_key` field in the response data. | false |
| price_start | string | Filter: Minimum value of price range | false |
| price_end | string | Filter: Maximum value of price range | false |

## Security Auth

> Please go to [Console-Account Center](https://console.tmapi.io/account/center) to get your apiToken.

> Add your apiToken to the request parameters. Please refer to the examples below.

## Request Example

```bash

curl --request GET 'https://api.tmapi.io/lazada/search/items?apiToken=xxxxxx&site=&keywords=iphone&cat_url=https%3A%2F%2Fwww.lazada.sg%2Fshop-mobiles-tablets-accessories%2F&sort=pop&page=1'

```

## Response Example

```json

{
  "code": 200,
  "msg": "success",
  "data": {
    "page": 1,
    "page_size": 3,
    "start_key": "1726385507727",
    "total_count": 2993,
    "keyword": "Rausch",
    "cat_url": "",
    "sort": "pop",
    "price_start": "",
    "price_end": "",
    "items": [
      {
        "item_id": "4864957710",
        "product_url": "https://www.lazada.co.th/products/-i4864957710.html",
        "title": "Spot German Rausch Ruth herbal living hair conditioning water healthy strong 200ml scalp essence",
        "img": "https://th-live.slatic.net/p/45d91df5478650cb6067c75f1750c66b.jpg",
        "category_path": [
          3838,
          4082,
          4081,
          4174,
          9017
        ],
        "brand": "No Brand",
        "brand_id": "56645",
        "currency": "THB",
        "price": "1423",
        "price_info": {
          "sale_price": "1423",
          "origin_price": "1637"
        },
        "discount": null,
        "review_info": {
          "average_score": "4.0",
          "review_count": "1"
        },
        "comment_count": "1",
        "shop_info": {
          "shop_id": null,
          "shop_name": "saixuan416541",
          "shop_url": "https://www.lazada.co.th/shop/saixuan416541/",
          "seller_id": "1000241064",
          "seller_name": "saixuan416541"
        },
        "sold_count": null,
        "delivery_info": {
          "area_from": "China"
        },
        "is_in_stock": true,
        "is_ad": false
      },
      {
        "item_id": "5263429777",
        "product_url": "https://www.lazada.co.th/products/-i5263429777.html",
        "title": "TRW BRAKE CLEANER (1กระป๋อง) น้ำยาทำความสะอาดระบบเบรค ทีอาร์ดับเบิลยู รหัส PFC105",
        "img": "https://th-live-01.slatic.net/p/d706475045c9c480660b7d6aa13eaa0b.jpg",
        "category_path": [
          8428,
          8429,
          8471,
          12567
        ],
        "brand": "TRW",
        "brand_id": "127946",
        "currency": "THB",
        "price": "99",
        "price_info": {
          "sale_price": "99",
          "origin_price": "150"
        },
        "discount": null,
        "review_info": {
          "average_score": "5.0",
          "review_count": "11"
        },
        "comment_count": "11",
        "shop_info": {
          "shop_id": null,
          "shop_name": "IS AUTO PARTS STORE",
          "shop_url": "https://www.lazada.co.th/shop/is-auto-parts-store/",
          "seller_id": "100228323234",
          "seller_name": "IS AUTO PARTS STORE"
        },
        "sold_count": "99",
        "delivery_info": {
          "area_from": "กรุงเทพมหานคร"
        },
        "is_in_stock": true,
        "is_ad": false
      },
      {
        "item_id": "5263404837",
        "product_url": "https://www.lazada.co.th/products/-i5263404837.html",
        "title": "TRW BRAKE CLEANER (1กระป๋อง) น้ำยาทำความสะอาดระบบเบรค ทีอาร์ดับเบิลยู รหัส PFC105",
        "img": "https://th-live-01.slatic.net/p/efd1c46208251a95dee1cb2a9b4f2b76.jpg",
        "category_path": [
          8428,
          8429,
          8471,
          12567
        ],
        "brand": "TRW",
        "brand_id": "127946",
        "currency": "THB",
        "price": "99",
        "price_info": {
          "sale_price": "99",
          "origin_price": "156"
        },
        "discount": null,
        "review_info": {
          "average_score": "4.945945945945946",
          "review_count": "37"
        },
        "comment_count": "37",
        "shop_info": {
          "shop_id": null,
          "shop_name": "MS AUTO PARTS STORE",
          "shop_url": "https://www.lazada.co.th/shop/ms-auto-parts-store/",
          "seller_id": "100228362051",
          "seller_name": "MS AUTO PARTS STORE"
        },
        "sold_count": "156",
        "delivery_info": {
          "area_from": "กรุงเทพมหานคร"
        },
        "is_in_stock": true,
        "is_ad": false
      }
    ]
  }
}

```