# Marjane Mall All Products Scraper (`badr_xba/marjane-mall-all-products-scraper`) Actor

Collecte tous les produits de Marjane Mall (marjanemall.ma) via les sitemaps officiels : prix, promotions, stock, marque, vendeur, catégories, caractéristiques et images, en respectant robots.txt.

- **URL**: https://apify.com/badr\_xba/marjane-mall-all-products-scraper.md
- **Developed by:** [Badr Bouargan](https://apify.com/badr_xba) (community)
- **Categories:** E-commerce
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.01 / 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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Marjane Mall Scraper – All Products & Prices

Extract **the entire catalog of [Marjane Mall](https://www.marjanemall.ma)**, Morocco's hypermarket marketplace — prices, promotions, stock, brands, sellers, categories, specifications, barcodes (GTIN) and images — and **track price changes between runs** with optional e-mail alerts.

### ✨ What you get

- **Complete catalog**: reads Marjane Mall's official product sitemaps (~380,000 product pages).
- **Rich product data**: price, regular price, discount %, stock status and quantity, brand, seller (Marjane or marketplace partner), full category path, attributes (brand, country of origin, product type…), short and full description, GTIN/EAN barcode, delivery estimate, images, creation and update dates.
- **Filters**: price range, minimum discount, in stock only, category keywords, name keywords, excluded words.
- **Price tracking**: previous price, change in value and %, new products, stock changes — remembered across runs.
- **E-mail alerts**: price drops and back-in-stock products sent to your Apify account e-mail.
- **Respectful crawling**: follows robots.txt (identified bot, only sitemaps and product pages, never `/api/`, cart or account pages), limited speed.

### 🚀 How to use

1. Set **Max products** (`0` = whole catalog). Start with `1000`.
2. Optionally add **filters** (e.g. *In stock only*, *Category contains: électroménager*).
3. Keep the default **Proxy** (residential, Morocco — see below).
4. Click **Start**, then export as Excel, CSV or JSON.

**Daily price monitoring**: enable *Only changed products* + *E-mail alerts* and create a **Schedule**. Keep the same *Max products* value on every run.

### 📦 Output example

```json
{
    "sku": "AAAAA32198",
    "gtin": "6111234567890",
    "name": "Tapis receveur de douche anti-dérapant blanc",
    "url": "https://www.marjanemall.ma/p/tapis-receveur-de-douche-anti-derapant-blanc-aaaaa32198",
    "price": 87,
    "regularPrice": 113,
    "discountPercent": 23,
    "currency": "MAD",
    "inStock": true,
    "brand": "BricoSmart",
    "seller": { "id": 700794, "name": "BricoSmart" },
    "categories": ["Bébé & Jouets", "Hygiène - Toilette bébé", "Baignoire et siège de bain"],
    "attributes": { "Type de produit": "Tapis de douche" },
    "deliveryInformation": "Livraison entre le vendredi 18 et le samedi 19 septembre",
    "isNewProduct": false,
    "previousPrice": 99,
    "priceChangePercent": -12.1
}
```

### 💰 Cost

Marjane Mall is only reachable from some countries (including Morocco) and blocks Apify's datacenter servers, so the Actor uses **Apify residential proxies in Morocco** by default. This is the main cost:

| Volume | Approx. cost |
|---|---|
| 1,000 products | ~$0.25 |
| 20,000 products | ~$5 |
| Whole catalog (~380,000) | ~$90, about 2 days |

Run it locally from Morocco without a proxy for free.

### ❓ FAQ

**Why are some products out of stock?** The sitemaps list all product pages, including unavailable ones. Enable *In stock only* to keep available products (out-of-stock pages are still visited).

**Who receives the e-mail alerts?** The e-mail address of the Apify account running the Actor.

***

### 🇫🇷 En français

Collecte **tout le catalogue Marjane Mall** (~380 000 fiches) : prix promo et prix normal, remise, stock, marque, vendeur, catégories, caractéristiques, code-barres, descriptions, délai de livraison et images. **Filtres**, **suivi des prix entre les runs** et **alertes e-mail**. Proxy résidentiel marocain par défaut (le site refuse les serveurs Apify) : environ 0,25 $ pour 1 000 produits.

# Actor input Schema

## `maxItems` (type: `integer`):

Nombre de fiches produit à visiter. Mettez 0 pour tout le catalogue (~380 000 fiches, environ 2 jours à 120 requêtes/minute). Commencez petit pour tester.

## `minPrice` (type: `integer`):

Ne garder que les produits à ce prix ou plus (dans la devise du site).

## `maxPrice` (type: `integer`):

Ne garder que les produits à ce prix ou moins.

## `minDiscountPercent` (type: `integer`):

Ne garder que les produits en promotion d'au moins ce pourcentage (ex. 30).

## `onlyInStock` (type: `boolean`):

Exclure les produits en rupture de stock.

## `categoryKeywords` (type: `array`):

Garder les produits dont une catégorie contient un de ces mots (ex. téléphone, électroménager). Accents et majuscules ignorés.

## `nameKeywords` (type: `array`):

Garder les produits dont le nom contient un de ces mots (ex. samsung, iphone).

## `excludeKeywords` (type: `array`):

Exclure les produits dont le nom contient un de ces mots (ex. coque, reconditionné).

## `trackPriceChanges` (type: `boolean`):

Mémorise le prix et le stock de chaque produit pour les comparer au run suivant : ancien prix, variation, nouveaux produits, changement de stock.

## `onlyChangedProducts` (type: `boolean`):

N'enregistrer que les nouveaux produits et ceux dont le prix ou le stock a changé depuis le dernier run. Idéal avec un run programmé chaque jour.

## `sendEmailAlerts` (type: `boolean`):

À la fin du run, envoie un récapitulatif des baisses de prix et retours en stock à l'adresse e-mail de votre compte Apify (seule adresse autorisée par Apify). Nécessite le suivi des prix.

## `alertMinPriceDropPercent` (type: `integer`):

Signaler les produits dont le prix a baissé d'au moins ce pourcentage depuis le dernier run.

## `alertBackInStock` (type: `boolean`):

Signaler les produits qui étaient en rupture et sont de nouveau disponibles.

## `alertNewProducts` (type: `boolean`):

Signaler aussi les produits jamais vus. Attention : au premier run, tous les produits sont nouveaux.

## `botContact` (type: `string`):

E-mail ou URL permettant à Marjane Mall de vous contacter (recommandé). Il est ajouté au User-Agent du robot. Si vous laissez vide, l'adresse de l'Actor sur Apify est utilisée.

## `maxRequestsPerMinute` (type: `integer`):

Vitesse maximale (1 requête ≈ 1 produit). Restez raisonnable pour ne pas surcharger le site ; plafonnée à 200.

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

Marjane Mall n'est accessible que depuis certains pays (dont le Maroc) et refuse les serveurs Apify : gardez le proxy RESIDENTIAL avec le pays Maroc. En local depuis le Maroc, vous pouvez le désactiver.

## Actor input object example

```json
{
  "maxItems": 300,
  "onlyInStock": false,
  "trackPriceChanges": true,
  "onlyChangedProducts": false,
  "sendEmailAlerts": false,
  "alertMinPriceDropPercent": 10,
  "alertBackInStock": true,
  "alertNewProducts": false,
  "maxRequestsPerMinute": 120,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "MA"
  }
}
```

# Actor output Schema

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

Tableau des produits avec image, prix, remise, stock, marque, vendeur et lien.

## `allFields` (type: `string`):

Données complètes de chaque produit, y compris description, caractéristiques et images.

# 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 = {
    "maxItems": 300,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "MA"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("badr_xba/marjane-mall-all-products-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 = {
    "maxItems": 300,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "MA",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("badr_xba/marjane-mall-all-products-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "maxItems": 300,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "MA"
  }
}' |
apify call badr_xba/marjane-mall-all-products-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,badr_xba/marjane-mall-all-products-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/OuacAGn6PtcYat6cb/builds/la7SsMG9t91D1n9s5/openapi.json
