# Daraz (Bangladesh) — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search and browse products on Daraz Bangladesh to find items across any category. Retrieve detailed product information, explore category listings, and surface top-selling items — all from a single API.

**Category:** E-commerce | **Website:** [daraz.com.bd/](https://daraz.com.bd/) | **Docs:** [parse.bot/marketplace/ad8b04de-87f4-480a-9c18-188d2b1c6a51/daraz-com-bd-api](https://parse.bot/marketplace/ad8b04de-87f4-480a-9c18-188d2b1c6a51/daraz-com-bd-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-daraz-com-bd-api-ad8b04de/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### browse_category

Lists products within a specific category by slug. Returns a paginated list of product summaries. Category slugs come from get_category_list. Known working slugs include womens-fashion and toys-games; some slugs may return an upstream error if the category page lacks JSON API support.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_slug` | string | Yes | Category slug from get_category_list (e.g. 'womens-fashion', 'toys-games'). |
| `page` | integer | No | Page number for pagination. |
| `sort` | string | No | Sort order for results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-daraz-com-bd-api-ad8b04de/browse_category \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category_slug":"<string>","page":"<integer>","sort":"<string>"}'
```

### get_best_selling_product

Returns the best-selling products for a search query, pre-sorted by number of orders. Equivalent to search_products with sort fixed to 'orders'. Use this to identify top sellers in any product category by keyword.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword (e.g. 'phone', 'laptop', 'shoes'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-daraz-com-bd-api-ad8b04de/get_best_selling_product \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```

### get_category_list

Retrieves the top-level product categories from Daraz Bangladesh. Returns category names and slugs. Slugs can be passed to browse_category to list products within that category.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-daraz-com-bd-api-ad8b04de/get_category_list \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_product_details

Extracts full product information from a Daraz product page. Parses structured data (JSON-LD, tracking data, module data) from the HTML to return title, price, brand, category path, stock status, images, highlights, seller name, and description. Requires the full product page URL.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_url` | string | Yes | Full URL of a Daraz product page (e.g. 'https://www.daraz.com.bd/products/...-i523543469.html'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-daraz-com-bd-api-ad8b04de/get_product_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_url":"<string>"}'
```

### search_products

Full-text search over Daraz Bangladesh product listings. Returns a paginated list of product summaries matching the keyword query. Supports sorting by popularity, number of orders, or price. Each result includes pricing, seller info, and a product URL suitable for get_product_details.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination. |
| `query` | string | Yes | Search keyword (e.g. 'laptop', 'phone', 'shoes'). |
| `sort` | string | No | Sort order for results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-daraz-com-bd-api-ad8b04de/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","query":"<string>","sort":"<string>"}'
```
