{
  "openapi": "3.0.1",
  "info": {
    "title": "Portugal Real Estate Scraper (Imovirtual, OLX, Idealista)",
    "description": "One normalized dataset from Imovirtual, OLX, CustoJusto and Idealista: price, EUR/m2, T0-T5 typology, parish/municipality, private seller vs agency (native portal flags), phone, AMI licence, no-agencies flag, price history and days on market. Built for Portuguese agents, CRMs and market analysts.",
    "version": "0.1",
    "x-build-id": "eBkvRGbqGd1r6Xylh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/imoleadaipro~portugal-real-estate-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-imoleadaipro-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/imoleadaipro~portugal-real-estate-scraper/runs": {
      "post": {
        "operationId": "runs-sync-imoleadaipro-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/imoleadaipro~portugal-real-estate-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-imoleadaipro-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",
        "required": [
          "operation"
        ],
        "properties": {
          "portals": {
            "title": "Portais",
            "type": "array",
            "description": "Portais a pesquisar. Recomendado começar por Imovirtual + OLX + CustoJusto (sem anti-bot pesado) e activar Idealista só com proxy residencial.",
            "items": {
              "type": "string",
              "enum": [
                "imovirtual",
                "olx",
                "custojusto",
                "supercasa",
                "idealista"
              ],
              "enumTitles": [
                "Imovirtual",
                "OLX",
                "CustoJusto",
                "SuperCasa",
                "Idealista"
              ]
            },
            "default": [
              "imovirtual",
              "olx",
              "custojusto"
            ]
          },
          "operation": {
            "title": "Operação",
            "enum": [
              "sale",
              "rent"
            ],
            "type": "string",
            "description": "Comprar ou arrendar. Aplica-se a todos os portais escolhidos.",
            "default": "sale"
          },
          "propertyType": {
            "title": "Tipo de imóvel",
            "enum": [
              "apartment",
              "house",
              "land",
              "commercial",
              "any"
            ],
            "type": "string",
            "description": "Restringe o tipo de imóvel. «Qualquer» percorre todos os tipos que o portal listar.",
            "default": "any"
          },
          "locations": {
            "title": "Localizações",
            "type": "array",
            "description": "Concelhos ou distritos em português, sem acentos e em minúsculas (ex.: lisboa, porto, cascais, setubal). O actor traduz para o URL de cada portal.",
            "default": [
              "lisboa"
            ],
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "URLs de pesquisa (avançado)",
            "type": "array",
            "description": "Em alternativa a locations: cole URLs de resultados de pesquisa de qualquer portal suportado. O portal é detectado pelo domínio.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "sellerType": {
            "title": "Tipo de anunciante",
            "enum": [
              "any",
              "private",
              "agency"
            ],
            "type": "string",
            "description": "Filtro aplicado no URL quando o portal o suporta e, em qualquer caso, na saída.",
            "default": "any"
          },
          "deduplicate": {
            "title": "O mesmo imóvel em vários portais",
            "enum": [
              "mark",
              "drop",
              "off"
            ],
            "type": "string",
            "description": "O mesmo apartamento é anunciado no OLX, no Imovirtual e no CasaSapo. \"Marcar\" entrega-o na mesma com o campo duplicateOf a apontar ao primeiro; \"Não entregar\" devolve cada imóvel uma só vez — e as repetições não são cobradas.",
            "default": "mark"
          },
          "deliver": {
            "title": "O que entregar",
            "enum": [
              "all",
              "new",
              "new-or-changed"
            ],
            "type": "string",
            "description": "\"Novos\" e \"novos ou com preco alterado\" so entregam o que mudou desde a ultima passagem — e so isso e cobrado. Use-os com um agendamento (de hora a hora, por exemplo) para falar com um anunciante antes da concorrencia. Precisam do historico de precos ligado.",
            "default": "all"
          },
          "minPrice": {
            "title": "Preço mínimo (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Ignora anúncios abaixo deste valor. Deixar vazio para não filtrar."
          },
          "maxPrice": {
            "title": "Preço máximo (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Ignora anúncios acima deste valor. Deixar vazio para não filtrar."
          },
          "maxItemsPerPortal": {
            "title": "Máximo de anúncios por portal",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Trava de custo e de tempo: pára cada portal ao atingir este número. Com os 3 portais por omissão são até 60 resultados em ~4 minutos. Medido a 2026-09-16: 50 por portal com detalhe levava 10 a 12 minutos e o teste automático diário da Apify não esperava tanto.",
            "default": 20
          },
          "fetchDetails": {
            "title": "Abrir página de detalhe",
            "type": "boolean",
            "description": "Necessário para telefone, descrição completa, certificado energético e ano de construção. Duplica o número de pedidos.",
            "default": true
          },
          "priceHistory": {
            "title": "Histórico de preços (persistente)",
            "type": "boolean",
            "description": "Guarda o último preço visto de cada anúncio numa key-value store nomeada e devolve priceHistory + daysOnMarket em runs seguintes.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Para Idealista e SuperCasa use proxy residencial com countryCode PT. Para Imovirtual/OLX/CustoJusto datacenter costuma chegar.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "PT"
            }
          },
          "maxConcurrency": {
            "title": "Concorrência máxima",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Manter baixo (2–4) para portais com DataDome.",
            "default": 3
          },
          "idealistaMode": {
            "title": "Idealista: modo",
            "enum": [
              "actor",
              "browser"
            ],
            "type": "string",
            "description": "'actor' chama dz_omar/idealista-scraper-api e normaliza o resultado (0,55 $/1.000, cobrado à sua conta). 'browser' usa o adaptador Playwright interno.",
            "default": "actor"
          },
          "debug": {
            "title": "Logs de debug",
            "type": "boolean",
            "description": "Escreve no log cada pedido, selector e descarte. Usar só a investigar um portal que mudou de HTML.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}