Mubawab.ma Housing Scraper
Pricing
from $1.00 / 1,000 results
Mubawab.ma Housing Scraper
Scrapes Moroccan real estate listings from mubawab.ma and outputs a structured dataset ready for ML model training (price prediction, classification).
Pricing
from $1.00 / 1,000 results
Rating
0.0
(0)
Developer
LIAICHI MUSTAPHA
Maintained by CommunityActor stats
1
Bookmarked
28
Total users
3
Monthly active users
5 hours ago
Last modified
Categories
Share
Extract real estate listings from mubawab.ma — Morocco's largest property portal — with prices, surfaces, locations, property types, and transaction details. Ready for market analysis, price prediction models, and investment research.
Features
- 15 data fields per listing — price (MAD), price per m², surface, rooms, bathrooms, floor, property type, standing, condition, city, neighborhood, transaction type, and more
- Full Morocco coverage — all major cities: Casablanca, Rabat, Marrakech, Fès, Tanger, Agadir, and more
- Both transaction types — vente (sale) and location (rental) listings
- Multiple property types — appartements, villas, maisons, riads, terrains, bureaux, commerces
- Playwright rendering — handles JavaScript-rendered pages reliably
- ML-ready output — flat JSON/CSV format, null-safe fields, derived price-per-m² column
Use Cases
- Price prediction models — build regression models on Moroccan property prices by city, type, and surface
- Market analysis — track average prices per m² by city, neighborhood, and property type
- Investment research — identify undervalued areas by comparing price-per-m² across regions
- Real estate dashboards — power BI or data studio dashboards with fresh listing data
- Geo-spatial analysis — map property density and pricing across Moroccan cities
Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
transactionType | String | No | vente | "both", "vente" (sale), or "location" (rental) |
cities | Array | No | all cities | List of cities to scrape (e.g. ["casablanca", "rabat"]) |
propertyTypes | Array | No | main types | Property types: appartements, villas, maisons, riads, terrains, bureaux, commerces |
maxListings | Integer | No | 5000 | Max listings to scrape — 0 for unlimited |
maxConcurrency | Integer | No | 5 | Parallel browser tabs (lower = more stable) |
startUrls | Array | No | auto | Override seed URLs (leave empty for auto-generation) |
proxyConfiguration | Object | No | Apify Proxy | Proxy settings |
Example — scrape Casablanca apartments for sale:
{"transactionType": "vente","cities": ["casablanca"],"propertyTypes": ["appartements"],"maxListings": 1000}
Output
Each dataset item is one property listing:
{"priceDh": 1250000,"pricePerM2": 12500,"surfaceM2": 100,"numRooms": 3,"numBathrooms": 2,"floor": 3,"propertyType": "appartement","standing": "moyen_standing","state": "bon_etat","city": "casablanca","neighborhood": "maârif","transactionType": "vente","url": "https://www.mubawab.ma/fr/a/12345/appartement-a-vendre-casablanca","title": "Appartement à vendre à Maârif, Casablanca","scrapedAt": "2025-03-27T14:32:00.000Z"}
Field reference:
| Field | Type | Description |
|---|---|---|
priceDh | number|null | Price in Moroccan Dirhams (MAD) |
pricePerM2 | number|null | Derived: price ÷ surface (MAD/m²) |
surfaceM2 | number|null | Living area in m² |
numRooms | integer|null | Bedrooms |
numBathrooms | integer|null | Bathrooms |
floor | integer|null | Floor number (0 = ground floor) |
propertyType | string|null | appartement, villa, maison, riad, etc. |
standing | string|null | economique, moyen_standing, haut_standing |
state | string|null | neuf, bon_etat, a_renover, en_cours_de_construction |
city | string|null | Lowercase ASCII city name |
neighborhood | string|null | Sub-area within the city |
transactionType | string|null | vente or location |
How to Use
Via Apify Console
- Open the actor on Apify Store
- Click Try for free
- Set your Transaction Type, Cities, and Property Types
- Set
maxListingsto10for a quick test run first - Click Start — typical runs complete in 10–60 minutes depending on scale
- Download results as JSON, CSV, or Excel
Via Apify API (Python)
from apify_client import ApifyClientclient = ApifyClient("YOUR_API_TOKEN")run = client.actor("scraper_guru/mubawab-housing-scraper").call(run_input={"transactionType": "vente","cities": ["casablanca", "rabat"],"propertyTypes": ["appartements", "villas"],"maxListings": 2000})for item in client.dataset(run["defaultDatasetId"]).iterate_items():print(item["city"], item["priceDh"], item["surfaceM2"])
Pricing
This actor is billed by compute units — you pay for runtime and memory only.
| Scale | Approximate Cost | Estimated Time |
|---|---|---|
| 10 listings (quick test) | < $0.01 | < 1 minute |
| 500 listings | $0.05–$0.20 | 5–15 minutes |
| 5,000 listings (default) | $0.50–$2.00 | 30–90 minutes |
| Full Morocco dataset (10,000+) | $2–$5 | 2–4 hours |
New to Apify? Every account includes $5 in free monthly credits.
FAQ
What cities are covered?
All major Moroccan cities: Casablanca, Rabat, Marrakech, Fès, Tanger, Agadir, Meknès, Oujda, Kénitra, Tétouan. Leave the cities field empty to scrape all cities.
Why are some fields null? Not all listings on mubawab.ma include every field (e.g. some listings omit the price or surface). Null values mean the data wasn't present on the listing page.
How fresh is the data? Data is pulled in real-time when you run the actor. Each run reflects the current state of mubawab.ma listings.
Can I get rental prices too?
Yes — set transactionType to "location" or "both" to include rental listings alongside sale listings.
How do I build a price prediction model with this data?
Export as CSV, load into pandas, filter out rows where priceDh or surfaceM2 is null, then train a regression model on surfaceM2, numRooms, city, propertyType, and standing as features.
Built by Mustapha Liaichi — Automation & Web Scraping Specialist