{
  "openapi": "3.0.1",
  "info": {
    "title": "Servihabitat Scraper: Spain Bank-Owned Properties (REO)",
    "description": "Scrape Servihabitat.com bank-owned properties in Spain: homes, commercial, land, garages and new developments with price, price history, address, coordinates, areas, energy certificate and owning company. Sale and rent, all 51 provinces, only-new monitor. Export CSV, Excel, JSON, XML.",
    "version": "0.1",
    "x-build-id": "efreSuzudDvQMLhm0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~servihabitat-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-servihabitat-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/recordsdata~servihabitat-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-servihabitat-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/recordsdata~servihabitat-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-servihabitat-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": {
          "mode": {
            "title": "Source",
            "enum": [
              "search",
              "startUrls",
              "listingIds",
              "sitemap"
            ],
            "type": "string",
            "description": "Where the listings come from. Search: browse the Servihabitat catalog with the filters below (default). Start URLs: read the property, promotion or search pages you list. Listing IDs: look up listings by their 8-digit id. Sitemap: walk the official province sitemaps for the widest coverage. If you fill Start URLs or Listing IDs the source switches automatically.",
            "default": "search"
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Optional servihabitat.com pages to read: a property page (/es/venta/vivienda-piso/madrid-madrid-madrid/60580004), a promotion page (/es/promociones/...) or a search page (/es/venta/vivienda/madrid). Search pages are paged to the end; a location in the URL is applied as a filter.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "listingIds": {
            "title": "Listing IDs",
            "type": "array",
            "description": "Optional list of listing ids (8 digits, the last part of the listing URL, for example 60580004). Ids are looked up in the official sitemaps (this reads the province sitemaps and takes 30 to 70 seconds) and read directly, whatever the filters. An id that does not exist returns one free error row.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
          },
          "recordTypes": {
            "title": "Record types",
            "type": "array",
            "description": "What to return. Listings: one row per property (price, address, areas, rooms, energy certificate, photos, owner, market averages). Promotions: one row per new development with its units. Towns: one row per town with population, services and listing totals. Owners: one row per selling entity with its tax id and listing totals. Every row counts toward Max Items.",
            "items": {
              "type": "string",
              "enum": [
                "listings",
                "promotions",
                "towns",
                "owners"
              ],
              "enumTitles": [
                "Listings (properties)",
                "Promotions (new developments)",
                "Towns (area profile)",
                "Owners (selling entities)"
              ]
            },
            "default": [
              "listings"
            ]
          },
          "fetchDetails": {
            "title": "Fetch full listing details",
            "type": "boolean",
            "description": "Open every property page for the full description, coordinates, energy certificate, amenities, owner, photo gallery, market averages and town profile. Billed as the listing-detail event. Turn off for a cheaper pass that uses the search card only.",
            "default": true
          },
          "expandPromotions": {
            "title": "Expand promotions into units",
            "type": "boolean",
            "description": "A promotion is a new development that groups several units. When on, every unit of a promotion found in the search becomes its own listing row. Turn off to keep only standalone properties.",
            "default": true
          },
          "operation": {
            "title": "Operation",
            "enum": [
              "sale",
              "rent",
              "both"
            ],
            "type": "string",
            "description": "Buy (venta), rent (alquiler) or both.",
            "default": "sale"
          },
          "propertyTypes": {
            "title": "Property types",
            "type": "array",
            "description": "Only these property types. Leave empty for every type (homes, parking, storage, commercial, offices, industrial, buildings, unfinished works, land, other).",
            "items": {
              "type": "string",
              "enum": [
                "vivienda",
                "vivienda-piso",
                "vivienda-casa",
                "vivienda-atico",
                "vivienda-duplex",
                "vivienda-plantabaja",
                "garaje",
                "garaje-garajecoche",
                "garaje-garajemoto",
                "trastero",
                "local",
                "oficina",
                "nave",
                "edificio",
                "obraparada",
                "terreno",
                "terreno-urbanoparaconstruir",
                "terreno-urbanizable",
                "terreno-rustico",
                "terreno-urbanonoconsolidado",
                "varios"
              ],
              "enumTitles": [
                "Homes (all kinds)",
                "Flats",
                "Houses",
                "Penthouses",
                "Duplexes",
                "Ground-floor homes",
                "Parking (all kinds)",
                "Car parking spaces",
                "Motorbike parking spaces",
                "Storage rooms",
                "Commercial premises",
                "Offices",
                "Industrial buildings",
                "Whole buildings",
                "Unfinished works (obra parada)",
                "Land (all kinds)",
                "Urban land ready to build",
                "Developable land",
                "Rural land",
                "Urban non-consolidated land",
                "Other assets"
              ]
            },
            "default": []
          },
          "provinces": {
            "title": "Provinces",
            "type": "array",
            "description": "Only properties in these Spanish provinces. Leave empty for all 51 provinces.",
            "items": {
              "type": "string",
              "enum": [
                "albacete",
                "alicante",
                "almeria",
                "araba",
                "asturias",
                "avila",
                "badajoz",
                "barcelona",
                "bizkaia",
                "burgos",
                "caceres",
                "cadiz",
                "cantabria",
                "castellon",
                "ceuta",
                "ciudadreal",
                "cordoba",
                "cuenca",
                "gipuzkoa",
                "girona",
                "granada",
                "guadalajara",
                "huelva",
                "huesca",
                "illesbalears",
                "jaen",
                "lacoruna",
                "larioja",
                "laspalmas",
                "leon",
                "lleida",
                "lugo",
                "madrid",
                "malaga",
                "murcia",
                "navarra",
                "orense",
                "palencia",
                "pontevedra",
                "salamanca",
                "segovia",
                "sevilla",
                "soria",
                "stacruztenerife",
                "tarragona",
                "teruel",
                "toledo",
                "valencia",
                "valladolid",
                "zamora",
                "zaragoza"
              ],
              "enumTitles": [
                "Albacete",
                "Alicante",
                "Almería",
                "Araba / Álava",
                "Asturias",
                "Ávila",
                "Badajoz",
                "Barcelona",
                "Bizkaia",
                "Burgos",
                "Cáceres",
                "Cádiz",
                "Cantabria",
                "Castellón",
                "Ceuta",
                "Ciudad Real",
                "Córdoba",
                "Cuenca",
                "Gipuzkoa",
                "Girona",
                "Granada",
                "Guadalajara",
                "Huelva",
                "Huesca",
                "Illes Balears",
                "Jaén",
                "A Coruña",
                "La Rioja",
                "Las Palmas",
                "León",
                "Lleida",
                "Lugo",
                "Madrid",
                "Málaga",
                "Murcia",
                "Navarra",
                "Ourense",
                "Palencia",
                "Pontevedra",
                "Salamanca",
                "Segovia",
                "Sevilla",
                "Soria",
                "Santa Cruz de Tenerife",
                "Tarragona",
                "Teruel",
                "Toledo",
                "Valencia",
                "Valladolid",
                "Zamora",
                "Zaragoza"
              ]
            },
            "default": []
          },
          "locations": {
            "title": "Areas and towns",
            "type": "array",
            "description": "Optional narrower places, as the location slug used in Servihabitat search URLs: province, province-area or province-area-town, for example alicante-vegabajadelsegura-torrevieja or madrid-corredordelhenares-alcaladehenares. When filled it replaces the provinces list.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "feature": {
            "title": "Feature",
            "enum": [
              "",
              "terraza",
              "jardin",
              "garaje",
              "aestrenar",
              "segundamano",
              "piscina",
              "ascensor",
              "doshabitaciones",
              "treshabitaciones",
              "cuatrohabitaciones",
              "patio",
              "calefaccion",
              "aireacondicionado",
              "salidadehumos",
              "sobreplano",
              "muelledecarga"
            ],
            "type": "string",
            "description": "One feature applied by Servihabitat, for example terrace, garden, swimming pool or lift. Leave empty for no feature filter.",
            "default": ""
          },
          "minPrice": {
            "title": "Minimum price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Only properties priced at or above this value in euros (rent is the monthly price). 0 means no minimum.",
            "default": 0
          },
          "maxPrice": {
            "title": "Maximum price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Only properties priced at or below this value in euros (rent is the monthly price). 0 means no maximum.",
            "default": 0
          },
          "minArea": {
            "title": "Minimum area (m2)",
            "minimum": 0,
            "type": "integer",
            "description": "Only properties with at least this built area in square meters (land plots use the plot area). 0 means no minimum.",
            "default": 0
          },
          "maxArea": {
            "title": "Maximum area (m2)",
            "minimum": 0,
            "type": "integer",
            "description": "Only properties with at most this built area in square meters (land plots use the plot area). 0 means no maximum.",
            "default": 0
          },
          "minBedrooms": {
            "title": "Minimum bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Only properties with at least this many bedrooms. 0 means no minimum.",
            "default": 0
          },
          "minBathrooms": {
            "title": "Minimum bathrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Only properties with at least this many bathrooms. 0 means no minimum.",
            "default": 0
          },
          "occupancy": {
            "title": "Possession",
            "enum": [
              "any",
              "vacant",
              "occupied"
            ],
            "type": "string",
            "description": "Vacant: the bank can hand over the keys. Occupied: sold without possession (the property is occupied). Any: both.",
            "default": "any"
          },
          "onlyReduced": {
            "title": "Only price reductions",
            "type": "boolean",
            "description": "Only properties that show a reduced price (a previous price above the current one).",
            "default": false
          },
          "listedWithinDays": {
            "title": "Listed within the last N days",
            "minimum": 0,
            "type": "integer",
            "description": "Only properties first listed on Servihabitat in the last N days. 0 means any age.",
            "default": 0
          },
          "searchText": {
            "title": "Text must contain",
            "type": "string",
            "description": "Only properties whose title, description or address contain all these words (accents and capitals do not matter). Forces the property page to be read, so a word that few properties contain makes the run read many pages: set Max run time.",
            "default": ""
          },
          "onlyNew": {
            "title": "Only new rows (monitor mode)",
            "type": "boolean",
            "description": "Only new rows: skip every property, promotion, town or owner this same search already returned in an earlier run, so a scheduled run returns just the new ones and you are not charged for skipped rows. Max Items then means N new rows. Off by default.",
            "default": false
          },
          "trackPriceChanges": {
            "title": "Also report price changes",
            "type": "boolean",
            "description": "In monitor mode, a property already seen whose price changed since your last run comes back as a changed-listing row with the previous price, the change and the percentage. Billed as the changed-listing event.",
            "default": true
          },
          "stateKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Name of this monitor. Leave empty to derive it from your filters. Use a name to run two monitors with the same filters.",
            "default": ""
          },
          "resetSeen": {
            "title": "Forget previously seen rows",
            "type": "boolean",
            "description": "Clear the saved list and prices for this monitor before the run, so everything counts as new again.",
            "default": false
          },
          "maxRunSeconds": {
            "title": "Max run time (seconds)",
            "minimum": 30,
            "maximum": 7200,
            "type": "integer",
            "description": "Stop collecting after this many seconds and return what was gathered, so a very wide search never runs unbounded.",
            "default": 1800
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 6,
            "type": "integer",
            "description": "How many pages are read at the same time (1 to 6). The site tolerates 3 comfortably; lower it if you see rate limit warnings.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}