# Namshi Product Scraper (`shahidirfan/namshi-product-scraper`) Actor

Extract detailed product data from Namshi, the Middle East's premier fashion & beauty retailer. Scrape prices, images, descriptions, and metadata instantly for competitor analysis and e-commerce monitoring. Reliable, scalable extraction. Residential proxies recommended for stability.

- **URL**: https://apify.com/shahidirfan/namshi-product-scraper.md
- **Developed by:** [Shahid Irfan](https://apify.com/shahidirfan) (community)
- **Categories:** E-commerce, Automation, Developer tools
- **Stats:** 23 total users, 4 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Namshi Product Scraper

Extract comprehensive Namshi product data for fast, reliable market research and pricing analysis using Namshi's internal catalog API. Collect listings, pricing, discounts, ratings, and stock signals at scale.

***

### Features

- **Listing extraction** — Gather product listings from Namshi collections and search pages.
- **Rich product details** — Capture parent SKU, SKU, brand, pricing, discount, ratings, and stock signals.
- **Pure API extraction** — Uses Namshi catalog JSON endpoints only (no DOM parsing, no detail-page visits).
- **Pagination support** — Automatically follows listing pages until the limit is reached.
- **Structured dataset output** — Receive clean, analysis-ready data in datasets.

***

### Use Cases

#### Pricing Intelligence

Track product pricing and discount patterns across Namshi collections to stay competitive and identify market shifts.

#### Catalog Monitoring

Keep tabs on product availability, new arrivals, and seasonal changes across targeted categories.

#### Brand Performance Analysis

Compare brand coverage, pricing position, and ratings to inform sourcing and merchandising decisions.

#### Research and Reporting

Build structured datasets for research, analytics dashboards, and reporting workflows.

***

### How it works

This scraper is API-first and production-oriented:

1. **Catalog endpoint discovery**: Uses Namshi's internal `/_svc/catalog/catalog/{encodedUri}?page=N` endpoint.
2. **JSON module parsing**: Extracts product objects from API modules and avoids HTML/DOM selectors entirely.
3. **Pagination via API metadata**: Traverses pages using API pagination data.
4. **Clean output logic**: Deduplicates products and omits null/empty fields.

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `startUrls` | Array | No | — | List of Namshi catalog URLs to scrape. |
| `results_wanted` | Integer | No | `20` | Target number of products to scrape. |
| `max_pages` | Integer | No | `10` | Limit the number of pages crawled per category. |
| `proxyConfiguration` | Object | No | — | Proxy settings for bypassing anti-bot measures. |

***

### Output Data

Each dataset item contains:

| Field | Type | Description |
|-------|------|-------------|
| `parentSku` | String | Parent SKU used for variant grouping. |
| `sku` | String | Variant SKU. |
| `title` | String | Product name. |
| `brand` | String | Brand name. |
| `normalPrice` | Number | Regular price. |
| `salePrice` | Number | Sale price (when available). |
| `discountPercent` | Number | Discount percentage. |
| `ratingAverage` | Number | Average rating. |
| `ratingCount` | Number | Number of ratings/reviews. |
| `stockLabel` | String | Stock status label from API. |
| `productUrl` | String | Product page URL. |
| `primaryImage` | String | First product image URL. |

***

### Usage Examples

#### Basic Collection Scrape

Extract products from a single collection page:

```json
{
  "startUrl": "https://www.namshi.com/uae-en/men/sports-collection/",
  "results_wanted": 20
}
```

#### Multi-Collection Run

Collect products from multiple collections in one run:

```json
{
  "startUrls": [
    { "url": "https://www.namshi.com/uae-en/men/sports-collection/" },
    { "url": "https://www.namshi.com/uae-en/men/shoes/" }
  ],
  "results_wanted": 50,
  "max_pages": 5
}
```

#### Search URL Input

Run directly on a search URL:

```json
{
  "startUrl": "https://www.namshi.com/uae-en/search?q=running",
  "results_wanted": 30,
  "max_pages": 6
}
```

***

### Sample Output

```json
{
  "parentSku": "Z3BF7E5DAD83175385FDAZ",
  "sku": "Z3BF7E5DAD83175385FDAZ-10",
  "title": "Barreda Decode Lux",
  "brand": "Adidas",
  "normalPrice": 429,
  "discountPercent": 0,
  "stockLabel": "Low Stock",
  "ratingAverage": 5,
  "ratingCount": 3,
  "productUrl": "https://www.namshi.com/buy-adidas-barreda-decode-lux/Z3BF7E5DAD83175385FDAZ/p/",
  "primaryImage": "https://f.nooncdn.com/pzsku/Z3BF7E5DAD83175385FDAZ/45/1762604634/8ae67ba8-fbc0-40a5-a980-682b0ea9a490.jpg"
}
```

***

### Tips for Best Results

#### Start with Known Collections

- Use popular Namshi collections to validate output quickly.
- Swap in new collection URLs once results look correct.

#### Control Result Volume

- Begin with `results_wanted` set to 20–50 for testing.
- Increase limits for production runs once outputs are validated.

#### Use Proxy Configuration

- Keep `proxyConfiguration` enabled for stable results.
- Use residential proxy groups for higher success rates when needed.

***

### Integrations

Connect your data with:

- **Google Sheets** — Export for pricing reports.
- **Airtable** — Build searchable product catalogs.
- **Make** — Automate workflows and alerts.
- **Zapier** — Trigger downstream actions.

#### Export Formats

- **JSON** — Developer-friendly data access.
- **CSV** — Spreadsheet analysis.
- **Excel** — Business reporting.
- **XML** — Custom integrations.

***

### Frequently Asked Questions

#### How many products can I collect?

You can collect all available products, limited by `results_wanted` and `max_pages`.

#### Can I scrape multiple collections at once?

Yes. Provide multiple URLs in `startUrls` to combine collections in one run.

#### What if some fields are missing?

Some listings may not expose full details; unavailable fields are omitted from the output item.

#### Does it work on search pages?

Yes. Use any Namshi search URL as the starting point.

#### How do I keep scraping stable?

Enable `proxyConfiguration` and limit result counts for the most reliable runs.

***

### Support

For issues or feature requests, contact support through the Apify Console.

#### Resources

- [Apify Documentation](https://docs.apify.com/)
- [API Reference](https://docs.apify.com/api/v2)
- [Scheduling Runs](https://docs.apify.com/schedules)

***

### Legal Notice

This scraper is designed for legitimate data collection purposes. You are responsible for complying with Namshi’s terms of service and applicable laws. Use the data responsibly and respect rate limits.

# Actor input Schema

## `startUrls` (type: `array`):

Multiple Namshi collection URLs to scrape.

## `results_wanted` (type: `integer`):

The maximum number of products to collect.

## `max_pages` (type: `integer`):

A safety cap on the number of listing pages to visit.

## `proxyConfiguration` (type: `object`):

Use Apify Proxy for reliable scraping.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.namshi.com/uae-en/men/sports-collection/"
    }
  ],
  "results_wanted": 20,
  "max_pages": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        {
            "url": "https://www.namshi.com/uae-en/men/sports-collection/"
        }
    ],
    "results_wanted": 20,
    "max_pages": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahidirfan/namshi-product-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startUrls": [{ "url": "https://www.namshi.com/uae-en/men/sports-collection/" }],
    "results_wanted": 20,
    "max_pages": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("shahidirfan/namshi-product-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.namshi.com/uae-en/men/sports-collection/"
    }
  ],
  "results_wanted": 20,
  "max_pages": 10
}' |
apify call shahidirfan/namshi-product-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=shahidirfan/namshi-product-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/HieMDlpYTQlXmnbbO/builds/1eEPNGNGmTTcv3o1d/openapi.json
