{
  "openapi": "3.0.1",
  "info": {
    "title": "Immobiliare.it Scraper",
    "description": "Scrape Immobiliare.it, Italy's #1 property marketplace. Look up listings by id or URL, search for sale or rent by city/comune or URL with filters, resolve locations via autocomplete, and pull agencies (by area, profile, listings).",
    "version": "1.0",
    "x-build-id": "jmFShVdnvyYY3wgWA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/one-api~immobiliare-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-one-api-immobiliare-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/one-api~immobiliare-scraper/runs": {
      "post": {
        "operationId": "runs-sync-one-api-immobiliare-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/one-api~immobiliare-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-one-api-immobiliare-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": {
          "property_inputs": {
            "title": "Property id or immobiliare.it URL (one per line)",
            "type": "array",
            "description": "Auto-detects each entry and calls the right endpoint:\n• Digits only (e.g. `116128813`) → `/details/byid`\n• `https://www.immobiliare.it/annunci/...` → `/details/byurl`\n\nEach row = one full property record (price, surface, rooms, energy class, features, photos, agency contact).",
            "items": {
              "type": "string"
            }
          },
          "search_inputs": {
            "title": "Location or search-results URL (one per line)",
            "type": "array",
            "description": "Auto-detects each entry and routes to the right `/search/*` endpoint:\n• `https://www.immobiliare.it/vendita-case/milano/` (a results URL) → `/search/byurl` (its location, contract and filters are applied automatically)\n• Anything else (city / comune / province / region, e.g. `Milano`, `Roma`) → `/search/bylocation`\n\nThe filters below apply to every `bylocation` query. Each hit returns one row per listing.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Contract type",
            "enum": [
              "For_Sale",
              "For_Rent"
            ],
            "type": "string",
            "description": "Sale (vendita) or rent (affitto). Applies to `/search/bylocation`.",
            "default": "For_Sale"
          },
          "propertyCategory": {
            "title": "Property category",
            "enum": [
              "residential",
              "rooms",
              "buildings",
              "garage",
              "offices",
              "land",
              "industrial",
              "shops"
            ],
            "type": "string",
            "description": "Top-level category to search.",
            "default": "residential"
          },
          "propertyType": {
            "title": "Residential typology (optional)",
            "type": "string",
            "description": "Only when category = Residential. Comma-separate for multiple; leave empty for all types.\nValues: `apartment`, `villa`, `townhouse`, `detached`, `loft`, `penthouse`, `farmhouse`.",
            "default": ""
          },
          "priceRange": {
            "title": "Price range (€)",
            "type": "string",
            "description": "Format: `min:200000,max:500000` — or just `min:200000` / `max:500000`.",
            "default": ""
          },
          "surfaceRange": {
            "title": "Surface range (m²)",
            "type": "string",
            "description": "Format: `min:80,max:150` — or just `min:80` / `max:150`.",
            "default": ""
          },
          "roomsRange": {
            "title": "Rooms range (locali)",
            "type": "string",
            "description": "Format: `min:3,max:5` — or just `min:3` / `max:5`.",
            "default": ""
          },
          "bathrooms": {
            "title": "Min bathrooms",
            "type": "string",
            "description": "Minimum number of bathrooms (upstream buckets 1–4, where 4 means 4+). Leave empty for any.",
            "default": ""
          },
          "condition": {
            "title": "Condition",
            "enum": [
              "",
              "new",
              "excellent",
              "good",
              "to_renovate"
            ],
            "type": "string",
            "description": "Property state. Leave as Any for no filter.",
            "default": ""
          },
          "features": {
            "title": "Features / amenities (optional)",
            "type": "string",
            "description": "Comma-separate for multiple; leave empty for any.\nValues: `balcony`, `terrace`, `garden`, `elevator`, `garage`, `pool`, `cellar`, `furnished`.",
            "default": ""
          },
          "excludeAuctions": {
            "title": "Exclude auctions (aste)",
            "type": "boolean",
            "description": "Turn on to drop auction listings from search results.",
            "default": false
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "relevance",
              "Price_Low_to_High",
              "Price_High_to_Low",
              "Newest",
              "surface_largest"
            ],
            "type": "string",
            "description": "Result ordering for `/search/bylocation`.",
            "default": "relevance"
          },
          "pages": {
            "title": "Pages per search",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many pages to fetch for each search query (20 listings per page). Also caps pages of agency listings.",
            "default": 1
          },
          "resultCount": {
            "title": "Results per page",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Listings per page, 1–20 (upstream page size is fixed at 20).",
            "default": 20
          },
          "autocomplete_inputs": {
            "title": "Location text to resolve (one per line)",
            "type": "array",
            "description": "Free text resolved to comune / province / region / zone ids via `/autocomplete`. Feed the returned ids back into a search if you want an exact scope. Each suggestion = one row.",
            "items": {
              "type": "string"
            }
          },
          "agency_area_inputs": {
            "title": "City / comune to find agencies in (one per line)",
            "type": "array",
            "description": "Real-estate agencies operating in a municipality, via `/agent/search`. Accepts a city name (e.g. `Milano`) or a numeric comune id. Each agency = one row.",
            "items": {
              "type": "string"
            }
          },
          "agency_ids": {
            "title": "Agency id (one per line)",
            "type": "array",
            "description": "For each numeric agency id the actor fetches `/agent/details` (one profile row) plus `/agent/listings` (one row per active listing, up to `Pages per search` pages). Agency ids come from the Agencies-by-area section or a listing's agency block.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}