# Daraz (Pakistan) — 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.

> Browse and extract product data from Daraz Pakistan (daraz.pk). Search products by keyword or category, retrieve full product details, explore the category tree, and list all products for a given seller.

**Category:** E-commerce | **Website:** [daraz.pk/](https://daraz.pk/) | **Docs:** [parse.bot/marketplace/92b641f0-875d-4881-855a-3ee7d8c250d2/daraz-pk-api](https://parse.bot/marketplace/92b641f0-875d-4881-855a-3ee7d8c250d2/daraz-pk-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-pk-api-92b641f0/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_categories

Retrieve the full category tree from Daraz including up to 3 levels of categories with IDs, names, URLs, and icons. No input parameters required. Returns hierarchical data suitable for building navigation menus or discovering category slugs for search_products.

**Estimated cost:** Metered

_No parameters required._

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

### get_product_details

Fetch comprehensive product details by item ID or product URL. Returns seller info, specifications, reviews, pricing, SKU options, Q&A, warranty, and breadcrumb navigation. The mtop API is used internally; each call is a single round-trip. Either item_id or product_url must be provided.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `item_id` | string | No | Product item ID (e.g. '913133095'). Either item_id or product_url is required. |
| `product_url` | string | No | Full product URL from Daraz (e.g. 'https://www.daraz.pk/products/hp-chromebook-i913133095.html'). Either item_id or product_url is required. |

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

### get_seller_products

Retrieve all products listed by a specific seller/shop. Returns paginated product listings. The seller_id is the shop slug found in the shop URL (e.g. for daraz.pk/shop/abc123/, the seller_id is 'abc123'). Shop slugs can be found in product details under seller info or in product listing URLs.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination. |
| `seller_id` | string | Yes | Shop slug from the seller's shop URL (e.g. 'rluo1j71'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-daraz-pk-api-92b641f0/get_seller_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","seller_id":"<string>"}'
```

### search_products

Full-text and category search over Daraz product listings. Returns paginated results with filter options (category, brand, service). At least one of query or category should be provided for meaningful results. Pagination via page number; each page returns up to ~40 items. Filters and sorting are server-side.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category` | string | No | Category slug to browse (e.g. 'womens-clothing', 'traditional-laptops'). |
| `page` | integer | No | Page number for pagination. |
| `price_high` | integer | No | Maximum price filter in PKR. |
| `price_low` | integer | No | Minimum price filter in PKR. |
| `query` | string | No | Search keyword (e.g. 'laptop', 'smartphone'). |
| `rating` | integer | No | Minimum rating filter (1-5). Server-side filtering may vary. |
| `sort` | string | No | Sort order for search results. |

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