# Digikala — 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 Digikala's special-offers section, search products by keyword with category and brand filtering, and retrieve full product details including pricing, variants, seller info, images, and specifications.

**Category:** E-commerce | **Website:** [digikala.com/](https://digikala.com/) | **Docs:** [parse.bot/marketplace/9ea6c7b4-859d-4ac0-b0ee-6a837bdccd78/digikala-com-api](https://parse.bot/marketplace/9ea6c7b4-859d-4ac0-b0ee-6a837bdccd78/digikala-com-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-digikala-com-api-9ea6c7b4/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_incredible_offers

Retrieves products from Digikala's incredible-offers (شگفت‌انگیز) section. On page 1, includes both running-out deals and daily discounted products plus paginated offers. Subsequent pages return only paginated offers. Each product includes pricing with discount percentage and sold-out percentage.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `max_pages` | integer | No | Maximum number of pages to fetch starting from the page parameter. |
| `page` | integer | No | Page number for paginated results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-digikala-com-api-9ea6c7b4/get_incredible_offers \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"max_pages":"<integer>","page":"<integer>"}'
```

### get_product_detail

Retrieves complete product page data by product ID. Includes title, images, videos, specifications, variants with per-seller pricing, brand, category, breadcrumb, colors, description, SEO metadata, and DigiPlus service info. A single product may have multiple variants differing by color and seller.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Digikala product ID (numeric). Found in product URLs as dkp-{id}. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-digikala-com-api-9ea6c7b4/get_product_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"<string>"}'
```

### search_products

Full-text search over Digikala's product catalog. Supports pagination, sorting, category scoping, and brand filtering. Returns up to ~20 products per page. When category is provided without a query, returns all products in that category.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `brand_id` | string | No | Brand ID to filter by (e.g. '10' for Apple, '2' for Samsung). |
| `category` | string | No | Category slug to scope results (e.g. 'mobile-phone', 'laptop'). When provided, searches only within that category. |
| `page` | integer | No | Page number. |
| `query` | string | Yes | Search keyword (e.g. 'laptop', 'iphone 16', 'headphone'). May be empty string if category is provided. |
| `sort` | string | No | Sort option code. |

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