# Daraz Search API Documentation

<p><strong>Daraz Search API</strong> searches products on Daraz in Pakistan, Bangladesh, Sri Lanka and Nepal. Each item has the sale price, original price and discount as numbers with the currency, rating, review count, seller, brand, image and variants.</p><p>Filter by price range, brand, rating, category, location, sort and attribute. An attribute uses <code>ppath=uniqueName:vId</code>; brand uses <code>brand</code>.</p><p>There are 40 results per page. Page N returns the real page N and pages past the end are empty. The <code>item_id</code> feeds the Product, Reviews and Enrichment APIs unchanged. When the upstream total repeats across queries, <code>pagination.total_results_capped</code> is true and <code>total_results</code> is an upper bound, not an exact count. Costs 1 credit per successful request. Empty results and failed requests are free.</p>

- **Documentation:** [https://scrappa.co/docs/daraz-api/daraz_search](https://scrappa.co/docs/daraz-api/daraz_search)
- **API group:** Daraz API
- **Endpoint:** `GET https://scrappa.co/api/daraz/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 | Yes | Search text, 1 to 120 characters. |
| `country` | string | No | Country code: pk, bd, lk or np (default pk). |
| `page` | integer | No | One-based page number, 1 to 100. |
| `sort` | string | No | One of popularity, priceasc, pricedesc. |
| `min_price` | number | No | Lowest sale price. |
| `max_price` | number | No | Highest sale price. |
| `brand` | string | No | Brand name from a search result. |
| `category` | string | No | Category id from a search result. |

## Example response

```json
{
    "data": {
        "query": "headphones",
        "country": "pk",
        "results": [
            {
                "name": "Headphones",
                "brand": "GearZilla",
                "image": "https://img.lazcdn.com/g/p/sample.jpg",
                "rating": 4.2857,
                "seller": {
                    "id": "12345",
                    "name": "GearZilla"
                },
                "item_id": "1958256534",
                "currency": "PKR",
                "discount": 20,
                "sale_price": 16200,
                "availability": "in_stock",
                "review_count": 14,
                "original_price": 20285
            }
        ],
        "currency": "PKR",
        "pagination": {
            "page": 1,
            "has_next": true,
            "per_page": 40,
            "total_results": 4080,
            "total_results_capped": true
        }
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter or a value is invalid. Not billable. |
| 503 | Upstream Unavailable | Daraz could not be reached. Not billable. |

## 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)
