{
  "openapi": "3.0.1",
  "info": {
    "title": "Fotocasa Scraper: Spain Property Listings, Prices, Agents",
    "description": "Scrape Fotocasa and Habitaclia property listings in Spain by place or search link: price, price per m2, size, rooms, bathrooms, address, coordinates, photos, agency name and phone, published date. Buy, rent, share. No login.",
    "version": "0.1",
    "x-build-id": "kwgSRLlk7sZpWTgfd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/themineworks~fotocasa-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-themineworks-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/themineworks~fotocasa-scraper/runs": {
      "post": {
        "operationId": "runs-sync-themineworks-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/themineworks~fotocasa-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-themineworks-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": "Places",
            "type": "array",
            "description": "Towns, cities, districts or provinces in Spain, one per line, as you would type them in the site's search box. Example: Madrid, Sevilla, Chamberi, Marbella. Each place is one search. Up to 100 searches per run.",
            "items": {
              "type": "string"
            }
          },
          "site": {
            "title": "Site",
            "enum": [
              "fotocasa",
              "habitaclia"
            ],
            "type": "string",
            "description": "Which portal the place names are searched on. Fotocasa covers all of Spain. Habitaclia is strongest in Catalonia and adds the agency email and the energy certificate. Pasted links are always read on their own site.",
            "default": "fotocasa"
          },
          "operation": {
            "title": "Buy or rent",
            "enum": [
              "buy",
              "rent",
              "share",
              "transfer"
            ],
            "type": "string",
            "description": "For sale, for rent, rooms to share or business transfers (traspasos, Fotocasa only).",
            "default": "buy"
          },
          "propertyType": {
            "title": "Property type",
            "enum": [
              "homes",
              "garages",
              "land",
              "premises",
              "offices",
              "storage",
              "buildings",
              "industrial"
            ],
            "type": "string",
            "description": "Homes covers flats, houses, penthouses, duplexes and studios. Premises and storage rooms are on Fotocasa only; industrial units on Habitaclia only.",
            "default": "homes"
          },
          "startUrls": {
            "title": "Search URLs (optional)",
            "type": "array",
            "description": "Fotocasa or Habitaclia search results links copied from your browser, with any filters you set on the site, for example https://www.fotocasa.es/es/alquiler/viviendas/barcelona-capital/todas-las-zonas/l or https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/s. The link's own location and filters are used.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max listings per search",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The most listings to return for each place or link, 1 to 10,000. A Fotocasa page holds 30 listings, a Habitaclia page 20.",
            "default": 100
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "newest",
              "cheapest",
              "most_expensive",
              "largest",
              "smallest"
            ],
            "type": "string",
            "description": "Order of the results. Largest and smallest work on Fotocasa only.",
            "default": "relevance"
          },
          "minPrice": {
            "title": "Min price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Lowest price in euros; monthly rent for rentals. Leave empty for no minimum."
          },
          "maxPrice": {
            "title": "Max price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Highest price in euros; monthly rent for rentals. Leave empty for no maximum."
          },
          "minSize": {
            "title": "Min size (m2)",
            "minimum": 0,
            "type": "integer",
            "description": "Smallest built area in square metres."
          },
          "maxSize": {
            "title": "Max size (m2)",
            "minimum": 0,
            "type": "integer",
            "description": "Largest built area in square metres."
          },
          "minRooms": {
            "title": "Min bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Fewest bedrooms, for example 2."
          },
          "minBathrooms": {
            "title": "Min bathrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Fewest bathrooms, for example 2."
          },
          "publishedWithinDays": {
            "title": "Only listings published in the last N days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "For new listing alerts: sorts by newest and stops at the first page older than this many days. Example: 1 for a daily run. Leave empty for all listings."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify datacenter proxy is the default and works for both sites. Change it only if you have a reason.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}