{
  "openapi": "3.0.1",
  "info": {
    "title": "Fotocasa Scraper - Spain Property Listings & Price Drops",
    "description": "Scrape Fotocasa.es sale and rent listings in Spain: price, price per m², surface, rooms, floor, zone, agency, photos and price cuts. Search by URL or city with filters. Schedule it daily: only new listings and price drops. Error rows are free.",
    "version": "0.1",
    "x-build-id": "pqSfPcD4Ed8MGQ6rO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapewise~fotocasa-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapewise-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/scrapewise~fotocasa-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapewise-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/scrapewise~fotocasa-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapewise-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": {
          "startUrls": {
            "title": "Fotocasa URLs",
            "type": "array",
            "description": "Fotocasa search links copied from your browser after setting the filters on the site, one per line, for example https://www.fotocasa.es/es/alquiler/viviendas/barcelona-capital/todas-las-zonas/l?maxPrice=2000. Every filter in the link is kept. Listing links (ending in /<id>/d) also work and come back with the full listing page. Leave empty to search by location below. Each listing is charged once as 'Listing delivered'.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "Spanish cities, towns or provinces, one per line, for example Madrid, Barcelona, Valencia or Marbella. A city name searches the city itself; add 'provincia' for the whole province (Barcelona provincia) or use Spain for the whole country. Each location is a separate search with the filters below, and each row says which search found it. Ignored for the links above.",
            "items": {
              "type": "string"
            }
          },
          "contract": {
            "title": "Contract",
            "enum": [
              "sale",
              "rent",
              "roomShare"
            ],
            "type": "string",
            "description": "Operation to search: For sale (default), For rent, or Room in a shared flat (rooms only, homes only). Applies to the location searches.",
            "default": "sale"
          },
          "propertyType": {
            "title": "Property type",
            "enum": [
              "homes",
              "garage",
              "land",
              "commercial",
              "office",
              "storage",
              "building"
            ],
            "type": "string",
            "description": "Kind of property: Homes (default; flats, houses, penthouses, duplexes and every other residential type), Garage or parking, Land, Commercial premises, Office, Storage room, or Whole building.",
            "default": "homes"
          },
          "minPrice": {
            "title": "Minimum price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Only listings at or above this price in euros, as a whole number (monthly rent for rentals), for example 150000 or 800. Empty = no minimum."
          },
          "maxPrice": {
            "title": "Maximum price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Only listings at or below this price in euros, as a whole number (monthly rent for rentals), for example 400000 or 2000. Empty = no maximum."
          },
          "minSurface": {
            "title": "Minimum surface (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Only listings with at least this many square metres, for example 60. Empty = no minimum."
          },
          "maxSurface": {
            "title": "Maximum surface (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Only listings with at most this many square metres, for example 120. Empty = no maximum."
          },
          "minRooms": {
            "title": "Minimum bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Only listings with at least this many bedrooms, for example 2. Empty = any."
          },
          "maxRooms": {
            "title": "Maximum bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Only listings with at most this many bedrooms, for example 4. Empty = any."
          },
          "minBathrooms": {
            "title": "Minimum bathrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Only listings with at least this many bathrooms, for example 2. Empty = any."
          },
          "sellerType": {
            "title": "Advertiser",
            "enum": [
              "any",
              "agency",
              "private"
            ],
            "type": "string",
            "description": "Any (default), Agencies only, or Private owners only. Fotocasa has no such filter in its search, so the Actor filters the pages it reads; skipped listings are not charged.",
            "default": "any"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "newest",
              "relevance",
              "priceLowToHigh",
              "priceHighToLow"
            ],
            "type": "string",
            "description": "Fotocasa's own orders: Newest first (default, the right choice for daily monitoring), Relevance, Price low to high, or Price high to low. With a limit it also decides which listings you get, for example Price low to high plus 50 returns the 50 cheapest.",
            "default": "newest"
          },
          "maxItems": {
            "title": "Max listings per search",
            "minimum": 0,
            "type": "integer",
            "description": "Stop each search (each link or each location) after this many listings, for example 50 (default). Fotocasa shows 30 per page. 0 = up to 10,000. You pay per listing delivered, so this caps the cost of each search.",
            "default": 50
          },
          "includeDetails": {
            "title": "Full listing pages",
            "type": "boolean",
            "description": "Off (default): rows come from the search results (price, size, rooms, address, photos, agency). On: also opens each listing's own page and adds the energy certificate (rating and kWh/m² per year), emissions, typology, orientation, parking, lift, furnished, occupancy status, new build or second hand, agency website, reference code and creation date. One extra request per listing, charged as a separate 'Full listing page' event.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new listings since the last run",
            "type": "boolean",
            "description": "For scheduled runs. Remembers which listings each search (with its filters) already returned, in a named key-value store in your account ('fotocasa-scraper-state'), and delivers only listings not seen before. The first run delivers up to the limit and marks everything it read as seen. Seen listings are not delivered and not charged. Forces the newest-first order. Delete the store to start over.",
            "default": false
          },
          "trackPriceChanges": {
            "title": "Track price changes",
            "type": "boolean",
            "description": "Compares each listing's price with the price seen in your previous runs of the same search (same key-value store) and adds previousPrice, priceChange, priceChangePct, isPriceDrop, isNewListing and firstSeenAt to every row. Together with 'Only new listings' you get new listings plus listings whose price changed. The limit then counts listings checked, so a daily run keeps the same cost.",
            "default": false
          },
          "onlyPriceDrops": {
            "title": "Only price drops (not increases)",
            "type": "boolean",
            "description": "With 'Only new listings' and 'Track price changes' both on: of the listings seen before, deliver only those whose price went down. Price increases are skipped and not charged.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "The default Apify Proxy (datacenter) works. If it keeps being blocked, the Actor moves to the residential group on its own when your account has it, with no extra charge.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}