{
  "openapi": "3.0.1",
  "info": {
    "title": "Idealista Scraper",
    "description": "Scrape Idealista search results and listing detail pages from Spain, Italy, and Portugal using request-only HTTP with browser TLS impersonation. Supports pagination, optional detail enrichment, price-range splitting, search monitoring, and coverage reports.",
    "version": "0.1",
    "x-build-id": "hNCxbJOma7cx2eLb1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/trakk~idealista-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-trakk-idealista-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/trakk~idealista-scraper/runs": {
      "post": {
        "operationId": "runs-sync-trakk-idealista-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/trakk~idealista-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-trakk-idealista-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "AUTO",
              "SEARCH",
              "DETAIL"
            ],
            "type": "string",
            "description": "🔀 Auto-detect (recommended) reads your input and decides: detail URLs, listing IDs or a dataset ➜ DETAIL, anything else ➜ SEARCH. Force SEARCH to paginate search pages, or DETAIL to scrape individual listings.",
            "default": "AUTO"
          },
          "searchUrls": {
            "title": "Search URLs",
            "type": "array",
            "description": "🔎 Idealista search / result URLs from idealista.com, idealista.it or idealista.pt. Any filters already in the URL (location, rooms, price…) are respected. Used in SEARCH mode.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "detailUrls": {
            "title": "Detail URLs",
            "type": "array",
            "description": "📄 Individual property page URLs (e.g. …/inmueble/106387165/). Used in DETAIL mode.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "startUrls": {
            "title": "Start URLs (mixed)",
            "type": "array",
            "description": "🧩 Mixed bag of Idealista URLs. Search URLs feed SEARCH mode, detail URLs feed DETAIL mode — handy when you don't want to sort them yourself.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "listingIds": {
            "title": "Listing IDs",
            "type": "array",
            "description": "🆔 Raw Idealista listing IDs (the number in the URL). They are turned into detail URLs using the Country + Language settings below. Used in DETAIL mode.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Input dataset",
            "type": "string",
            "description": "🗂️ Re-scrape a previous run: pick a dataset and the actor pulls propertyId / adId / url / detailUrl from every item. Used in DETAIL mode."
          },
          "country": {
            "title": "Country",
            "enum": [
              "ES",
              "IT",
              "PT"
            ],
            "type": "string",
            "description": "🌍 Country used when building URLs from a location slug or listing IDs.",
            "default": "ES"
          },
          "operation": {
            "title": "Operation",
            "enum": [
              "SALE",
              "RENT",
              "NEW_DEVELOPMENT"
            ],
            "type": "string",
            "description": "🏷️ Buy, rent or new-development — used only when building search URLs from a location slug.",
            "default": "SALE"
          },
          "locationSlug": {
            "title": "Location slug",
            "type": "string",
            "description": "📍 A single Idealista location slug, e.g. madrid-madrid, milano-milano, lisboa. For exact filters prefer pasting a Search URL instead."
          },
          "locationSlugs": {
            "title": "Location slugs (many)",
            "type": "array",
            "description": "📍 Several location slugs at once — one search URL is generated per slug.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Language path",
            "type": "string",
            "description": "🗣️ Language segment for generated URLs. Use en for English output where Idealista offers it (e.g. …/en/…).",
            "default": "en"
          },
          "minPrice": {
            "title": "Minimum price",
            "minimum": 0,
            "type": "integer",
            "description": "💶 Only listings at or above this price. Replaces any price filter already present in the search URL."
          },
          "maxPrice": {
            "title": "Maximum price",
            "minimum": 0,
            "type": "integer",
            "description": "💶 Only listings at or below this price. Replaces any price filter already present in the search URL."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "🔢 Hard cap on how many property rows are saved. Set 0 for unlimited.",
            "default": 100
          },
          "maxPagesPerSearch": {
            "title": "Max pages per search",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "📄 How many result pages to walk for each search URL (or price range). Idealista shows ~30 listings per page.",
            "default": 3
          },
          "maxDetailUrls": {
            "title": "Max detail URLs",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "🔢 Cap on how many URLs DETAIL mode collects from inputs/datasets. Set 0 for no cap.",
            "default": 0
          },
          "enablePriceSplitting": {
            "title": "Split by price range for full coverage",
            "type": "boolean",
            "description": "🪓 Idealista caps big searches at a limited number of pages. Turn this on to slice a broad search into price bands, grab far more listings, and get a coverage report per band.",
            "default": false
          },
          "maxSplitDepth": {
            "title": "Max split depth",
            "minimum": 0,
            "maximum": 4,
            "type": "integer",
            "description": "🪓 How aggressively to keep splitting a price band that still has more pages than the page cap. Higher = more coverage, more requests.",
            "default": 1
          },
          "includeDetails": {
            "title": "Enrich search results with detail pages",
            "type": "boolean",
            "description": "➕ Fetch each listing's detail page during a SEARCH run to add full description, features, photos, coordinates and more. Slower — one extra request per listing (parallelised up to Max concurrency).",
            "default": false
          },
          "rawOutput": {
            "title": "Include raw config snippets",
            "type": "boolean",
            "description": "🧪 Add the parsed raw JS config objects (_rawConfig, _rawMapConfig) to detail records. For debugging / power users.",
            "default": false
          },
          "monitoring": {
            "title": "Enable monitoring",
            "type": "boolean",
            "description": "🔁 Compare this run against the previous snapshot and label every listing new / unchanged / price_changed / removed.",
            "default": false
          },
          "monitoringStoreName": {
            "title": "Monitoring store name",
            "type": "string",
            "description": "💾 Named key-value store that holds the snapshots between runs. Use a distinct name per saved search.",
            "default": "idealista-monitoring"
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "🌐 Idealista is behind DataDome, so residential proxies are strongly recommended. Defaults to Apify Residential; datacenter / no-proxy runs are almost always challenged.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "⚡ How many detail requests run in parallel (DETAIL mode and includeDetails enrichment). Lower it if you see blocking.",
            "default": 5
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 15,
            "type": "integer",
            "description": "🔁 General retry budget per request (network hiccups, unexpected statuses).",
            "default": 4
          },
          "maxProxyRetries": {
            "title": "Max proxy retries",
            "minimum": 1,
            "maximum": 15,
            "type": "integer",
            "description": "🔁 Retry budget dedicated to proxy / transport failures, with a fresh proxy each time.",
            "default": 4
          },
          "maxBlockRetries": {
            "title": "Max DataDome retries",
            "minimum": 1,
            "maximum": 15,
            "type": "integer",
            "description": "🛡️ Retry budget dedicated to DataDome challenge pages — each retry rotates the session/IP.",
            "default": 4
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "⏱️ Per-request timeout in seconds.",
            "default": 30
          },
          "failOnSearchError": {
            "title": "Fail whole run on a search error",
            "type": "boolean",
            "description": "🚨 Off by default: a failing search URL is logged as an error row and the run continues. Turn on if one bad URL should abort everything.",
            "default": false
          },
          "impersonateProfile": {
            "title": "TLS impersonation profile",
            "type": "string",
            "description": "🎭 curl_cffi browser fingerprint for HTML pages. Safari currently passes Idealista best — change only if you know what you're doing.",
            "default": "safari"
          },
          "acceptLanguage": {
            "title": "Accept-Language header",
            "type": "string",
            "description": "🗣️ HTTP Accept-Language header sent with each request.",
            "default": "en-US,en;q=0.9"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}