{
  "openapi": "3.0.1",
  "info": {
    "title": "Fotocasa Scraper - Spain Property Listings, Prices & Agents",
    "description": "Scrape Fotocasa.es listings for sale or rent anywhere in Spain: price, price drops, €/m², rooms, baths, m², decoded floor, 8-level location, GPS, photos, agency and phone. Optional energy certificate, street and agency leads. Search by place or URL, past the 10,000 cap, monitor mode. No login.",
    "version": "0.1",
    "x-build-id": "UpQnyn8R1u8X6Yghg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapersdelight~fotocasa-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapersdelight-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/scrapersdelight~fotocasa-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapersdelight-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/scrapersdelight~fotocasa-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapersdelight-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": "📍 Locations",
            "type": "array",
            "description": "Places as you would type them on Fotocasa: a region, province, city, district or neighbourhood, e.g. \"Madrid\", \"Barcelona\", \"Chamberí\", \"Marbella\". A Fotocasa URL slug works too (\"madrid-capital\", \"barcelona-capital/eixample\"). Each place is one search.",
            "items": {
              "type": "string"
            }
          },
          "locationType": {
            "title": "Location type",
            "enum": [
              "",
              "autonomousCommunity",
              "province",
              "region",
              "area",
              "municipality",
              "district",
              "neighborhood"
            ],
            "type": "string",
            "description": "Which match to use when a name fits several places (\"Madrid\" is a city, a province and a region). Empty takes Fotocasa's first suggestion; RUN_SUMMARY lists the others.",
            "default": ""
          },
          "startUrls": {
            "title": "🔗 Fotocasa search URLs",
            "type": "array",
            "description": "Search pages copied from fotocasa.es, with the filters you set there, e.g. \"https://www.fotocasa.es/es/alquiler/viviendas/barcelona-capital/todas-las-zonas/l?maxPrice=1500\". A URL's own operation, type and filters are used (the filter fields below apply to place names only).",
            "items": {
              "type": "string"
            }
          },
          "listingUrls": {
            "title": "🏠 Listing links or ids",
            "type": "array",
            "description": "Single listings to read in full, e.g. \"https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/.../189382740/d\" or \"189382740\". Each row carries the details block (energy certificate, street, agency reference).",
            "items": {
              "type": "string"
            }
          },
          "operation": {
            "title": "Operation",
            "enum": [
              "buy",
              "rent",
              "share",
              "rentBuyOption",
              "transfer"
            ],
            "type": "string",
            "description": "Buy, rent, room share, rent with option to buy, or business transfer (traspaso).",
            "default": "buy"
          },
          "propertyType": {
            "title": "Property type",
            "enum": [
              "home",
              "newHome",
              "premises",
              "garages",
              "office",
              "boxRoom",
              "land",
              "building"
            ],
            "type": "string",
            "description": "Homes, new-build homes (obra nueva), commercial premises, garages, offices, storage rooms, land or whole buildings.",
            "default": "home"
          },
          "propertySubtypes": {
            "title": "Home subtypes",
            "type": "array",
            "description": "Only these kinds of home, e.g. flats and attics. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "flat",
                "apartment",
                "house",
                "semiDetachedHouse",
                "terracedHouse",
                "attic",
                "duplex",
                "penthouseDuplex",
                "loft",
                "studio",
                "groundFloorWithGarden",
                "countryHouse"
              ],
              "enumTitles": [
                "Flat (piso)",
                "Apartment",
                "House / chalet",
                "Semi-detached house",
                "Terraced house (adosado)",
                "Attic (ático)",
                "Duplex",
                "Penthouse duplex",
                "Loft",
                "Studio",
                "Ground floor with garden",
                "Country house (finca rústica)"
              ]
            }
          },
          "minPrice": {
            "title": "Min price (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Lowest price in euros (monthly rent for rentals). 0 = no minimum."
          },
          "maxPrice": {
            "title": "Max price (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Highest price in euros (monthly rent for rentals). 0 = no maximum."
          },
          "minSize": {
            "title": "Min size (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Smallest surface in square metres. 0 = no minimum."
          },
          "maxSize": {
            "title": "Max size (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Largest surface in square metres. 0 = no maximum."
          },
          "minRooms": {
            "title": "Min bedrooms",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Fewest bedrooms. 0 = any."
          },
          "maxRooms": {
            "title": "Max bedrooms",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Most bedrooms. 0 = any."
          },
          "minBathrooms": {
            "title": "Min bathrooms",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Fewest bathrooms. 0 = any."
          },
          "maxBathrooms": {
            "title": "Max bathrooms",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Most bathrooms. 0 = any."
          },
          "publicationDate": {
            "title": "Published within",
            "enum": [
              "",
              "last24h",
              "last48h",
              "lastWeek",
              "lastMonth"
            ],
            "type": "string",
            "description": "Only listings Fotocasa published in this window.",
            "default": ""
          },
          "features": {
            "title": "Must have",
            "type": "array",
            "description": "Only listings with all of these, e.g. a lift and a terrace. Empty = no requirement.",
            "items": {
              "type": "string",
              "enum": [
                "airConditioning",
                "heating",
                "lift",
                "terrace",
                "balcony",
                "garden",
                "privatePool",
                "communityPool",
                "parking",
                "storageRoom",
                "furnished",
                "unfurnished",
                "builtInWardrobes",
                "equippedKitchen",
                "petsAllowed",
                "seaViews",
                "porterService",
                "alarm",
                "ensuiteBathroom"
              ],
              "enumTitles": [
                "Air conditioning",
                "Heating",
                "Lift",
                "Terrace",
                "Balcony",
                "Private garden",
                "Private pool",
                "Community pool",
                "Parking / garage",
                "Storage room",
                "Furnished",
                "Unfurnished",
                "Built-in wardrobes",
                "Equipped kitchen",
                "Pets allowed",
                "Sea views",
                "Porter service",
                "Alarm",
                "En-suite bathroom"
              ]
            }
          },
          "conditions": {
            "title": "Condition",
            "type": "array",
            "description": "Only these states of repair. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "almostNew",
                "veryGood",
                "good",
                "toRenovate",
                "refurbished"
              ],
              "enumTitles": [
                "Almost new",
                "Very good",
                "Good",
                "To renovate",
                "Refurbished"
              ]
            }
          },
          "priceDropOnly": {
            "title": "Price drops only",
            "type": "boolean",
            "description": "Only listings whose price was lowered (Fotocasa's \"bajada de precio\").",
            "default": false
          },
          "subsidizedOnly": {
            "title": "Subsidised only",
            "type": "boolean",
            "description": "Only listings eligible for housing aid (\"con ayudas\").",
            "default": false
          },
          "withVideoOrTourOnly": {
            "title": "With video or virtual tour",
            "type": "boolean",
            "description": "Only listings with a video or a virtual tour.",
            "default": false
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Fotocasa's own text search inside the ads, e.g. \"piscina\", \"ático\", \"vistas al mar\"."
          },
          "agencyIds": {
            "title": "Agency ids",
            "type": "array",
            "description": "Only listings of these agencies: the agencyId from a row, or a Fotocasa agency page URL ending in its id (e.g. \".../inmobiliarias/name-9202756368671\"). With no location, the agency's whole stock in Spain.",
            "items": {
              "type": "string"
            }
          },
          "rentalTypes": {
            "title": "Rental duration",
            "type": "array",
            "description": "Rentals only: long-term or temporary lets. Pick one to filter; empty or both = all. Read from Fotocasa's search pages (30 listings per page).",
            "items": {
              "type": "string",
              "enum": [
                "longTerm",
                "temporary"
              ],
              "enumTitles": [
                "Long-term rental",
                "Temporary rental"
              ]
            }
          },
          "occupancy": {
            "title": "Occupancy",
            "type": "array",
            "description": "Homes for sale by occupancy status: available, occupied, with a tenant, bare ownership, at auction. Empty = all. Read from Fotocasa's search pages (30 listings per page).",
            "items": {
              "type": "string",
              "enum": [
                "available",
                "occupied",
                "withTenant",
                "bareOwnership",
                "auction"
              ],
              "enumTitles": [
                "Available",
                "Occupied (ocupado)",
                "With tenant (con inquilino)",
                "Bare ownership (nuda propiedad)",
                "Auction (subasta)"
              ]
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "rating",
              "latest",
              "cheapest",
              "mostExpensive",
              "cheapestPerM2",
              "biggest",
              "smallest"
            ],
            "type": "string",
            "description": "The order Fotocasa returns listings in. \"Latest\" pairs well with Max items for fresh-listing runs.",
            "default": "rating"
          },
          "sellerType": {
            "title": "Seller type",
            "enum": [
              "all",
              "agency",
              "private"
            ],
            "type": "string",
            "description": "Agencies only, private sellers only, or both.",
            "default": "all"
          },
          "latitude": {
            "title": "Latitude",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Centre of a radius filter, e.g. 40.4168. Needs Longitude and Distance; applies to the listings of the locations above."
          },
          "longitude": {
            "title": "Longitude",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "Centre of a radius filter, e.g. -3.7038."
          },
          "distanceKm": {
            "title": "Distance (km)",
            "minimum": 0,
            "maximum": 200,
            "type": "number",
            "description": "Keep listings within this many kilometres of Latitude/Longitude (rows get a distanceKm field). 0 = off."
          },
          "includeDetails": {
            "title": "Listing details",
            "type": "boolean",
            "description": "Adds each listing's energy certificate (rating, kWh/m², CO₂), street and number, agency reference, legal agency name, website and email, construction type, plot size, heating and hot-water fuel, building age, orientation, occupancy, furnished and the full equipment list. One extra request per listing; charged per row that carries it.",
            "default": false
          },
          "includeAgencyLeads": {
            "title": "Agency leads",
            "type": "boolean",
            "description": "Also delivers one row per agency seen in the searches (type \"agency\"): name, phone, profile, logo, listings in the run, sale/rent split, price range, median €/m², municipalities. With Listing details on, also the legal name, website and email. Charged per agency row.",
            "default": false
          },
          "maxAgencyLeads": {
            "title": "Max agency rows",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Most agency rows to deliver, busiest agencies first.",
            "default": 100
          },
          "monitorMode": {
            "title": "Monitor mode (new and re-priced only)",
            "type": "boolean",
            "description": "Delivers only listings not delivered by an earlier run of the same search, or whose price changed since (changeType new / priceDrop / priceRise, previousSeenPrice, firstSeenAt). With Listing details on, a listing delivered earlier without them comes back once with changeType details. When every search is read to its end, listings that disappeared are listed in the OUTPUT record (removedListingIds), free.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional name for the memory, so two schedules with the same search keep separate memories. Empty = one memory per search."
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional: a URL that receives one JSON POST per run with the counts (new, price drops, removed ids) and the dataset id. Sent only when something was delivered or removed."
          },
          "maxItems": {
            "title": "Max listings",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Most listing rows to deliver in the run, across all searches. One Fotocasa query serves ~9,500 listings; bigger searches are split into price bands automatically.",
            "default": 100
          },
          "maxItemsPerSearch": {
            "title": "Max listings per search",
            "minimum": 0,
            "maximum": 200000,
            "type": "integer",
            "description": "Most rows per location / URL / agency. 0 = only Max listings applies.",
            "default": 0
          },
          "splitLargeSearches": {
            "title": "Read past the 10,000 cap",
            "type": "boolean",
            "description": "When a search holds more than ~9,500 listings and you ask for more, split it into price bands and read each completely.",
            "default": true
          },
          "compact": {
            "title": "Compact rows",
            "type": "boolean",
            "description": "Core fields only (no photo list, description, video/tour/plan links, location ids): smaller rows for spreadsheets and AI tools.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. By default the actor connects directly; only if Fotocasa refuses a connection does it move to Apify's datacenter proxy (where the account has one), then Spanish residential proxies, then the Apify Unblocker, each under a small per-run budget. Set your own proxy here to use it instead.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}