{
  "openapi": "3.0.1",
  "info": {
    "title": "Fotocasa Scraper",
    "description": "Scrape Fotocasa Spain homes for sale, rent and room shares: price, price drops, €/m², rooms, m², floor, condition, 60+ features, GPS, photos, agency and phone. Multiple locations, gets past the 10,000 cap. Optional details: energy rating, street, agency ref.",
    "version": "1.0",
    "x-build-id": "Y8tdtXPV0WG4IZ3Pe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/normdata~fotocasa-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-normdata-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/normdata~fotocasa-scraper/runs": {
      "post": {
        "operationId": "runs-sync-normdata-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/normdata~fotocasa-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-normdata-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": {
          "maxItems": {
            "title": "Maximum properties",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many properties. Leave empty for no limit (every listing that matches, even past Fotocasa's 10,000-result cap). The Apify Free plan is always capped at 10."
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "Anything you would type in the Fotocasa search box: a city (\"Madrid\", \"Málaga\"), a district or neighbourhood (\"Chamberí, Madrid\", \"Gràcia, Barcelona\"), a county or area (\"Costa del Sol Occidental - Zona de Marbella\") or a whole province (\"provincia de Valencia\"). \"Madrid\" alone is the city.",
            "items": {
              "type": "string"
            }
          },
          "urls": {
            "title": "...or paste links",
            "type": "array",
            "description": "Fotocasa search pages with all their filters (e.g. fotocasa.es/es/alquiler/viviendas/barcelona-capital/todas-las-zonas/l?minRooms=2) or single listings (fotocasa.es/es/comprar/vivienda/.../190783970/d). Links keep their own filters; the filters below apply to Locations.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "operation": {
            "title": "Operation",
            "enum": [
              "sale",
              "rent",
              "share",
              "transfer",
              "rent-to-own"
            ],
            "type": "string",
            "description": "Buy, rent, room shares, business transfers or rent-to-own.",
            "default": "sale"
          },
          "propertyType": {
            "title": "Property type",
            "enum": [
              "homes",
              "garages",
              "land",
              "commercial",
              "offices",
              "storage",
              "buildings"
            ],
            "type": "string",
            "description": "Homes, garages, land, commercial premises, offices, storage rooms or whole buildings.",
            "default": "homes"
          },
          "minPrice": {
            "title": "Min price (€)",
            "minimum": 0,
            "type": "integer",
            "description": "For rentals: per month."
          },
          "maxPrice": {
            "title": "Max price (€)",
            "minimum": 0,
            "type": "integer",
            "description": "For rentals: per month."
          },
          "minRooms": {
            "title": "Min bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "0 = studio."
          },
          "maxRooms": {
            "title": "Max bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Leave empty for no limit."
          },
          "minBathrooms": {
            "title": "Min bathrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Leave empty for any."
          },
          "maxBathrooms": {
            "title": "Max bathrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Leave empty for no limit."
          },
          "minSize": {
            "title": "Min size (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Built size."
          },
          "maxSize": {
            "title": "Max size (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Built size."
          },
          "subtypes": {
            "title": "Home and land types",
            "type": "array",
            "description": "Keep only these kinds. Leave empty for all. Home kinds apply to Homes, land kinds to Land.",
            "items": {
              "type": "string",
              "enum": [
                "flat",
                "apartment",
                "house",
                "terraced",
                "penthouse",
                "duplex",
                "loft",
                "studio",
                "ground_floor",
                "country_house",
                "residential_land",
                "buildable_land",
                "non_buildable_land",
                "industrial_land",
                "land",
                "industrial_building"
              ],
              "enumTitles": [
                "Flat",
                "Apartment",
                "House / chalet",
                "Semi-detached / terraced",
                "Penthouse",
                "Duplex",
                "Loft",
                "Studio",
                "Ground floor",
                "Country house",
                "Residential land",
                "Buildable land",
                "Non-buildable land",
                "Industrial land",
                "Other land",
                "Industrial building"
              ]
            }
          },
          "condition": {
            "title": "Condition",
            "type": "array",
            "description": "Keep only listings in ANY of these states.",
            "items": {
              "type": "string",
              "enum": [
                "almost_new",
                "very_good",
                "good",
                "needs_renovation",
                "renovated"
              ],
              "enumTitles": [
                "Almost new",
                "Very good",
                "Good",
                "Needs renovation",
                "Renovated"
              ]
            }
          },
          "features": {
            "title": "Must have",
            "type": "array",
            "description": "Keep only listings with ALL of these. The last ones apply to rentals, room shares or commercial premises.",
            "items": {
              "type": "string",
              "enum": [
                "lift",
                "parking",
                "pool",
                "garden",
                "terrace",
                "balcony",
                "air_conditioning",
                "heating",
                "storage_room",
                "furnished",
                "unfurnished",
                "appliances",
                "tv",
                "internet",
                "pets_allowed",
                "non_smokers",
                "girls_only",
                "boys_only",
                "community_fees_included",
                "deposit_under_2_months",
                "access_24h",
                "loading_bay",
                "automatic_door",
                "security_guard",
                "smoke_outlet"
              ],
              "enumTitles": [
                "Lift",
                "Parking",
                "Swimming pool",
                "Garden",
                "Terrace",
                "Balcony",
                "Air conditioning",
                "Heating",
                "Storage room",
                "Furnished",
                "Unfurnished",
                "Appliances",
                "TV",
                "Internet",
                "Pets allowed",
                "Non-smokers only",
                "Girls only",
                "Boys only",
                "Community fees included",
                "Deposit under 2 months",
                "24h access",
                "Loading bay",
                "Automatic door",
                "Security guard",
                "Smoke outlet"
              ]
            }
          },
          "tags": {
            "title": "Highlights",
            "type": "array",
            "description": "Keep only listings Fotocasa tags with ANY of these.",
            "items": {
              "type": "string",
              "enum": [
                "luxury",
                "sea_views",
                "seafront",
                "fireplace",
                "villa",
                "single_family",
                "modern",
                "exterior",
                "wheelchair_accessible",
                "countryside",
                "urgent_sale",
                "for_students"
              ],
              "enumTitles": [
                "Luxury",
                "Beach views",
                "Seafront",
                "Fireplace",
                "Villa",
                "Single-family home",
                "Modern",
                "Exterior",
                "Wheelchair accessible",
                "Countryside",
                "Urgent sale",
                "For students"
              ]
            }
          },
          "occupancy": {
            "title": "Occupancy",
            "type": "array",
            "description": "Keep only listings in ANY of these situations, e.g. bank and investor deals: occupied, rented with tenants, auctions, bare ownership.",
            "items": {
              "type": "string",
              "enum": [
                "available",
                "occupied",
                "rented",
                "auction",
                "bare_ownership"
              ],
              "enumTitles": [
                "Available (vacant)",
                "Occupied",
                "Rented with tenants",
                "Auction",
                "Bare ownership"
              ]
            }
          },
          "publishedWithin": {
            "title": "Published",
            "enum": [
              "1",
              "2",
              "7",
              "30"
            ],
            "type": "string",
            "description": "Only listings published (or renewed) in this window."
          },
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "Fotocasa's own text search over the listing, e.g. \"reformado\", \"vistas al mar\", \"garaje\"."
          },
          "priceDropOnly": {
            "title": "Price drops only",
            "type": "boolean",
            "description": "Keep only listings whose price has been cut.",
            "default": false
          },
          "privateOnly": {
            "title": "Private sellers only",
            "type": "boolean",
            "description": "Keep only listings posted by owners, not agencies.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "newest",
              "price_low",
              "price_high",
              "price_m2_low",
              "size_high",
              "rooms_high"
            ],
            "type": "string",
            "description": "Order of the results. Matters most when you set a Maximum.",
            "default": "relevance"
          },
          "onlyNew": {
            "title": "New listings only",
            "type": "boolean",
            "description": "For scheduled runs: save only listings this same search has not saved before. The first run saves everything; later runs save just what was added since. Kept per search (locations, links and filters).",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional. Give \"New listings only\" a fixed name to keep its memory even after you change the filters."
          },
          "includeDetails": {
            "title": "Full details",
            "type": "boolean",
            "description": "Reads each full listing and adds: energy rating and consumption, emissions rating, street and number, agency reference, heating fuel, plot size, agency email (new builds), website and logo, tourist licence and rent reference index. Paid add-on: one extra charge per property saved with details (see Pricing).",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}