{
  "openapi": "3.0.1",
  "info": {
    "title": "Idealista Scraper",
    "description": "Scrape Idealista property listings across Spain, Italy, and Portugal. Look up properties by adId or URL, search by location name, ZIP, coordinates, polygon, or Idealista URL, and pull agency profiles + the geographies they list in.",
    "version": "1.0",
    "x-build-id": "WMUuevaqvoRmbiOfR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/one-api~idealista-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-one-api-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/one-api~idealista-scraper/runs": {
      "post": {
        "operationId": "runs-sync-one-api-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/one-api~idealista-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-one-api-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": {
          "property_inputs": {
            "title": "Property adId or Idealista URL (one per line)",
            "type": "array",
            "description": "Auto-detects each entry and calls the right endpoint:\n• Digits only (e.g. `106387165`) → `/details/byid`\n• `https://www.idealista.com/...` (or `.it` / `.pt`) → `/details/byurl`\n\nEach row in the dataset = one full property record (address, price, beds/baths, size, photos, agent contact).",
            "items": {
              "type": "string"
            }
          },
          "search_inputs": {
            "title": "Search query (one per line)",
            "type": "array",
            "description": "Auto-detects each entry and routes to the right `/search/*` endpoint:\n• `https://www.idealista.com/...` → `/search/byurl`\n• 5-digit ZIP (e.g. `28001`) → `/search/byzip`\n• `lat,lng` or `lat,lng,radius` (e.g. `40.4168,-3.7038,2`) → `/search/bycoordinates`\n• `lng lat,lng lat,...` (≥4 vertices, space-separated pair, comma-delimited list) → `/search/bypolygon`\n• Anything else (city / region name, e.g. `Madrid`) → `/search/bylocation`\n\nFilters below apply to every search call. Each hit returns one row per listing.",
            "items": {
              "type": "string"
            }
          },
          "agency_shortnames": {
            "title": "Agency microsite shortName (one per line)",
            "type": "array",
            "description": "Idealista agency microsite shortNames (e.g. `walterhauschamberi`). For each shortName the actor fetches `/agent/details` (one summary row) plus `/agent/locations` (one row per province / municipality the agency lists in).",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "enum": [
              "es",
              "it",
              "pt"
            ],
            "type": "string",
            "description": "Idealista marketplace. Spain (`es`), Italy (`it`), or Portugal (`pt`).",
            "default": "es"
          },
          "searchType": {
            "title": "Operation",
            "enum": [
              "For_Sale",
              "For_Rent",
              "For_Share"
            ],
            "type": "string",
            "description": "What kind of listings to fetch in `/search/*`.",
            "default": "For_Sale"
          },
          "propertyType": {
            "title": "Property type",
            "enum": [
              "homes",
              "offices",
              "premises",
              "garages",
              "lands",
              "storageRooms",
              "buildings",
              "newDevelopments"
            ],
            "type": "string",
            "description": "Which Idealista typology to search.",
            "default": "homes"
          },
          "priceRange": {
            "title": "Price range (€)",
            "type": "string",
            "description": "Format: `min:200000,max:600000` — or just `min:200000` / `max:600000`.",
            "default": ""
          },
          "bedsRange": {
            "title": "Bed range",
            "type": "string",
            "description": "Format: `min:1,max:3`. Studio = `0`.",
            "default": ""
          },
          "sqftRange": {
            "title": "Size range (m²)",
            "type": "string",
            "description": "Format: `min:60,max:120`.",
            "default": ""
          },
          "pages": {
            "title": "Pages per search",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many pages to fetch for each `/search/*` query.",
            "default": 1
          },
          "resultCount": {
            "title": "Results per page",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Idealista caps each search page at ~50 results.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}