{
  "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": "7bwqzdHQtTqUKQhVS"
  },
  "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": "Where do the listings come from?",
            "enum": [
              "search",
              "startUrls",
              "listingIds",
              "sitemap"
            ],
            "type": "string",
            "description": "Search = browse the catalog with the filters below (most common). Start URLs = pages you paste. Listing IDs = look up 8-digit ids. Sitemap = widest coverage, slower. If you fill links or ids the source switches automatically.",
            "default": "search"
          },
          "recordTypes": {
            "title": "What do you want to collect?",
            "type": "array",
            "description": "Listings = one row per property. Promotions = new developments with their units. Towns = one row per town with population and totals. Owners = one row per selling entity. Every row counts toward Max results.",
            "items": {
              "type": "string",
              "enum": [
                "listings",
                "promotions",
                "towns",
                "owners"
              ],
              "enumTitles": [
                "Listings (properties)",
                "Promotions (new developments)",
                "Towns (area profile)",
                "Owners (selling entities)"
              ]
            },
            "default": [
              "listings"
            ]
          },
          "maxItems": {
            "title": "Max results (free plan: 10)",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stops after this many rows, for example 50. Free plans are capped at 10. Paid plans: up to 1,000,000."
          },
          "operation": {
            "title": "Buy or rent",
            "enum": [
              "sale",
              "rent",
              "both"
            ],
            "type": "string",
            "description": "Sale (venta), rent (alquiler) or both.",
            "default": "sale"
          },
          "propertyTypes": {
            "title": "Property types",
            "type": "array",
            "description": "For example Homes. Empty means every type (homes, parking, storage, commercial, land...).",
            "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": "For example Madrid, Alicante. Empty means 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": "Towns and areas (optional)",
            "type": "array",
            "description": "Location slug as in Servihabitat URLs, for example alicante-vegabajadelsegura-torrevieja. When filled it replaces the provinces list.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "feature": {
            "title": "Must have feature (optional)",
            "enum": [
              "",
              "terraza",
              "jardin",
              "garaje",
              "aestrenar",
              "segundamano",
              "piscina",
              "ascensor",
              "doshabitaciones",
              "treshabitaciones",
              "cuatrohabitaciones",
              "patio",
              "calefaccion",
              "aireacondicionado",
              "salidadehumos",
              "sobreplano",
              "muelledecarga"
            ],
            "type": "string",
            "description": "One feature, for example terrace, garden, swimming pool or lift. Empty means no feature filter.",
            "default": ""
          },
          "minPrice": {
            "title": "Min 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": "Max 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": "Min built 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": "Max built 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": "Min bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Only properties with at least this many bedrooms. 0 means no minimum.",
            "default": 0
          },
          "minBathrooms": {
            "title": "Min 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 in the last N days, for example 7. 0 means any age.",
            "default": 0
          },
          "searchText": {
            "title": "Text must contain (slow)",
            "type": "string",
            "description": "Words that must appear in title, description or address, for example sea view. Forces every page to be read, so also set Max run time.",
            "default": ""
          },
          "startUrls": {
            "title": "Servihabitat links",
            "type": "array",
            "description": "A property page, a promotion page (/es/promociones/...) or a search page (/es/venta/vivienda/madrid). Example: https://www.servihabitat.com/es/venta/vivienda-piso/madrid-madrid-madrid/60580004",
            "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": "8-digit ids, the last part of a listing URL, for example 60580004. Reading the sitemaps takes 30 to 70 seconds.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "fetchDetails": {
            "title": "Open every property page (richer, billed per detail)",
            "type": "boolean",
            "description": "On: description, coordinates, energy certificate, amenities, owner, photos, market averages. Billed as the listing-detail event. Off: cheaper, search-card data only.",
            "default": true
          },
          "expandPromotions": {
            "title": "Split new developments into units",
            "type": "boolean",
            "description": "On: every unit of a promotion becomes its own listing row. Off: standalone properties only.",
            "default": true
          },
          "onlyNew": {
            "title": "Only rows not seen before",
            "type": "boolean",
            "description": "Skips rows this same search already returned in an earlier run, so you are not charged for them. Max results then means N new rows.",
            "default": false
          },
          "trackPriceChanges": {
            "title": "Also report price changes",
            "type": "boolean",
            "description": "Needs Only rows not seen before. A known property with a new price comes back as a changed-listing row (billed as the changed-listing event).",
            "default": true
          },
          "stateKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "One name per saved search, for example madrid-homes. Empty derives one from your filters.",
            "default": ""
          },
          "resetSeen": {
            "title": "Forget seen rows before this run",
            "type": "boolean",
            "description": "Everything counts as new again.",
            "default": false
          },
          "maxRunSeconds": {
            "title": "Max run time (seconds)",
            "minimum": 30,
            "maximum": 7200,
            "type": "integer",
            "description": "Stops after this many seconds and returns what was gathered, for example 1800.",
            "default": 1800
          },
          "maxConcurrency": {
            "title": "Parallel requests (1-6)",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}