{
  "openapi": "3.0.1",
  "info": {
    "title": "Fotocasa Scraper - Spain Property Listings & Prices",
    "description": "Scrape fotocasa.es property listings across Spain: asking price, m2, rooms, GPS, zip code, photos, full description and the listing agency's phone number.",
    "version": "1.0",
    "x-build-id": "LwKl0Piu8PSNZxyKN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~fotocasa-property-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-fotocasa-property-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/sian.agency~fotocasa-property-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-fotocasa-property-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/sian.agency~fotocasa-property-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-fotocasa-property-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": {
          "operation": {
            "title": "🎯 What do you want to scrape?",
            "enum": [
              "search",
              "agency"
            ],
            "type": "string",
            "description": "Pick one per run. Property Search takes Spanish place names (or fotocasa search URLs) and returns listing rows; Agency Listings takes fotocasa agency page URLs and returns everything that agency currently has on the market.",
            "default": "search"
          },
          "location": {
            "title": "📍 Place in Spain",
            "type": "string",
            "description": "A Spanish place name — city, province, region, district or neighbourhood. Madrid, Barcelona, Valencia, Marbella, Palma de Mallorca, Barrio de Salamanca. A fotocasa search URL works too and its own location is read off it. The name is matched against fotocasa's own place index and the run log prints exactly which place was matched.",
            "default": "Madrid"
          },
          "locations": {
            "title": "🗺️ More places",
            "type": "array",
            "description": "Extra places to search in the same run. Each one runs its own search, but Max listings caps the run as a whole, so raise it when you add places or the first place spends the whole budget. This is also how you get past fotocasa's 505-page ceiling on any single query: split a huge city into its districts.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "agencyUrls": {
            "title": "🏢 Agency page URLs",
            "type": "array",
            "description": "Used by the Agency Listings operation: fotocasa agency pages, e.g. https://www.fotocasa.es/inmobiliarias/espigul-immobiliaria-9202775531783. The numeric id at the end of the URL is the agency, so a bare id works too. Set 'Sale or rent' to 'Every market' to pull the agency's entire portfolio in one run.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "transactionType": {
            "title": "🤝 Sale or rent",
            "enum": [
              "sale",
              "rent",
              "share",
              "transfer",
              "rent-to-own",
              "all"
            ],
            "type": "string",
            "description": "Which market to search. Room share covers ads for a single room in a shared flat — a large, separately-priced market fotocasa carries and most listing exports ignore. 'Every market' returns all of them at once, which is what you want on Agency Listings to see an agency's whole portfolio rather than just its sales.",
            "default": "sale"
          },
          "propertyType": {
            "title": "🏘️ Property type",
            "enum": [
              "all",
              "homes",
              "garages",
              "land",
              "commercial",
              "offices",
              "storage",
              "buildings"
            ],
            "type": "string",
            "description": "Narrow to one kind of property. 'Everything' returns all of them — verified: the seven types sum exactly to the unfiltered total.",
            "default": "all"
          },
          "newConstruction": {
            "title": "🏗️ New builds only",
            "type": "boolean",
            "description": "Restrict to new-construction stock. Off returns both new and resale.",
            "default": false
          },
          "minPrice": {
            "title": "💵 Min price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Lowest asking price to include. For rentals this is the monthly rent. 0 means no lower bound.",
            "default": 0
          },
          "maxPrice": {
            "title": "💰 Max price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Highest asking price to include. For rentals this is the monthly rent. 0 means no upper bound.",
            "default": 0
          },
          "minRooms": {
            "title": "🛏️ Min bedrooms",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Fewest bedrooms to accept. 0 means no minimum.",
            "default": 0
          },
          "minBathrooms": {
            "title": "🛁 Min bathrooms",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Fewest bathrooms to accept. 0 means no minimum.",
            "default": 0
          },
          "minSurface": {
            "title": "📐 Min size (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Smallest built area in square metres. 0 means no minimum.",
            "default": 0
          },
          "maxSurface": {
            "title": "📏 Max size (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Largest built area in square metres. 0 means no maximum.",
            "default": 0
          },
          "sortBy": {
            "title": "↕️ Sort by",
            "enum": [
              "relevance",
              "newest",
              "price-low",
              "price-high"
            ],
            "type": "string",
            "description": "Newest first is what you want when running this on a schedule — the new stock lands on page 1.",
            "default": "relevance"
          },
          "maxResults": {
            "title": "🔢 Max listings",
            "minimum": 1,
            "maximum": 15000,
            "type": "integer",
            "description": "Stop after this many listings across every place searched. Each call returns 30 rows, so the run stops at the first call that crosses your limit. Fotocasa serves at most 505 pages (~15,150 rows) per query.",
            "default": 90
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}