# Daraz (Bangladesh) — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/daraz-bangladesh/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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.beta.paywithlocus.com/api/wrapped/credits/daraz-bangladesh/browse-category \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/daraz-bangladesh/get-best-selling-product \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/daraz-bangladesh/get-category-list \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/daraz-bangladesh/get-product-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/daraz-bangladesh/search-products \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","query":"<string>","sort":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.