# Mubawab Housing Properties and Details Scraper (`realestateapi/mubawab-housing-properties-and-details-scraper`) Actor

Permission-gated Mubawab Morocco property detail scraper. It saves only verified source-backed property rows; run failures and policy skips stay in OUTPUT_SUMMARY with explicit SUCCEEDED/FAILED and completion statuses.

- **URL**: https://apify.com/realestateapi/mubawab-housing-properties-and-details-scraper.md
- **Developed by:** [Real Estate API](https://apify.com/realestateapi) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Mubawab Housing Properties and Details Scraper

Mubawab's Conditions of Use restrict automated extraction and reuse absent express prior written authorization. The workspace operator attested on 2026-11-16 that written permission covers this Actor (see the root `WRITTEN_PERMISSION_ATTESTATION.md`; no reference ID was supplied). On that basis the production entry point collects directly and no longer makes source requests conditional on the `authorizationConfirmed` input, which is retained only for compatibility. The legacy `SKIPPED_POLICY` path remains in `src/policy.js` for offline tests but is not used by the production entry. Source terms are not a permission grant by this repository.

When permitted, provide official Mubawab Morocco search or property detail URLs using `sourceUrl`, `sourceUrls`, or `startUrls`. `maxPages` bounds page requests and `maxItems` bounds source-backed property rows. The Actor reads server-rendered pages and public RealEstateListing JSON-LD for listing identity, title, price and currency, transaction and property types, location, area, rooms, features, contact-redacted descriptions, and public image URLs when present. It does not reveal phone controls, submit forms, use accounts, call private APIs, download images, or use proxies or alternate routes. Compatibility-only `userAgent` and `proxyConfiguration` inputs do not change its fixed direct-request behavior.

### Output

Only validated, source-backed property rows are dataset items. Failures and access diagnostics are kept in `OUTPUT_SUMMARY`, never written as dataset rows. The example below is synthetic and not live Mubawab data; it assumes a successful property response. A clean empty result reports `SUCCEEDED` / `COMPLETED`, a failure after saved rows reports `SUCCEEDED` / `PARTIAL`, and a failure before any saved row reports `FAILED` / `FAILED` (nonzero exit).

```json
{
  "recordType": "mubawab-property-detail",
  "recordId": "mubawab-property:9999999",
  "inventoryRank": 805,
  "actorName": "Mubawab Housing Properties and Details Scraper",
  "actorSlug": "scraper_guru/mubawab-housing-scraper",
  "actorStoreUrl": "https://apify.com/scraper_guru/mubawab-housing-scraper",
  "sourceUrl": "https://www.mubawab.ma/fr/a/9999999/fictional-apartment",
  "sourceWebsite": "https://www.mubawab.ma",
  "officialSource": "https://www.mubawab.ma/fr/a/9999999/fictional-apartment",
  "httpStatus": 200,
  "accessStatus": "success",
  "contentType": "text/html; charset=utf-8",
  "contentLength": 18000,
  "responseHeaders": {
    "content-type": "text/html; charset=utf-8"
  },
  "fetchedAt": "2026-10-05T12:00:00.000Z",
  "durationMs": 400,
  "sourceBacked": true,
  "dataAvailable": true,
  "listingId": "9999999",
  "title": "Fictional Two-Bedroom Apartment",
  "detailUrl": "https://www.mubawab.ma/fr/a/9999999/fictional-apartment",
  "price": 1250000,
  "priceText": "1 250 000 MAD",
  "priceCurrency": "MAD",
  "transactionType": "sale",
  "propertyType": "apartment",
  "city": "Example City",
  "country": "Morocco",
  "sourcePageType": "detail",
  "fieldCoverage": [
    "recordType", "recordId", "inventoryRank", "actorName", "actorSlug", "actorStoreUrl",
    "sourceUrl", "sourceWebsite", "officialSource", "httpStatus", "accessStatus", "contentType",
    "contentLength", "responseHeaders", "fetchedAt", "durationMs", "sourceBacked", "dataAvailable",
    "listingId", "title", "detailUrl", "price", "priceText", "priceCurrency", "transactionType",
    "propertyType", "city", "country", "sourcePageType"
  ],
  "dataQuality": {
    "recordStatus": "source_backed",
    "sourceBacked": true,
    "noNullOrBlankFields": true,
    "fieldCount": 29
  }
}
```

A clean bounded or empty run is `SUCCEEDED` / `COMPLETED`. If a failure happens before any property row is saved, the run is `FAILED` / `FAILED`; after at least one saved property row, it is `SUCCEEDED` / `PARTIAL`.

# Actor input Schema

## `sourceUrl` (type: `string`):

One official Mubawab listing page or property detail URL.

## `sourceUrls` (type: `array`):

Optional additional official Mubawab listing or property detail URLs.

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

Optional request-list form of official Mubawab listing or detail URLs.

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

Maximum source-backed property records to emit.

## `maxPages` (type: `integer`):

Maximum direct official Mubawab pages to request.

## `timeoutMs` (type: `integer`):

Maximum time allowed for each direct public request.

## `userAgent` (type: `string`):

Retained for compatibility and ignored; the actor uses one fixed transparent user-agent.

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

Retained for compatibility and ignored; this actor uses direct fetch only.

## `authorizationConfirmed` (type: `boolean`):

Retained for compatibility only. No longer gates source requests: the operator attested written permission on 2026-11-16 and the production entry collects directly.

## Actor input object example

```json
{
  "sourceUrl": "https://www.mubawab.ma/fr/sc/appartements-a-vendre",
  "startUrls": [],
  "maxItems": 25,
  "maxPages": 5,
  "timeoutMs": 30000,
  "authorizationConfirmed": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (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 = {
    "authorizationConfirmed": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("realestateapi/mubawab-housing-properties-and-details-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 = { "authorizationConfirmed": False }

# Run the Actor and wait for it to finish
run = client.actor("realestateapi/mubawab-housing-properties-and-details-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 '{
  "authorizationConfirmed": false
}' |
apify call realestateapi/mubawab-housing-properties-and-details-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,realestateapi/mubawab-housing-properties-and-details-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/CaKCD7PYxYIgcTLlS/builds/CvfpXyERgpzTx8Idt/openapi.json
