# Lazada Search API Documentation

<p><strong>Lazada Search API</strong> searches products on Lazada in Singapore, Malaysia, Indonesia, Thailand, the Philippines and Vietnam. Each item has the price, original price and discount as numbers with the currency, rating, review count, sold count, seller, shop id, brand, categories, images and badges for LazMall, free shipping and flash sale.</p><p>Filter by price range, minimum rating, sort order, items shipped from the local country and LazMall only. Every item in the answer follows the filters you send. Send a <code>category</code> slug from <code>data.filters.categories</code> to list a category, with or without a search text.</p><p>There are 40 results per page and at most 102 pages. <code>total_results</code> is capped by Lazada, <code>total_results_capped</code> says so. Page N returns the real page N. <code>sold_count</code> is null when Lazada shows none. The <code>item_id</code> and <code>shop_id</code> feed the Product, Reviews, Shop and Shop Products APIs unchanged.</p><p>Costs 2 credits per successful request. Empty results and failed requests are free.</p>

- **Documentation:** [https://scrappa.co/docs/lazada-api/lazada_search](https://scrappa.co/docs/lazada-api/lazada_search)
- **API group:** Lazada API
- **Endpoint:** `GET https://scrappa.co/api/lazada/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | No | Search text, 1 to 120 characters, for example headphones. Required unless you send a category. |
| `country` | string | No | Country code: sg, my, id, th, ph or vn (default sg). One country per request. |
| `page` | integer | No | One-based page number, 1 to 102 (default 1). 40 results per page. |
| `category` | string | No | Category slug from data.filters.categories of an earlier search, for example shop-on-ear-headphones. |
| `sort` | string | No | One of relevance, price_asc, price_desc, popularity. |
| `min_price` | number | No | Lowest price in the local currency. |
| `max_price` | number | No | Highest price in the local currency. |
| `min_rating` | integer | No | Lowest item rating as a whole star value, 1 to 5. Items without a rating are left out. |
| `local_only` | boolean | No | Set 1 to list only items shipped from the country of the site. |
| `lazmall_only` | boolean | No | Set 1 to list only LazMall items. |

## Example response

```json
{
    "data": {
        "query": "headphones",
        "country": "sg",
        "filters": {
            "sorts": [
                "relevance",
                "price_asc",
                "price_desc",
                "popularity"
            ],
            "categories": [
                {
                    "slug": "shop-over-ear-headphones",
                    "title": "Over-Ear Headphones"
                },
                {
                    "slug": "shop-on-ear-headphones",
                    "title": "On-Ear Headphones"
                },
                {
                    "slug": "shop-in-ear-headphones",
                    "title": "In-Ear Headphones"
                }
            ]
        },
        "results": [
            {
                "url": "https://www.lazada.sg/products/pdp-i13786136851.html",
                "brand": {
                    "id": "28314",
                    "name": "Marshall"
                },
                "image": "https://sg-live-01.slatic.net/p/1e3ea8a5ea124a38d2b1dc82c24a0ba9.jpg",
                "price": 304,
                "title": "[NEW] Marshall Milton A.N.C On-Ear Headphones",
                "badges": {
                    "lazmall": true,
                    "flash_sale": false,
                    "free_shipping": true
                },
                "images": [
                    "https://sg-live-01.slatic.net/p/1e3ea8a5ea124a38d2b1dc82c24a0ba9.jpg",
                    "https://sg-live-01.slatic.net/p/b6a649167f24052ef30945305b227f5b.png",
                    "https://sg-live-01.slatic.net/p/20e93ca8557e8e45f0af4b9cc4272749.png"
                ],
                "rating": 5,
                "seller": {
                    "id": "1133229569",
                    "name": "Marshall"
                },
                "sku_id": "124766487777",
                "item_id": "13786136851",
                "shop_id": "402099",
                "currency": "SGD",
                "in_stock": true,
                "location": "Singapore",
                "categories": [
                    "10100387",
                    "154",
                    "157"
                ],
                "sold_count": 27,
                "is_sponsored": false,
                "review_count": 5,
                "original_price": 329,
                "discount_percent": 7.6
            }
        ],
        "category": null,
        "currency": "SGD",
        "pagination": {
            "page": 1,
            "has_next": true,
            "per_page": 40,
            "total_results": 4080,
            "total_results_capped": true
        }
    },
    "meta": {
        "credits": 2,
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter or a value is invalid. This response is not billable. |
| 503 | Upstream Unavailable | Lazada could not be reached after several tries. This response is not billable. Retry shortly. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
