{
  "openapi": "3.0.1",
  "info": {
    "title": "Urbania Scraper — Peru Property Data & API",
    "description": "Urbania scraper & real estate data API for one of Peru's biggest property portals (Navent). Sale & rent listings: price in soles + USD, area, rooms, baths, parking, address, GPS, photos, advertiser WhatsApp — clean JSON/CSV. Overview or detail. No API key needed.",
    "version": "1.0",
    "x-build-id": "OBaMgzAgb8kLzPqyX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~urbania-property-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-urbania-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~urbania-property-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-urbania-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~urbania-property-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-urbania-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": {
          "scrapeMode": {
            "title": "⚡ Scrape mode",
            "enum": [
              "overview",
              "detail"
            ],
            "type": "string",
            "description": "⚡ **OVERVIEW** — fast, cheap. Pulls a full record per listing straight from the Urbania search API (price in soles + USD, area, rooms, baths, parking, full address, GPS, photos, advertiser, location hierarchy).\n\n🔍 **DETAIL** — same record plus the full long description and the advertiser's WhatsApp phone for a specific listing. Slower and priced higher per result.\n\n**TIP:** Start with Overview — the search API already carries almost every field. Use Detail only when you need the full description / WhatsApp for specific listings.",
            "default": "overview"
          },
          "searchMode": {
            "title": "🧭 Search by",
            "enum": [
              "byPlace",
              "bySearchUrl",
              "byListingUrl"
            ],
            "type": "string",
            "description": "🧭 How to tell the scraper what to fetch:\n\n- **By place** — pick the operation (sale/rent), a sort order and optional filters.\n- **By search URL** — paste an Urbania search-results URL; the path operation and on-page filters in the URL are honored.\n- **By listing URL** — Detail mode only: paste Urbania listing URLs to fetch specific properties.",
            "default": "byPlace"
          },
          "operation": {
            "title": "🏷️ Operation",
            "enum": [
              "sale",
              "rent",
              "transfer",
              "temporary"
            ],
            "type": "string",
            "description": "🏷️ Listing operation for **By place** searches: **Sale** (venta), **Rent** (alquiler), **Transfer** (traspaso) or **Temporary** (temporal).",
            "default": "sale"
          },
          "sort": {
            "title": "↕️ Sort",
            "enum": [
              "relevance",
              "low_price",
              "high_price",
              "more_recent",
              "most_visit",
              "most_lowered_price"
            ],
            "type": "string",
            "description": "↕️ Result ordering: relevance, lowest/highest price, most recent, most visited, or most price-reduced.",
            "default": "relevance"
          },
          "searchUrls": {
            "title": "🔗 Search URLs",
            "type": "array",
            "description": "🔗 Urbania search-results URLs to scrape. Used when **Search by = By search URL**.\n\n**TIP:** Build any search on urbania.pe (set your area, sale/rent, filters), then copy the URL from the address bar — the operation and on-page filters are honored.\n\n**BULK EDIT:** Click \"Bulk edit\" to paste many URLs, one per line.",
            "items": {
              "type": "string"
            }
          },
          "listingUrls": {
            "title": "🆔 Listing URLs",
            "type": "array",
            "description": "🆔 **Detail mode only.** Urbania listing URLs (e.g. https://urbania.pe/inmueble/clasificado/...-146979649.html).\n\n**BULK EDIT:** Click \"Bulk edit\" to paste many URLs, one per line.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "🔢 Max results",
            "minimum": 1,
            "type": "integer",
            "description": "🔢 Maximum listings to extract this run.\n\n- **FREE tier:** capped at 25 listings per run.\n- **PAID tier:** unlimited — set as high as you need.",
            "default": 100
          },
          "minPrice": {
            "title": "💰 Min price",
            "minimum": 0,
            "type": "integer",
            "description": "💰 Optional. Minimum price filter (By place mode). Pair with **Currency filter** to set the currency."
          },
          "maxPrice": {
            "title": "💰 Max price",
            "minimum": 0,
            "type": "integer",
            "description": "💰 Optional. Maximum price filter (By place mode). Pair with **Currency filter** to set the currency."
          },
          "currencyFilter": {
            "title": "💱 Currency filter",
            "enum": [
              "PEN",
              "USD"
            ],
            "type": "string",
            "description": "💱 Optional. Currency the price filters apply to: PEN (soles) or USD. Urbania returns both currencies on every listing regardless."
          },
          "minArea": {
            "title": "📐 Min area (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "📐 Optional. Minimum surface area in m² (By place mode)."
          },
          "minRooms": {
            "title": "🛏️ Min bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "🛏️ Optional. Minimum number of bedrooms (By place mode)."
          },
          "propertyType": {
            "title": "🏠 Property type ID",
            "type": "string",
            "description": "🏠 Optional. Urbania property-type ID(s) for By place searches (e.g. departamentos, casas). Leave blank for all types."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}