{
  "openapi": "3.0.1",
  "info": {
    "title": "Mubawab Scraper – Morocco & Tunisia Property Data",
    "description": "Scrape mubawab.ma and mubawab.tn property listings: asking price and rent in MAD or TND, surface, rooms, neighbourhood, GPS coordinates, agency and full advert text. Mubawab data in JSON or CSV.",
    "version": "1.0",
    "x-build-id": "QZg7yCzSihewUha0M"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~mubawab-property-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-mubawab-property-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/sian.agency~mubawab-property-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-mubawab-property-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/sian.agency~mubawab-property-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-mubawab-property-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "operation": {
            "title": "🎯 What to collect",
            "enum": [
              "search",
              "detail"
            ],
            "type": "string",
            "description": "One per run. Listing Search walks Mubawab's result pages and returns a full record per listing card. Listing Detail opens the listings you list under Listing URLs and adds GPS coordinates, the numeric price, the agency and the complete advert text.",
            "default": "search"
          },
          "market": {
            "title": "🌍 Market",
            "enum": [
              "ma",
              "tn"
            ],
            "type": "string",
            "description": "Which Mubawab market to search. Morocco prices in MAD (dirham), Tunisia in TND (dinar). Riads are a Moroccan section only. Applies to Listing Search — Listing Detail follows whatever each URL points at.",
            "default": "ma"
          },
          "propertyType": {
            "title": "🏠 Property type",
            "enum": [
              "apartment",
              "villa",
              "house",
              "riad",
              "land",
              "shop",
              "office"
            ],
            "type": "string",
            "description": "Mubawab's own section. Not every type exists in every transaction: riads are sale-only and a Moroccan format, and holiday lets exist only for apartments and villas. The run stops with the valid combinations listed rather than returning an unrelated section.",
            "default": "apartment"
          },
          "transaction": {
            "title": "🤝 Buy, rent or holiday let",
            "enum": [
              "sale",
              "rent",
              "vacation"
            ],
            "type": "string",
            "description": "Sale reads the à-vendre section, rent the à-louer section, and holiday let the seasonal section Mubawab keeps separate from long rentals. Holiday lets exist for apartments and villas only.",
            "default": "sale"
          },
          "city": {
            "title": "📍 City",
            "type": "string",
            "description": "A city as Mubawab writes it, accents and all: `casablanca`, `marrakech`, `tanger`, `rabat`, `fès`, `salé`, `kénitra`, `tétouan`, `agadir`, `temara`, `el-jadida`, `oujda`, `nador`, `essaouira`, `dakhla` in Morocco; `tunis`, `sousse`, `sfax`, `ariana`, `hammamet`, `djerba`, `nabeul`, `la-marsa`, `carthage` in Tunisia. Plain names are lower-cased and hyphenated for you (El Jadida → el-jadida) but accents are kept, because the portal keeps them. Leave it empty to search the whole country.",
            "default": ""
          },
          "minPrice": {
            "title": "💰 Price from",
            "type": "integer",
            "description": "Keep only listings at or above this asking price (sales) or monthly rent (long rentals), in the market's own currency — MAD for Morocco, TND for Tunisia. Listings whose advert says \"price on request\" carry no number and are dropped when either price bound is set. Applied before you are charged, so filtered-out listings cost nothing."
          },
          "maxPrice": {
            "title": "💰 Price up to",
            "type": "integer",
            "description": "Keep only listings at or below this asking price or monthly rent, in MAD or TND. Leave both price fields empty to keep every listing including the \"price on request\" ones."
          },
          "minRooms": {
            "title": "🛏️ Bedrooms from",
            "type": "integer",
            "description": "Keep only listings advertising at least this many bedrooms (chambres). Land and some commercial listings publish no bedroom count and are dropped when this is set."
          },
          "minAreaSqm": {
            "title": "📐 Surface from (m²)",
            "type": "integer",
            "description": "Keep only listings advertising at least this many square metres. Listings with no surface on the card are dropped when this is set."
          },
          "maxResults": {
            "title": "📦 Max listings",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many listings (search) or this many detail rows. One row per listing; listings repeated across pages — Mubawab pins its promoted adverts to every page — are skipped before the count.",
            "default": 100
          },
          "listingUrls": {
            "title": "🔗 Listing URLs",
            "type": "array",
            "description": "For Listing Detail: Mubawab listing URLs, one object per row, e.g. {\"url\": \"https://www.mubawab.ma/fr/a/8115280/appartement-neuf-83-m2-a-gueliz\"}. Either market works and either host resolves any listing id. FREE runs read up to 5.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}