# Morocco Mubawab Real Estate Monitor (`mohamedbr/my-actor-1`) Actor

Watches Mubawab and reports only NEW Morocco property listings: price, area, rooms, city and district — never the same listing twice. For agencies, investors and real-estate market watchers. Part of Mohamed Bourim's 12 MENA monitors on Apify.

- **URL**: https://apify.com/mohamedbr/my-actor-1.md
- **Developed by:** [Mohamed Bourim](https://apify.com/mohamedbr) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 property listings

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

## Morocco Mubawab Real Estate Monitor

**Every fresh property listing from Mubawab — Morocco's leading real-estate portal — as clean structured data.** Sellers, agencies and developers across Morocco post their properties on Mubawab (111,000+ listings portal-wide; 16,229 apartments for sale alone at first capture), and this Actor collects them: price and currency, city, district, surface, rooms, bedrooms, bathrooms and the feature list from every card, then enriches each record from its own detail page with the advertiser's name, the publication date and the full description.

Every record is keyed by the portal's own listing ID, and each detail page is verified against the list identity before merging — a mismatched page is never merged. Listings the portal prints without a price stay honest: `price` is `null` and `priceText` keeps the portal's own words («Prix à consulter»).

### What you get

One record per published listing (newest first):

| Field | Description |
|---|---|
| `listingId` | The portal's own numeric listing ID — the record identity, e.g. `8454711` |
| `title` | Listing title as published, e.g. `Appartement à vendre à Boulevard Med 6...` |
| `price` | Price as a number, in `priceCurrency`, e.g. `3500000` (`null` when the portal publishes none) |
| `priceCurrency` | ISO currency of `price`: `MAD` for most listings, `EUR`/`USD` when the portal prices in them (`null` when no price is published or the currency is not recognised) |
| `priceText` | The price as printed, e.g. `3 500 000 DH` or `Prix à consulter` |
| `transaction` | `sale`, `rent` or `holiday-rental`, from the category |
| `category` | The category slug the run collected, e.g. `appartements-a-vendre` |
| `city` | City as published, e.g. `Marrakech` |
| `district` | District / quarter as published, e.g. `Boulevard Med 6` |
| `surfaceSqm` | Surface in m², e.g. `110` |
| `rooms` | Total rooms (pièces) when published |
| `bedrooms` | Bedrooms when published |
| `bathrooms` | Bathrooms when published |
| `features` | Feature list as published, e.g. `["Jardin", "Terrasse", "Piscine", ...]` |
| `descriptionText` | The full description from the detail page (the card excerpt when details are off) |
| `photoUrl` | First listing photo |
| `listingUrl` | The official detail page the record was read from |
| `advertiserName` | Advertiser as published, e.g. `Atlas immo prestige` |
| `advertiserType` | Advertiser type as published, e.g. `RealEstateAgent` |
| `publishedDate` | Publication date, ISO format |
| `source` | Always `mubawab` |
| `firstSeenAt` | Monitor mode only: when this listing was first emitted as new |

### Monitor mode

Set **onlyNew** and the Actor returns only listings that are new since your last run with the same category/city — the baseline is kept per stream in a persistent store, a failed run never marks listings as seen, and every successful run refreshes the baseline (even a plain sweep). The first monitor run for a stream only establishes the baseline and returns nothing, so a new schedule never floods you with the portal's backlog. Schedule it daily and you have a live feed of Moroccan property in your category or city.

### Inputs

| Input | Description |
|---|---|
| `category` | Category slug (default `appartements-a-vendre`). Verified: `appartements-a-vendre`, `appartements-a-louer`, `terrains-a-vendre`, `villas-et-maisons-de-luxe-a-vendre`, `locaux-a-vendre`, `maisons-a-vendre`, `riads-a-vendre`, `appartements-vacational`, `bureaux-et-commerces-a-vendre`, `maisons-a-louer` |
| `city` | Optional city slug (e.g. `casablanca`, `marrakech`, `tanger`) — empty means all of Morocco |
| `maxResults` | Maximum listings to return (newest first, default 100; the console pre-fills 10 so a first test run finishes fast — raise it for a full sweep) |
| `onlyNew` | Monitor mode: only listings new since your last run |
| `includeDetails` | Enrich from detail pages (default on; turn off for a fast list-only sweep) |

### Pricing

Pay per event: **$0.05 per run start + $0.02 per listing record** ($20 / 1,000 records). Platform usage is included.

# Actor input Schema

## `category` (type: `string`):

Listing category slug as printed in Mubawab list URLs. Verified: appartements-a-vendre (16,229), appartements-a-louer (15,963), terrains-a-vendre (7,232), villas-et-maisons-de-luxe-a-vendre (6,742), locaux-a-vendre (2,482), maisons-a-vendre (2,092), riads-a-vendre (1,214), appartements-vacational (845), bureaux-et-commerces-a-vendre (827), maisons-a-louer (269).

## `city` (type: `string`):

Optional city slug to scope the run (e.g. casablanca, marrakech, tanger, agadir, rabat). Empty = national (all of Morocco).

## `includeDetails` (type: `boolean`):

Fetch each listing's detail page for the advertiser, publication date and full description (identity verified against the list record before merging).

## `maxResults` (type: `integer`):

Maximum number of listings to return (newest first, 1-5000). Prefilled with 10 so a first run finishes fast; the default for API runs is 100.

## `onlyNew` (type: `boolean`):

Return only listings not seen in previous runs with the same category/city. The first monitor run for a stream only establishes the baseline and returns nothing.

## Actor input object example

```json
{
  "category": "appartements-a-vendre",
  "city": "",
  "includeDetails": true,
  "maxResults": 10,
  "onlyNew": false
}
```

# Actor output Schema

## `listings` (type: `string`):

Structured real-estate listing records (price, city, district, surface, rooms, features, advertiser, 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 = {
    "category": "appartements-a-vendre",
    "city": "",
    "includeDetails": true,
    "maxResults": 10,
    "onlyNew": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("mohamedbr/my-actor-1").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 = {
    "category": "appartements-a-vendre",
    "city": "",
    "includeDetails": True,
    "maxResults": 10,
    "onlyNew": False,
}

# Run the Actor and wait for it to finish
run = client.actor("mohamedbr/my-actor-1").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 '{
  "category": "appartements-a-vendre",
  "city": "",
  "includeDetails": true,
  "maxResults": 10,
  "onlyNew": false
}' |
apify call mohamedbr/my-actor-1 --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mohamedbr/my-actor-1"
        }
    }
}
```

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/PhEmcToPWyE7hUBju/builds/vCxqe5402rssXNOit/openapi.json
