{
  "openapi": "3.0.1",
  "info": {
    "title": "Casa.it Scraper (Phase-0 probe)",
    "description": "Scrape casa.it listings across Italy: asking price, price per square metre, size, rooms, energy class, condominium fees, year built, agency phone, GPS, judicial auction dates and walking distances to transport and schools.",
    "version": "1.0",
    "x-build-id": "2pca3Ga1gZgdRHKeU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~casa-property-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-casa-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~casa-property-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-casa-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~casa-property-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-casa-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",
              "detail",
              "agency"
            ],
            "type": "string",
            "description": "Pick one per run. Property Search takes an Italian place name (or a casa.it search URL) plus filters and returns every matching listing. Listing Detail takes casa.it listing URLs or IDs and returns the full attribute table for each: condominium fees, year built, heating, the energy certificate's numbers, judicial auction date and reserve, floor plans, and walking distances to transport, schools and shops. Agency Listings takes casa.it agency pages and returns that agency's whole portfolio.",
            "default": "search"
          },
          "location": {
            "title": "📍 Place in Italy",
            "type": "string",
            "description": "An Italian place - a city (Roma, Milano, Napoli, Torino, Firenze), a province (Roma provincia), a district or a neighbourhood. Accents and spaces are handled, so 'Reggio Calabria' and 'Forlì' both work. A casa.it search URL works too and everything in it - market, property type, filters, sort - is read off the URL and used as-is. The run log prints the exact casa.it page each search resolved to, so you can always check what was searched.",
            "default": "Milano"
          },
          "locations": {
            "title": "🗺️ More places",
            "type": "array",
            "description": "Extra places to search in the same run, each with the same filters. Three places return roughly three times the rows. This is also how you get past casa.it's 80-page ceiling on a single query: split a big city into its districts, or a region into its provinces.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "transactionType": {
            "title": "🤝 Sale or rent",
            "enum": [
              "vendita",
              "affitto"
            ],
            "type": "string",
            "description": "Which market to search. Rooms in shared flats and holiday lets exist only on the rent side - pick 'To rent' before choosing those property types.",
            "default": "vendita"
          },
          "propertyType": {
            "title": "🏠 Property type",
            "enum": [
              "residenziale",
              "appartamenti",
              "ville",
              "case-indipendenti",
              "attici-mansarde",
              "villette-a-schiera",
              "case-bifamiliari-trifamiliari",
              "rustici-casali",
              "loft",
              "stanze",
              "vacanza",
              "commerciale",
              "uffici",
              "locali",
              "capannoni",
              "terreni",
              "box-posti-auto",
              "edifici-palazzi"
            ],
            "type": "string",
            "description": "Which slice of casa.it's inventory to search. 'All homes' is the broadest residential search and is the right default. Rooms in shared flats and holiday lets are rent-only markets; picking either with 'For sale' returns nothing and the run log says so rather than failing silently.",
            "default": "residenziale"
          },
          "listingFilter": {
            "title": "🎯 Special filter",
            "enum": [
              "none",
              "da-asta-immobiliare",
              "con-da-privati",
              "in-nuove-costruzioni",
              "da-ristrutturare",
              "con-giardino",
              "con-giardino-privato",
              "con-terrazzo",
              "con-balcone",
              "con-ascensore",
              "con-piscina",
              "con-box-posto-auto",
              "con-riscaldamento-autonomo",
              "con-riscaldamento-centralizzato",
              "con-nuda-proprieta"
            ],
            "type": "string",
            "description": "One of casa.it's own saved filters. Judicial auctions is the one worth knowing about: it returns court-ordered sales only - 2,809 of them in Rome and 1,040 in Milan when this was measured - and those rows carry an auction date and a reserve price that ordinary listings do not. Private sellers only removes every agency listing, which is what you want when the point is to reach the owner. Each of these was verified by checking the rows that came back, not by trusting the site to echo the filter.",
            "default": "none"
          },
          "priceMin": {
            "title": "💶 Minimum price (EUR)",
            "type": "integer",
            "description": "Lowest asking price to include, in euros. 0 means no minimum. On the rent side this is a monthly rent, not a purchase price.",
            "default": 0
          },
          "priceMax": {
            "title": "💶 Maximum price (EUR)",
            "type": "integer",
            "description": "Highest asking price to include, in euros. 0 means no maximum.",
            "default": 0
          },
          "sizeMinSqm": {
            "title": "📏 Minimum size (m²)",
            "type": "integer",
            "description": "Smallest floor area to include, in square metres. 0 means no minimum.",
            "default": 0
          },
          "sizeMaxSqm": {
            "title": "📐 Maximum size (m²)",
            "type": "integer",
            "description": "Largest floor area to include, in square metres. 0 means no maximum.",
            "default": 0
          },
          "roomsMin": {
            "title": "🚪 Minimum rooms",
            "type": "integer",
            "description": "Fewest rooms to include. Italian listings count 'locali' - habitable rooms including the living room, excluding kitchen and bathrooms - so a two-bedroom flat is normally 3 locali. 0 means no minimum.",
            "default": 0
          },
          "bathroomsMin": {
            "title": "🛁 Minimum bathrooms",
            "type": "integer",
            "description": "Fewest bathrooms to include. 0 means no minimum.",
            "default": 0
          },
          "energyClass": {
            "title": "⚡ Energy class",
            "enum": [
              "any",
              "A4",
              "A3",
              "A2",
              "A1",
              "A",
              "B",
              "C",
              "D",
              "E",
              "F",
              "G"
            ],
            "type": "string",
            "description": "Filter by the property's energy performance certificate class. Italian listings are legally required to state one, so this is well populated on the detail page - though only about a fifth of search rows carry the letter, which is one reason to run Listing Detail on the results.",
            "default": "any"
          },
          "sortBy": {
            "title": "↕️ Sort results by",
            "enum": [
              "relevance",
              "price_asc",
              "price_desc",
              "surface_desc",
              "date_desc"
            ],
            "type": "string",
            "description": "Casa.it caps any single query at 80 pages, so on a query with more matches than that the sort decides which slice you get. 'Cheapest first' and 'Most expensive first' are the two that make a truncated run useful rather than arbitrary.",
            "default": "relevance"
          },
          "maxResults": {
            "title": "🔢 Maximum listings",
            "type": "integer",
            "description": "How many listings to return per place. Casa.it serves 20 per search page and stops at 80 pages, so a single query tops out near 1,600 rows however high you set this - split the area into districts to go deeper. Free-plan runs are capped at 25 rows regardless.",
            "default": 100
          },
          "enrichWithDetails": {
            "title": "💎 Fetch the full detail page for every listing",
            "type": "boolean",
            "description": "Off by default. When on, each search or agency result is followed to its own listing page, which adds condominium fees, year built, heating and air conditioning, building condition, the energy certificate's numeric values, floor plans, judicial auction date and reserve price, and the walking distance to every nearby bus stop, metro station, school, pharmacy and supermarket. It costs one extra page load per listing and bills the Listing Detail event on top of the search event, so turn it on…",
            "default": false
          },
          "listingUrls": {
            "title": "🔗 Listing URLs or IDs",
            "type": "array",
            "description": "Used by the Listing Detail operation: casa.it listing pages, e.g. https://www.casa.it/immobili/53928047/. The numeric id is the listing, so a bare 53928047 works too. Ids come out of a Property Search run in the Listing ID column.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "agencyUrls": {
            "title": "🏢 Agency page URLs or IDs",
            "type": "array",
            "description": "Used by the Agency Listings operation: casa.it agency pages, e.g. https://www.casa.it/agenzie/deus-ex-casa-1096354/. The trailing number is the agency id, so a bare 1096354 works too. Agency pages come out of a Property Search run in the Agency page column, which makes 'find every agency in Milan, then pull each one's whole portfolio' a two-run job.",
            "default": [],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}