{
  "openapi": "3.0.1",
  "info": {
    "title": "Urbania Peru Real Estate Scraper",
    "description": "Extract Urbania.pe real estate listings for rent and sale in Peru with price in soles and dollars, maintenance fee, area, bedrooms, bathrooms, GPS coordinates, amenities, photos, agency and publish date. Search by district, like Miraflores or Surco, or paste any Urbania URL.",
    "version": "1.0",
    "x-build-id": "TmMWFFwFjbd7IqpUS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamole~urbania-scraper-pro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamole-urbania-scraper-pro",
        "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/datamole~urbania-scraper-pro/runs": {
      "post": {
        "operationId": "runs-sync-datamole-urbania-scraper-pro",
        "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/datamole~urbania-scraper-pro/run-sync": {
      "post": {
        "operationId": "run-sync-datamole-urbania-scraper-pro",
        "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": {
          "locations": {
            "title": "Distritos o ciudades",
            "type": "array",
            "description": "Escribe distritos o ciudades como en Urbania: Miraflores, Surco, La Molina, Callao, Arequipa, Cusco. Los distritos de Lima y Callao se reconocen automáticamente.",
            "items": {
              "type": "string"
            }
          },
          "operation": {
            "title": "Operación",
            "enum": [
              "alquiler",
              "venta",
              "alquiler-temporal"
            ],
            "type": "string",
            "description": "Tipo de operación para las búsquedas por distrito.",
            "default": "alquiler"
          },
          "propertyType": {
            "title": "Tipo de inmueble",
            "enum": [
              "departamentos",
              "casas",
              "oficinas",
              "locales-comerciales",
              "terrenos",
              "habitaciones",
              "locales-industriales",
              "inmuebles"
            ],
            "type": "string",
            "description": "Tipo de propiedad para las búsquedas por distrito.",
            "default": "departamentos"
          },
          "bedrooms": {
            "title": "Dormitorios (filtro de Urbania)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Aplica el filtro de dormitorios de Urbania en la búsqueda."
          },
          "sort": {
            "title": "Orden",
            "enum": [
              "more_recent",
              "most_visit"
            ],
            "type": "string",
            "description": "Orden de los resultados. Un orden fijo evita avisos repetidos entre páginas y asegura cobertura completa. Si tu URL ya trae ?sort= se respeta.",
            "default": "more_recent"
          },
          "searchUrls": {
            "title": "URLs de búsqueda de Urbania",
            "type": "array",
            "description": "Entra a urbania.pe, aplica filtros y copia la URL. Ejemplo: https://urbania.pe/buscar/venta-de-casas-en-la-molina--lima--lima",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Máximo de propiedades",
            "minimum": 1,
            "type": "integer",
            "description": "Tope total de propiedades a guardar en esta corrida. Vacío = todas."
          },
          "maxPages": {
            "title": "Máximo de páginas por búsqueda",
            "minimum": 1,
            "type": "integer",
            "description": "Cada página tiene 30 avisos. Vacío = todas las páginas de la búsqueda."
          },
          "includeDetails": {
            "title": "Incluir detalle completo",
            "type": "boolean",
            "description": "Entra a cada aviso para obtener coordenadas GPS, precio en soles y dólares, mantenimiento, antigüedad, amenidades, descripción completa, inmobiliaria y fecha de publicación. Más lento.",
            "default": true
          },
          "minPrice": {
            "title": "Precio mínimo",
            "minimum": 0,
            "type": "integer",
            "description": "Precio mínimo en la moneda elegida."
          },
          "maxPrice": {
            "title": "Precio máximo",
            "minimum": 0,
            "type": "integer",
            "description": "Precio máximo en la moneda elegida."
          },
          "priceCurrency": {
            "title": "Moneda de los filtros de precio",
            "enum": [
              "USD",
              "PEN"
            ],
            "type": "string",
            "description": "Con detalle completo se compara en ambas monedas usando la conversión de Urbania.",
            "default": "USD"
          },
          "minArea": {
            "title": "Área mínima (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Área total mínima."
          },
          "minBedrooms": {
            "title": "Dormitorios mínimos",
            "minimum": 0,
            "type": "integer",
            "description": "Al menos esta cantidad de dormitorios."
          },
          "minBathrooms": {
            "title": "Baños mínimos",
            "minimum": 0,
            "type": "integer",
            "description": "Al menos esta cantidad de baños."
          },
          "onlyWithPrice": {
            "title": "Solo avisos con precio",
            "type": "boolean",
            "description": "Descarta los avisos con \"Consultar precio\".",
            "default": false
          },
          "excludeProjects": {
            "title": "Excluir proyectos en planos",
            "type": "boolean",
            "description": "Descarta proyectos inmobiliarios (desarrollos) y deja solo inmuebles individuales.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Urbania usa Cloudflare. Se recomienda proxy residencial de Perú. El actor bloquea imágenes para gastar muy poco ancho de banda.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "PE"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}