> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapengine.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Lazada Search

> Search Lazada products across Southeast Asian markets with pricing, ratings, and seller details

## Overview

The `/lazada/search` endpoint searches Lazada's e-commerce platform across Southeast Asian markets (Singapore, Malaysia, Thailand, Philippines, Indonesia, Vietnam). It returns structured product data including pricing, ratings, and seller information.

## Parameters

### Query Parameters

<ParamField query="q" type="string" required>
  The product search query
</ParamField>

<ParamField query="lazadaDomain" type="string" default="www.lazada.sg">
  Lazada domain to search:

  * `www.lazada.sg` (Singapore)
  * `www.lazada.com.my` (Malaysia)
  * `www.lazada.co.th` (Thailand)
  * `www.lazada.com.ph` (Philippines)
  * `www.lazada.co.id` (Indonesia)
  * `www.lazada.vn` (Vietnam)
</ParamField>

<ParamField query="page" type="number" default="1">
  Page number for pagination (starts at 1)
</ParamField>

<ParamField query="sortBy" type="string">
  Sort order for results:

  * `relevance` - Most relevant (default)
  * `priceasc` - Price: Low to High
  * `pricedesc` - Price: High to Low
  * `sales` - Best selling
  * `rating` - Highest rated
</ParamField>

<ParamField query="priceMin" type="number">
  Minimum price filter
</ParamField>

<ParamField query="priceMax" type="number">
  Maximum price filter
</ParamField>

<ParamField query="lazMall" type="boolean" default="false">
  Filter for LazMall (official store) products only
</ParamField>

<ParamField query="category" type="string">
  Category filter (e.g., `shop-building-toys`, `electronics`)
</ParamField>

<ParamField query="location" type="string">
  Location filter code (e.g., `R536780` for Singapore)
</ParamField>

<ParamField query="rating" type="number">
  Minimum rating filter (0-5)
</ParamField>

<ParamField query="country" type="string" default="sg">
  Country code for proxy location (e.g., `sg`, `my`, `th`, `ph`, `id`, `vn`)
</ParamField>

<ParamField query="rawJson" type="boolean" default="false">
  Return raw JSON response instead of parsed results
</ParamField>

<ParamField query="async" type="boolean" default="false">
  Async mode - returns job ID immediately for later retrieval
</ParamField>

## Example Requests

### Basic Product Search

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.scrapengine.io/api/v1/lazada/search?q=smartphone&page=1" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    q: "smartphone",
    page: "1",
  });

  const response = await fetch(
    `https://api.scrapengine.io/api/v1/lazada/search?${params}`,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
      },
    }
  );

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.scrapengine.io/api/v1/lazada/search"
  headers = {"Authorization": "Bearer YOUR_API_KEY"}
  params = {
      "q": "smartphone",
      "page": 1
  }

  response = requests.get(url, headers=headers, params=params)
  print(response.json())
  ```
</CodeGroup>

### Search with Filters

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.scrapengine.io/api/v1/lazada/search?q=headphones&priceMin=50&priceMax=200&lazMall=true&sortBy=rating" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    q: "headphones",
    priceMin: "50",
    priceMax: "200",
    lazMall: "true",
    sortBy: "rating",
  });

  const response = await fetch(
    `https://api.scrapengine.io/api/v1/lazada/search?${params}`,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
      },
    }
  );

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.scrapengine.io/api/v1/lazada/search"
  headers = {"Authorization": "Bearer YOUR_API_KEY"}
  params = {
      "q": "headphones",
      "priceMin": 50,
      "priceMax": 200,
      "lazMall": True,
      "sortBy": "rating"
  }

  response = requests.get(url, headers=headers, params=params)
  print(response.json())
  ```
</CodeGroup>

### Search on Different Lazada Market

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.scrapengine.io/api/v1/lazada/search?q=laptop&lazadaDomain=www.lazada.com.my&country=my" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    q: "laptop",
    lazadaDomain: "www.lazada.com.my",
    country: "my",
  });

  const response = await fetch(
    `https://api.scrapengine.io/api/v1/lazada/search?${params}`,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
      },
    }
  );

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.scrapengine.io/api/v1/lazada/search"
  headers = {"Authorization": "Bearer YOUR_API_KEY"}
  params = {
      "q": "laptop",
      "lazadaDomain": "www.lazada.com.my",
      "country": "my"
  }

  response = requests.get(url, headers=headers, params=params)
  print(response.json())
  ```
</CodeGroup>

## Response

### Success Response (200)

Returns parsed product search results:

```json theme={null}
{
  "searchInfo": {
    "query": "smartphone",
    "totalResults": 5420,
    "page": 1,
    "market": "Singapore"
  },
  "products": [
    {
      "position": 1,
      "itemId": "2145678901",
      "title": "Samsung Galaxy S24 Ultra 5G Smartphone",
      "link": "https://www.lazada.sg/products/samsung-galaxy-s24-ultra-i2145678901.html",
      "image": "https://sg-live.slatic.net/p/abc123.jpg",
      "price": {
        "current": 1698.0,
        "currency": "SGD",
        "original": 1898.0,
        "discountPercent": 11
      },
      "rating": {
        "value": 4.9,
        "count": 2341
      },
      "sold": 5230,
      "seller": {
        "name": "Samsung Official Store",
        "isLazMall": true,
        "rating": 4.8
      },
      "freeShipping": true,
      "location": "Singapore"
    },
    {
      "position": 2,
      "itemId": "2098765432",
      "title": "iPhone 15 Pro Max 256GB",
      "link": "https://www.lazada.sg/products/iphone-15-pro-max-i2098765432.html",
      "image": "https://sg-live.slatic.net/p/xyz789.jpg",
      "price": {
        "current": 1899.0,
        "currency": "SGD"
      },
      "rating": {
        "value": 4.8,
        "count": 1876
      },
      "sold": 3120,
      "seller": {
        "name": "Apple Flagship Store",
        "isLazMall": true,
        "rating": 4.9
      },
      "freeShipping": true,
      "location": "Singapore"
    }
  ],
  "pagination": {
    "currentPage": 1,
    "totalPages": 136,
    "nextPage": "https://api.scrapengine.io/api/v1/lazada/search?q=smartphone&page=2"
  }
}
```

### Response Headers

| Header                | Description                       |
| --------------------- | --------------------------------- |
| `x-remaining-credits` | Number of API credits remaining   |
| `x-trace-id`          | Unique identifier for the request |

### Error Responses

| Status | Description                               |
| ------ | ----------------------------------------- |
| `400`  | Bad Request - Invalid query parameters    |
| `401`  | Unauthorized - Invalid or missing API key |
| `500`  | Internal Server Error                     |

## Use Cases

* **Southeast Asian market research**: Analyze product trends across SEA markets
* **Price monitoring**: Track product prices across different Lazada markets
* **Competitor analysis**: Monitor competitor product listings and pricing
* **LazMall monitoring**: Track official store products and promotions
* **Cross-market comparison**: Compare prices across Singapore, Malaysia, Thailand, etc.
* **Seller research**: Analyze top sellers and their product offerings
