{
  "openapi": "3.0.1",
  "info": {
    "title": "Fotocasa Scraper - Spain Property Listings",
    "description": "Fotocasa scraper for Spain. Type a town or paste a search URL, for sale or rent, and get one row per listing: price, price per m², surface, rooms, bathrooms, floor, neighbourhood, coordinates, advertiser, features and photos. Search near a point too. $0.65 per 1,000 listings.",
    "version": "0.1",
    "x-build-id": "Td70a02FMdDcwfJ2l"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dami_studio~fotocasa-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dami_studio-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/dami_studio~fotocasa-scraper/runs": {
      "post": {
        "operationId": "runs-sync-dami_studio-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/dami_studio~fotocasa-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-dami_studio-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": {
          "location": {
            "title": "Place",
            "type": "string",
            "description": "Type a town, district or neighbourhood the way it appears in Fotocasa's own search box: \"Madrid\", \"Valencia\", \"Barrio de Salamanca\", \"Marbella\". The \"-capital\" in their URLs is part of the address, not the name. The Actor looks it up and takes the match with the most live listings, so a bare province name gets you the province; use Area size below to pin it to a town. Leave empty if you are pasting search URLs."
          },
          "transactionType": {
            "title": "Buy or rent",
            "enum": [
              "sale",
              "rent",
              "share",
              "rent-to-own",
              "transfer"
            ],
            "type": "string",
            "description": "Which market to read. Rooms to share and rent-to-own exist for homes only, and business transfers (traspasos) for commercial premises only; any other pairing stops the run before it searches. Only used with the Place field above; a pasted URL already says which one it is."
          },
          "propertyType": {
            "title": "Property type",
            "enum": [
              "homes",
              "garages",
              "offices",
              "premises",
              "land",
              "rural-houses",
              "buildings",
              "storage-rooms"
            ],
            "type": "string",
            "description": "Only used with the Place field above."
          },
          "locationLevel": {
            "title": "Area size",
            "enum": [
              "auto",
              "MUNICIPALITY",
              "PROVINCE",
              "REGION",
              "DISTRICT",
              "NEIGHBORHOOD"
            ],
            "type": "string",
            "description": "Which size of area the place name should resolve to. Automatic takes whichever match has the most live listings, which for a province name means the whole province. Only used with the Place field above."
          },
          "maxItems": {
            "title": "Maximum listings",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Hard cap on how many listings the run delivers, across every search. You are charged per listing delivered, so this is also your spending cap."
          },
          "startUrls": {
            "title": "Fotocasa search URLs",
            "type": "array",
            "description": "Paste search pages straight from fotocasa.es, for example https://www.fotocasa.es/es/comprar/viviendas/barcelona-capital/todas-las-zonas/l, whatever filters you set on the site come with the URL. The Actor pages through each one until it runs out of results or hits your maximum. One URL per line.",
            "items": {
              "type": "string"
            }
          },
          "sortType": {
            "title": "Order",
            "enum": [
              "publicationDate",
              "price",
              "pricem2",
              "surface",
              "scoring"
            ],
            "type": "string",
            "description": "Newest first is the default because Fotocasa's own relevance order shuffles between requests, which makes deep paging return the same listing twice. Only used with the Place field above."
          },
          "advertiser": {
            "title": "Advertiser",
            "enum": [
              "any",
              "agency",
              "private"
            ],
            "type": "string",
            "description": "Keep only listings from estate agencies, or only from private sellers. Fotocasa has no server-side filter for this, so the Actor reads the page and drops the rest, you are not charged for anything it drops."
          },
          "publicationDate": {
            "title": "Published within",
            "enum": [
              "any",
              "lastDay",
              "last48Hours",
              "lastWeek",
              "lastMonth"
            ],
            "type": "string",
            "description": "Only listings Fotocasa published in this period. Fotocasa applies it before anything is charged. Only used with the Place field above: for a pasted URL, set the date on the site before you copy it, because a run that has both stops before searching.",
            "default": "any"
          },
          "minPrice": {
            "title": "Minimum price",
            "minimum": 0,
            "type": "integer",
            "description": "In euros. For rentals this is the monthly rent."
          },
          "maxPrice": {
            "title": "Maximum price",
            "minimum": 0,
            "type": "integer",
            "description": "In euros. For rentals this is the monthly rent."
          },
          "minSurface": {
            "title": "Minimum surface (m2)",
            "minimum": 0,
            "type": "integer",
            "description": "Built surface in square metres, as Fotocasa reports it. Applied by Fotocasa before anything is charged."
          },
          "maxSurface": {
            "title": "Maximum surface (m2)",
            "minimum": 0,
            "type": "integer",
            "description": "Built surface in square metres. Leave empty for no upper limit."
          },
          "minRooms": {
            "title": "Minimum rooms",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Bedrooms, not total rooms. Fotocasa caps this filter at 10."
          },
          "maxRooms": {
            "title": "Maximum rooms",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Bedrooms, not total rooms. Leave empty for no upper limit."
          },
          "minBathrooms": {
            "title": "Minimum bathrooms",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Bathrooms. Fotocasa caps this filter at 10."
          },
          "maxBathrooms": {
            "title": "Maximum bathrooms",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Bathrooms. Leave empty for no upper limit."
          },
          "latitude": {
            "title": "Near a point: latitude",
            "type": "string",
            "description": "Only listings within \"Radius\" of this point, measured from each listing's own map position. Fill in latitude, longitude and radius together, for example 39.4699 and -0.3763 for the middle of Valencia. Fotocasa ignores distance, so the run reads the place's listings and leaves out the ones farther away, uncharged. Keep the place small, the town or district your point is in: a small circle in a big place can come back with fewer rows than you asked for."
          },
          "longitude": {
            "title": "Near a point: longitude",
            "type": "string",
            "description": "Used together with latitude and radius. West of Greenwich is negative, so most of Spain is: -3.7038 for Madrid, -0.3763 for Valencia."
          },
          "radiusKm": {
            "title": "Radius",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "In km, from 1 to 50. Used together with latitude and longitude."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Leave this alone unless you need the run to go out through a particular network. Your own proxy servers are used exactly as given."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}