{
  "openapi": "3.0.1",
  "info": {
    "title": "Pisos.com Listings Scraper",
    "description": "Scrape public sale and rental listings from Pisos.com and Habitaclia and return one dataset with titles, prices, locations, sizes, rooms, bathrooms, photos and coordinates. Add optional detail-page data such as descriptions, agency details and property features.",
    "version": "0.1",
    "x-build-id": "ZgQTLbEgTWv7Y3M0M"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/axiomworks~pisos-habitaclia-property-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-axiomworks-pisos-habitaclia-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/axiomworks~pisos-habitaclia-property-scraper/runs": {
      "post": {
        "operationId": "runs-sync-axiomworks-pisos-habitaclia-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/axiomworks~pisos-habitaclia-property-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-axiomworks-pisos-habitaclia-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": {
          "startUrls": {
            "title": "Pisos or Habitaclia URL objects",
            "type": "array",
            "description": "Public search or listing URLs as objects, e.g. [{\"url\":\"https://www.pisos.com/venta/pisos-madrid/\"}]. Search pages paginate automatically. Takes precedence over location, operation, sources and propertyType. Supply startUrls or location. Blocked or empty targets return no rows; try another search URL or proxy configuration.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "location": {
            "title": "City name or slug",
            "type": "string",
            "description": "City name or slug, e.g. \"Madrid\" or \"barcelona\", used only when startUrls is empty. Builds URLs using operation, sources and propertyType. For Habitaclia, prefer a copied search URL with province and city in its path. Supply location or startUrls."
          },
          "operation": {
            "title": "Sale or rent for location search",
            "enum": [
              "sale",
              "rent"
            ],
            "type": "string",
            "description": "Operation for location searches: \"sale\" (default) or \"rent\", e.g. \"rent\" with location \"barcelona\". Ignored when startUrls is supplied; URL paths determine the operation.",
            "default": "sale"
          },
          "sources": {
            "title": "Portals for location search",
            "type": "array",
            "description": "Portal names for location searches, e.g. [\"pisos\"] or [\"pisos\",\"habitaclia\"] (default). Ignored when startUrls is supplied. Habitaclia location paths vary; use a copied search URL when the generated path returns no listings.",
            "items": {
              "type": "string",
              "enum": [
                "pisos",
                "habitaclia"
              ]
            },
            "default": [
              "pisos",
              "habitaclia"
            ]
          },
          "propertyType": {
            "title": "Property type for location search",
            "enum": [
              "all",
              "flats",
              "houses"
            ],
            "type": "string",
            "description": "Property category for location searches: \"all\" (default), \"flats\" or \"houses\", e.g. \"houses\" with location \"madrid\". Ignored when startUrls is supplied. Pisos uses its pisos path for both all and flats; houses uses casas.",
            "default": "all"
          },
          "minPrice": {
            "title": "Minimum asking price in euros",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum asking price in euros, e.g. 100000; non-negative integer, omitted means no lower limit. Rentals use monthly asking prices. Applied after extraction; rows with missing prices are excluded when set. Combine with maxPrice for a range."
          },
          "maxPrice": {
            "title": "Maximum asking price in euros",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum asking price in euros, e.g. 350000; non-negative integer, omitted means no upper limit. Rentals use monthly asking prices. Applied after extraction; rows with missing prices are excluded when set. If no rows match, widen the price range."
          },
          "minSizeM2": {
            "title": "Minimum area in square metres",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum listed area in square metres, e.g. 60; non-negative integer, omitted means no size filter. Applied after extraction; rows with missing area are excluded when set. Lower this value if no listings match."
          },
          "minRooms": {
            "title": "Minimum bedroom count",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum listed bedroom count, e.g. 2; non-negative integer, omitted means no bedroom filter. Applied after extraction; rows with missing rooms are excluded when set. Lower this value if no listings match."
          },
          "maxItems": {
            "title": "Shared maximum listing count",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum saved listings across all targets combined, 1-10000, default 50; e.g. 7 saves at most 7 rows. Only matching, unique listings count. Stops at the limit when enough listings exist; fewer rows are possible for empty, filtered or blocked searches. Prefill requests 20 Madrid sale listings.",
            "default": 50
          },
          "scrapeDetails": {
            "title": "Fetch optional listing details",
            "type": "boolean",
            "description": "Whether to fetch each listing page, e.g. true; default false reads search cards only. True adds one request per listing for available agency, description, features and photos. Fields depend on portal and listing; missing values stay null. Failed detail requests keep the search-card record.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Apify Proxy settings",
            "type": "object",
            "description": "Proxy settings, e.g. {\"useApifyProxy\":true} (default, datacenter). Retries blocked requests on fresh sessions. If requests remain blocked, try residential settings {\"useApifyProxy\":true,\"apifyProxyGroups\":[\"RESIDENTIAL\"]}. Empty targets save no rows; CAPTCHA challenges are not solved.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}