{
  "openapi": "3.0.1",
  "info": {
    "title": "Loft Scraper — Brazil Property Data & API",
    "description": "Loft scraper & real estate data API for Brazil. Sale & rent listings: price, condo fee, IPTU, area, bedrooms, suites, parking, address, GPS, neighbourhood, amenities, photos — clean JSON/CSV. Fast overview or full detail. No API key needed.",
    "version": "1.0",
    "x-build-id": "EVpa8tZ5Th4RXFPDW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~loft-property-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-loft-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~loft-property-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-loft-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~loft-property-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-loft-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 (default, cheapest):** fast list extraction from Loft's public search API — price, area, rooms, location, photos and more for every listing.\n\n🔎 **DETAIL:** full per-listing record enriched with building metadata (build year, tower floors), annual IPTU, virtual/video tour URLs and the complete photo set. Discovers listings via the overview path, then enriches each one.",
            "default": "overview"
          },
          "searchMode": {
            "title": "🔍 Search mode",
            "enum": [
              "byCity",
              "bySearchUrl",
              "byListingUrl"
            ],
            "type": "string",
            "description": "How to find listings:\n\n- **📍 By city** — provide one or more city facets (e.g. `sao paulo, sp`).\n- **🔗 By search URL** — paste loft.com.br search URLs from your browser.\n- **🆔 By listing URL** — provide specific listing URLs or IDs (detail mode only).",
            "default": "byCity"
          },
          "cities": {
            "title": "📍 Cities",
            "type": "array",
            "description": "🏙️ **CITY FACETS:** one or more `\"city, uf\"` strings, e.g. `sao paulo, sp` or `rio de janeiro, rj`.\n\n💡 **TIP:** lowercase, comma + space. Used when **Search mode = By city**.\n\n📋 Click **Bulk edit** to paste several cities (one per line).",
            "default": [
              "sao paulo, sp"
            ],
            "items": {
              "type": "string"
            }
          },
          "searchUrls": {
            "title": "🔗 Search URLs",
            "type": "array",
            "description": "🔗 **SEARCH URLS:** paste loft.com.br search URLs, e.g. `https://loft.com.br/venda/imoveis/sp/sao-paulo`.\n\n💡 Any filters in the URL (bedrooms, neighborhood, …) are carried through. Used when **Search mode = By search URL**.",
            "items": {
              "type": "string"
            }
          },
          "listingUrls": {
            "title": "🆔 Listing URLs or IDs",
            "type": "array",
            "description": "🆔 **DETAIL TARGETS:** specific listing URLs (e.g. `https://loft.com.br/imovel/.../1fdwpn8`) or bare IDs (e.g. `1fdwpn8`).\n\nUsed when **Scrape mode = Detail** and **Search mode = By listing URL**.",
            "items": {
              "type": "string"
            }
          },
          "transactionType": {
            "title": "🏷️ Transaction type",
            "enum": [
              "for_sale",
              "for_rent"
            ],
            "type": "string",
            "description": "💰 **For sale (venda)** or 🔑 **For rent (aluguel)**. Applies to city / search-URL discovery.",
            "default": "for_sale"
          },
          "orderBy": {
            "title": "↕️ Order by",
            "enum": [
              "rankB",
              "rankA"
            ],
            "type": "string",
            "description": "📊 **Sort order** for the search results:\n\n- **rankB** — Loft relevance (default).\n- **rankA** — alternate relevance score.\n\nℹ️ Sorting by price is not supported by Loft's API.",
            "default": "rankB"
          },
          "neighborhood": {
            "title": "🏘️ Neighborhood facet",
            "type": "string",
            "description": "🏘️ **OPTIONAL NEIGHBORHOOD FILTER:** display facet, e.g. `pinheiros, sao paulo, sp`. Narrows the search to a single neighborhood."
          },
          "minBedrooms": {
            "title": "🛏️ Minimum bedrooms",
            "minimum": 1,
            "type": "integer",
            "description": "🛏️ **MIN BEDROOMS:** returns listings with at least this many bedrooms (≥ N)."
          },
          "maxResults": {
            "title": "🔢 Max results",
            "minimum": 1,
            "type": "integer",
            "description": "🔢 **MAX LISTINGS PER RUN.**\n\n🎯 **TIER-BASED LIMITS:**\n- **FREE users:** up to 25 listings per run\n- **PAID users:** unlimited\n\n💡 Overview paginates automatically (38 listings per page) until this cap.",
            "default": 100
          },
          "proxyCountry": {
            "title": "🌐 Proxy country (optional)",
            "type": "string",
            "description": "🌐 **OPTIONAL PROXY:** set to `BR` to route requests through a Brazilian residential exit (helps at very high volume). Leave **blank** to run DIRECT (default, fastest, no proxy cost)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}