{
  "openapi": "3.0.1",
  "info": {
    "title": "Fotocasa Spain Real Estate Scraper & Monitor",
    "description": "Extract Fotocasa listings in Spain for sale and rent with price drops, €/m² compared with the area median, occupied, auctioned and bank-owned flags, private sellers, phone, GPS and energy certificate. Filter like the site and track new listings and price changes.",
    "version": "1.1",
    "x-build-id": "gktDU3IQYCXj0GD7p"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamole~fotocasa-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamole-fotocasa-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/datamole~fotocasa-scraper/runs": {
      "post": {
        "operationId": "runs-sync-datamole-fotocasa-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/datamole~fotocasa-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-datamole-fotocasa-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": {
          "locations": {
            "title": "Ubicaciones",
            "type": "array",
            "description": "Como en el buscador de fotocasa.es, por ejemplo Madrid, Valencia, Russafa, Chamberí, Getafe, Málaga o Provincia de Alicante. Cada una se busca por separado. Vacío = toda España.",
            "items": {
              "type": "string"
            }
          },
          "operation": {
            "title": "Operación",
            "enum": [
              "venta",
              "alquiler",
              "compartir"
            ],
            "type": "string",
            "description": "Comprar, alquilar o habitaciones en piso compartido.",
            "default": "venta"
          },
          "propertyType": {
            "title": "Tipo de inmueble",
            "enum": [
              "viviendas",
              "pisos",
              "casas",
              "locales",
              "oficinas",
              "garajes",
              "terrenos",
              "trasteros",
              "edificios"
            ],
            "type": "string",
            "description": "Las mismas categorías de Fotocasa. Pisos y Casas y chalets son atajos de subtipos de vivienda.",
            "default": "viviendas"
          },
          "propertySubtypes": {
            "title": "Subtipo de vivienda",
            "type": "array",
            "description": "Solo para viviendas. Si eliges subtipos, reemplazan al atajo Pisos o Casas y chalets.",
            "items": {
              "type": "string",
              "enum": [
                "piso",
                "apartamento",
                "atico",
                "duplex",
                "loft",
                "estudio",
                "planta-baja",
                "casa-chalet",
                "adosado",
                "finca-rustica"
              ],
              "enumTitles": [
                "Piso",
                "Apartamento",
                "Ático",
                "Dúplex",
                "Loft",
                "Estudio",
                "Planta baja",
                "Casa o chalet",
                "Adosado",
                "Finca rústica"
              ]
            }
          },
          "searchUrls": {
            "title": "URLs de búsqueda de Fotocasa (opcional)",
            "type": "array",
            "description": "Pega búsquedas de fotocasa.es con tus filtros ya aplicados (terminan en /l, por ejemplo https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l?maxPrice=300000). Los filtros de abajo de Fotocasa no se aplican a estas URLs; los de Oportunidades, sí.",
            "items": {
              "type": "string"
            }
          },
          "minPrice": {
            "title": "Precio mínimo (€)",
            "minimum": 0,
            "type": "integer",
            "description": "En alquiler, precio al mes."
          },
          "maxPrice": {
            "title": "Precio máximo (€)",
            "minimum": 0,
            "type": "integer",
            "description": "En alquiler, precio al mes."
          },
          "minArea": {
            "title": "Superficie mínima (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Superficie construida mínima."
          },
          "maxArea": {
            "title": "Superficie máxima (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Superficie construida máxima."
          },
          "minRooms": {
            "title": "Habitaciones mínimas",
            "minimum": 0,
            "type": "integer",
            "description": "Solo viviendas."
          },
          "maxRooms": {
            "title": "Habitaciones máximas",
            "minimum": 0,
            "type": "integer",
            "description": "Solo viviendas."
          },
          "minBathrooms": {
            "title": "Baños mínimos",
            "minimum": 0,
            "type": "integer",
            "description": "Solo viviendas."
          },
          "features": {
            "title": "Características",
            "type": "array",
            "description": "El inmueble debe tener todas las elegidas.",
            "items": {
              "type": "string",
              "enum": [
                "parking",
                "ascensor",
                "terraza",
                "piscina",
                "jardin",
                "aire-acondicionado",
                "calefaccion",
                "trastero",
                "balcon",
                "patio",
                "amueblado",
                "sin-amueblar",
                "admite-mascotas"
              ],
              "enumTitles": [
                "Parking",
                "Ascensor",
                "Terraza",
                "Piscina",
                "Jardín",
                "Aire acondicionado",
                "Calefacción",
                "Trastero",
                "Balcón",
                "Patio",
                "Amueblado",
                "Sin amueblar",
                "Admite mascotas"
              ]
            }
          },
          "conservation": {
            "title": "Estado",
            "type": "array",
            "description": "Solo viviendas. A reformar es el filtro clásico de los inversores.",
            "items": {
              "type": "string",
              "enum": [
                "casi-nuevo",
                "muy-bien",
                "bien",
                "a-reformar",
                "reformado"
              ],
              "enumTitles": [
                "Casi nuevo",
                "Muy bien",
                "Bien",
                "A reformar",
                "Reformado"
              ]
            }
          },
          "occupancy": {
            "title": "Situación del inmueble",
            "enum": [
              "todos",
              "disponible",
              "ocupado",
              "alquilado-con-inquilino",
              "nuda-propiedad",
              "subasta"
            ],
            "type": "string",
            "description": "El filtro de Fotocasa para ocupados, nuda propiedad, subastas y viviendas con inquilino.",
            "default": "todos"
          },
          "bankPropertiesOnly": {
            "title": "Solo pisos de bancos",
            "type": "boolean",
            "description": "La sección de Fotocasa de inmuebles de entidades financieras.",
            "default": false
          },
          "constructionType": {
            "title": "Obra nueva o segunda mano",
            "enum": [
              "todas",
              "obra-nueva",
              "segunda-mano"
            ],
            "type": "string",
            "description": "El filtro de Fotocasa por tipo de construcción.",
            "default": "todas"
          },
          "publishedWithin": {
            "title": "Publicado en",
            "enum": [
              "cualquiera",
              "24h",
              "48h",
              "semana",
              "mes"
            ],
            "type": "string",
            "description": "Antigüedad máxima del anuncio, como el filtro de Fotocasa.",
            "default": "cualquiera"
          },
          "advertiserType": {
            "title": "Anunciante",
            "enum": [
              "todos",
              "particular",
              "profesional"
            ],
            "type": "string",
            "description": "Solo particulares sirve para captar propietarios que venden o alquilan sin inmobiliaria. Fotocasa no tiene este filtro y su orden por relevancia pone primero a los anunciantes de pago, así que con Solo particulares y orden Relevancia el actor ordena por Más recientes.",
            "default": "todos"
          },
          "onlyPriceDrops": {
            "title": "Solo avisos con bajada de precio",
            "type": "boolean",
            "description": "Avisos en los que el anunciante rebajó el precio (Fotocasa muestra el importe rebajado).",
            "default": false
          },
          "minPriceDropPercent": {
            "title": "Bajada de precio mínima (%)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Por ejemplo 10 = solo avisos que bajaron un 10% o más."
          },
          "minPercentBelowArea": {
            "title": "Al menos X% por debajo del €/m² de la zona",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Compara el €/m² de cada aviso con la mediana de avisos comparables de la misma búsqueda (mismo barrio, si no distrito, si no municipio; mínimo 5 comparables). Por ejemplo 15 = solo avisos un 15% o más baratos que su zona. Con este filtro el actor revisa al menos 300 avisos para tener una mediana fiable."
          },
          "maxPricePerSqm": {
            "title": "€/m² máximo",
            "minimum": 1,
            "type": "integer",
            "description": "En alquiler, €/m² al mes."
          },
          "maxDaysOnMarket": {
            "title": "Días publicados como máximo",
            "minimum": 0,
            "type": "integer",
            "description": "Por ejemplo 3 = solo avisos publicados en los últimos 3 días."
          },
          "sortBy": {
            "title": "Orden",
            "enum": [
              "relevancia",
              "recientes",
              "precio-asc",
              "precio-desc",
              "precio-m2-asc",
              "superficie-desc"
            ],
            "type": "string",
            "description": "Los mismos órdenes de Fotocasa.",
            "default": "relevancia"
          },
          "maxItems": {
            "title": "Máximo de avisos",
            "minimum": 1,
            "type": "integer",
            "description": "Total de avisos guardados entre todas las búsquedas. Fotocasa muestra 30 por página.",
            "default": 100
          },
          "maxPagesPerSearch": {
            "title": "Máximo de páginas por búsqueda",
            "minimum": 1,
            "type": "integer",
            "description": "Límite opcional por ubicación o URL. Vacío = todas las páginas."
          },
          "includeDetails": {
            "title": "Incluir la ficha completa",
            "type": "boolean",
            "description": "Agrega el email de la inmobiliaria, el historial de precios (cada cambio con su fecha, número de cambios y variación desde el primer precio registrado), el año de construcción, el certificado energético (letra, consumo y emisiones), calefacción y agua caliente, referencia del anuncio, razón social, web y registros oficiales de la inmobiliaria, licencia turística, segunda mano u obra nueva, todos los extras y la descripción completa. El email de los particulares nunca se entrega.",
            "default": false
          },
          "monitorMode": {
            "title": "Modo monitoreo",
            "type": "boolean",
            "description": "La primera corrida guarda todo. Las siguientes devuelven solo avisos nuevos y avisos que cambiaron de precio, con el precio anterior y el % de cambio.",
            "default": false
          },
          "monitorName": {
            "title": "Nombre del monitoreo (opcional)",
            "type": "string",
            "description": "Ponle un nombre para mantener la memoria aunque cambies algún filtro. Vacío = una memoria por cada combinación de filtros."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Fotocasa bloquea las IPs de centros de datos. Deja el proxy residencial de España.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "ES"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}