{
  "openapi": "3.0.1",
  "info": {
    "title": "Portugal Real Estate Scraper: Imovirtual & Casa Sapo",
    "description": "Sale and rental listings from Imovirtual and Casa Sapo in one flat dataset: price, typology (T0 to T5+), area, price per m², parish, municipality, district, energy certificate and coordinates. Search by distrito, concelho and freguesia. No login or API key.",
    "version": "0.1",
    "x-build-id": "EtiyDAxNXHZkSayG1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/allanmxr~portugal-real-estate-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-allanmxr-portugal-real-estate-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/allanmxr~portugal-real-estate-scraper/runs": {
      "post": {
        "operationId": "runs-sync-allanmxr-portugal-real-estate-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/allanmxr~portugal-real-estate-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-allanmxr-portugal-real-estate-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": {
          "sources": {
            "title": "Sources",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Portals to search. The listing budget (Max items) is shared equally between them. OLX only adds the ads that are not republished from Imovirtual when both are selected, and only lists apartments and houses. Casa Sapo is experimental and off by default: it rate-limits hard, so the actor spaces its pages out and changes IP when it is limited. SUPERCASA and Idealista open in a real browser (Chromium); Idealista is opt-in because it only works on a residential proxy, which is slower and billed per GB.",
            "items": {
              "type": "string",
              "enum": [
                "imovirtual",
                "olx",
                "casasapo",
                "supercasa",
                "idealista"
              ],
              "enumTitles": [
                "Imovirtual",
                "OLX Portugal (imóveis)",
                "Casa Sapo (experimental, slow)",
                "SUPERCASA",
                "Idealista (opt-in, uses residential proxy, slower)"
              ]
            },
            "default": [
              "imovirtual",
              "olx"
            ]
          },
          "dealType": {
            "title": "Deal type",
            "enum": [
              "sale",
              "rent"
            ],
            "type": "string",
            "description": "Buy (comprar) or rent (arrendar).",
            "default": "sale"
          },
          "district": {
            "title": "District (distrito)",
            "enum": [
              "todo-o-pais",
              "aveiro",
              "beja",
              "braga",
              "braganca",
              "castelo-branco",
              "coimbra",
              "evora",
              "faro",
              "guarda",
              "leiria",
              "lisboa",
              "portalegre",
              "porto",
              "santarem",
              "setubal",
              "viana-do-castelo",
              "vila-real",
              "viseu",
              "ilha-da-madeira",
              "ilha-de-porto-santo",
              "ilha-de-sao-miguel",
              "ilha-terceira",
              "ilha-do-pico",
              "ilha-do-faial",
              "ilha-de-sao-jorge",
              "ilha-de-santa-maria",
              "ilha-das-flores",
              "ilha-do-corvo"
            ],
            "type": "string",
            "description": "District or island of the municipalities below. Not needed when you only paste search URLs."
          },
          "municipalities": {
            "title": "Municipalities (concelhos, optional)",
            "type": "array",
            "description": "Municipality names, one per line, for example Cascais or Vila Nova de Gaia. They must belong to the district above. Leave empty to search the whole district.",
            "items": {
              "type": "string"
            }
          },
          "parishes": {
            "title": "Parishes (freguesias, optional)",
            "type": "array",
            "description": "Narrow the search to these parishes, written as the portal names them, for example Cascais e Estoril or Alvalade. Works with exactly one municipality.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Search URLs (optional)",
            "type": "array",
            "description": "Search pages copied from imovirtual.com (/pt/resultados/comprar/apartamento/lisboa/...) or casa.sapo.pt (/comprar-apartamentos/lisboa/...), one per line. They keep their own filters (the typology, energy certificate, advertiser, date and sort options below are applied on top) and are searched in addition to the place above. The portal of each URL must be selected in Sources. SUPERCASA and Idealista only take the place fields above, not URLs.",
            "items": {
              "type": "string"
            }
          },
          "propertyTypes": {
            "title": "Property types",
            "type": "array",
            "description": "Leave empty for apartments and houses. OLX only lists apartments and houses; Idealista has no rooms; SUPERCASA lists rooms for rent only.",
            "items": {
              "type": "string",
              "enum": [
                "apartment",
                "house",
                "land",
                "room",
                "garage"
              ],
              "enumTitles": [
                "Apartment (apartamento)",
                "House (moradia)",
                "Land (terreno)",
                "Room (quarto)",
                "Garage (garagem)"
              ]
            }
          },
          "typologies": {
            "title": "Typology (T0 to T5+)",
            "type": "array",
            "description": "Number of bedrooms as Portuguese listings write it: T0 is a studio, T2 has two bedrooms. Applies to apartments and houses. All portals; Casa Sapo asks for T5 only when T5 or more is picked, SUPERCASA and Idealista ask for T4 or more and the actor keeps the exact typologies.",
            "items": {
              "type": "string",
              "enum": [
                "T0",
                "T1",
                "T2",
                "T3",
                "T4",
                "T5+"
              ],
              "enumTitles": [
                "T0",
                "T1",
                "T2",
                "T3",
                "T4",
                "T5 or more"
              ]
            }
          },
          "minPrice": {
            "title": "Min price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Monthly rent for rentals, asking price for sales. All portals."
          },
          "maxPrice": {
            "title": "Max price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Monthly rent for rentals, asking price for sales. All portals."
          },
          "minArea": {
            "title": "Min area (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Usable area (SUPERCASA and Idealista filter gross built area). All portals."
          },
          "maxArea": {
            "title": "Max area (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Usable area (SUPERCASA and Idealista filter gross built area). All portals."
          },
          "energyCertificates": {
            "title": "Energy certificate (certificado energético)",
            "type": "array",
            "description": "Only these energy ratings. Imovirtual shows the rating only on the listing page, so this opens every candidate listing (slower). Casa Sapo takes one rating only and is skipped when you pick more. SUPERCASA and Idealista are skipped when you pick any.",
            "items": {
              "type": "string",
              "enum": [
                "A+",
                "A",
                "B",
                "B-",
                "C",
                "D",
                "E",
                "F",
                "G"
              ]
            }
          },
          "advertiserType": {
            "title": "Advertiser",
            "enum": [
              "any",
              "agency",
              "private"
            ],
            "type": "string",
            "description": "Agencies and developers, or private owners only. Imovirtual filters it itself; on Casa Sapo and Idealista the actor filters after the search. SUPERCASA does not say who advertises, so it is skipped unless this is Any.",
            "default": "any"
          },
          "publishedWithinDays": {
            "title": "Published in the last N days",
            "minimum": 1,
            "type": "integer",
            "description": "Only listings published or republished in the last N days, newest first. All portals except that Idealista only filters the last 48 hours (it is skipped for more than 2 days) and does not show the date."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "newest"
            ],
            "type": "string",
            "description": "Order of the results, which matters most when Max items is smaller than the number of matches. All portals.",
            "default": "relevance"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Total listings across all sources.",
            "default": 100
          },
          "fetchDetails": {
            "title": "Fetch listing details (Imovirtual)",
            "type": "boolean",
            "description": "Opens each Imovirtual listing to add coordinates, bathrooms, energy certificate, condition and build year. One extra light request per listing, so the run takes longer. Casa Sapo already returns coordinates in the search and ignores this option.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration (optional)",
            "type": "object",
            "description": "Leave empty: runs start without a proxy and, if a portal blocks (403), the actor climbs by itself to Apify Proxy datacenter, then residential in Portugal. On the residential rung the detail pages are skipped. SUPERCASA starts on datacenter; Idealista only runs on the residential proxy (through a browser). Set a proxy here only to replace that default."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}