{
  "openapi": "3.0.1",
  "info": {
    "title": "Fotocasa Scraper",
    "description": "Scrape Fotocasa.es property listings for sale and rent (flats, houses, rooms, garages, offices, plots, new builds) from any search, ad, agency or new-build URL: prices and price drops, m², bedrooms, full address and map pin, description, photos, agency name and phone.",
    "version": "0.1",
    "x-build-id": "zYTmBnUJu1WKLcIrF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ribtools~fotocasa-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ribtools-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/ribtools~fotocasa-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ribtools-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/ribtools~fotocasa-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ribtools-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": {
          "province": {
            "title": "Province (provincia)",
            "enum": [
              "a-coruna",
              "albacete",
              "alicante",
              "almeria",
              "araba-alava",
              "asturias",
              "avila",
              "badajoz",
              "barcelona",
              "bizkaia",
              "burgos",
              "caceres",
              "cadiz",
              "cantabria",
              "castellon",
              "ceuta",
              "ciudad-real",
              "cordoba",
              "cuenca",
              "gipuzkoa",
              "girona",
              "granada",
              "guadalajara",
              "huelva",
              "huesca",
              "illes-balears",
              "jaen",
              "la-rioja",
              "las-palmas",
              "leon",
              "lleida",
              "lugo",
              "madrid",
              "malaga",
              "melilla",
              "murcia",
              "navarra",
              "ourense",
              "palencia",
              "pontevedra",
              "salamanca",
              "santa-cruz-de-tenerife",
              "segovia",
              "sevilla",
              "soria",
              "tarragona",
              "teruel",
              "toledo",
              "valencia",
              "valladolid",
              "zamora",
              "zaragoza"
            ],
            "type": "string",
            "description": "One of Spain's 52 provinces: `Madrid`, `Barcelona`, `Málaga`. Alone it searches the whole province; with a city below it only tells apart cities that share a name (Arroyomolinos is in Madrid and in Cáceres)."
          },
          "city": {
            "title": "City (municipio)",
            "type": "string",
            "description": "The municipality, as Fotocasa names it: `Madrid`, `Barcelona`, `Getafe`. Looked up in Fotocasa's own search box: a name that matches several cities is refused with the candidates (add the province), never guessed."
          },
          "district": {
            "title": "District (distrito)",
            "type": "string",
            "description": "A district of the city above: `Chamberí`, `Salamanca`, `Eixample`. Leave empty to search the whole city. Without a city, a district name found in several cities (`Centro`) is refused with the candidates."
          },
          "neighborhood": {
            "title": "Neighborhood (barrio)",
            "type": "string",
            "description": "A neighborhood of the city above, inside the district when that is filled: `Trafalgar` (in Chamberí, Madrid), `Gràcia`. Fotocasa keeps districts and neighborhoods apart: a name in the wrong field is refused and the reason says which field it belongs in."
          },
          "street": {
            "title": "Street (calle)",
            "type": "string",
            "description": "A street of the city above, as Fotocasa names it: `Calle de Alcalá`, `Gran Vía`. Searched as Fotocasa's street area; needs the city and no district or neighborhood."
          },
          "startUrls": {
            "title": "Fotocasa URLs",
            "type": "array",
            "description": "Pages copied from fotocasa.es: a search (`https://www.fotocasa.es/es/alquiler/viviendas/madrid-capital/chamberi/l`, any filters, tags, `/area/` streets, map view, new-build `/promociones-obra-nueva/` and private-owner `/pl` pages), an ad (`…/<id>/d`), a new-build promotion (`/comprar/obra-nueva/…/<id>`) or an agency (`/es/pro/<slug>/`). A URL keeps its own filters.",
            "items": {
              "type": "string"
            }
          },
          "maxRequests": {
            "title": "Max results per search",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of properties for the place search and for each URL above (default 10); each property is a charged event. Fotocasa lists at most 9,990 per search: narrow a bigger one.",
            "default": 10
          },
          "transaction": {
            "title": "Operation",
            "enum": [
              "sale",
              "rent",
              "share",
              "rent_to_own",
              "transfer"
            ],
            "type": "string",
            "description": "Buy (comprar), rent (alquiler), rooms to share (compartir), rent to own (alquiler con opción a compra) or a business transfer (traspaso). Rooms to share and rent to own list homes only; transfers list commercial premises only.",
            "default": "sale"
          },
          "propertyType": {
            "title": "Property type",
            "enum": [
              "homes",
              "new_developments",
              "garages",
              "commercial",
              "offices",
              "storage_rooms",
              "land",
              "buildings",
              "all"
            ],
            "type": "string",
            "description": "One type per search, as Fotocasa searches them: homes (viviendas), new developments (obra nueva promotions, one item per development), garages, commercial premises (locales), offices, storage rooms (trasteros), land (terrenos), buildings or all of them (inmuebles).",
            "default": "homes"
          },
          "homeTypes": {
            "title": "Home types",
            "uniqueItems": true,
            "type": "array",
            "description": "Only these kinds of home; empty means every home. For the property type Homes only.",
            "items": {
              "type": "string",
              "enum": [
                "flat",
                "apartment",
                "house",
                "semi_detached",
                "penthouse",
                "duplex",
                "loft",
                "country_house",
                "ground_floor",
                "studio"
              ],
              "enumTitles": [
                "Flat (piso)",
                "Apartment (apartamento)",
                "House or chalet (casa o chalet)",
                "Semi-detached house (adosado)",
                "Penthouse (ático)",
                "Duplex (dúplex)",
                "Loft",
                "Country house (casa rural)",
                "Ground floor (bajo)",
                "Studio (estudio)"
              ]
            }
          },
          "priceFrom": {
            "title": "Price from (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Lowest price to include, in euros: the monthly rent for rentals."
          },
          "priceTo": {
            "title": "Price to (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Highest price to include, in euros: the monthly rent for rentals."
          },
          "bedroomsFrom": {
            "title": "Bedrooms from",
            "minimum": 0,
            "maximum": 4,
            "type": "integer",
            "description": "Fewest bedrooms (habitaciones) to include, 0 to 4; 4 means 4 or more."
          },
          "bedroomsTo": {
            "title": "Bedrooms to",
            "minimum": 0,
            "maximum": 4,
            "type": "integer",
            "description": "Most bedrooms to include, 0 to 4; 4 means 4 or more."
          },
          "bathroomsFrom": {
            "title": "Bathrooms from",
            "minimum": 0,
            "type": "integer",
            "description": "Fewest bathrooms to include."
          },
          "bathroomsTo": {
            "title": "Bathrooms to",
            "minimum": 0,
            "type": "integer",
            "description": "Most bathrooms to include."
          },
          "areaFrom": {
            "title": "Area from (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Smallest area to include, in square meters."
          },
          "areaTo": {
            "title": "Area to (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Largest area to include, in square meters."
          },
          "newBuild": {
            "title": "New build only (obra nueva)",
            "type": "boolean",
            "description": "Only newly built properties, as Fotocasa marks them.",
            "default": false
          },
          "publishedWithin": {
            "title": "Published within",
            "enum": [
              "any",
              "day",
              "two_days",
              "week",
              "month"
            ],
            "type": "string",
            "description": "Only ads published in the last day, two days, week or month: with Newest first, what a daily or weekly monitoring run needs.",
            "default": "any"
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "default",
              "newest"
            ],
            "type": "string",
            "description": "Order of the place search. A pasted URL keeps its own order.",
            "default": "default"
          },
          "sellerDataAddon": {
            "title": "Seller data add-on",
            "type": "boolean",
            "description": "The agency's or developer's trading name, office phone, Fotocasa profile and logo, read from the same page (no extra request). Never a private owner's: their ads ship without a seller. Charged per item with seller data.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}