{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Real Estate Multi-Portal Scraper (Delta Mode)",
    "description": "Extract Brazil property listings from OLX Imóveis and QuintoAndar with price/m², GPS coordinates, and incremental delta monitoring to track new listings and price changes.",
    "version": "1.0",
    "x-build-id": "zUWr5k8YaLzvZn6MU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/don.eich~brazil-realestate-multiportal/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-don.eich-brazil-realestate-multiportal",
        "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/don.eich~brazil-realestate-multiportal/runs": {
      "post": {
        "operationId": "runs-sync-don.eich-brazil-realestate-multiportal",
        "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/don.eich~brazil-realestate-multiportal/run-sync": {
      "post": {
        "operationId": "run-sync-don.eich-brazil-realestate-multiportal",
        "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": {
          "sources": {
            "title": "Portales",
            "type": "array",
            "description": "Portales a scrapear. ImovelWeb disponible en v1.1.",
            "items": {
              "type": "string",
              "enum": [
                "olx",
                "quintoandar",
                "imovelweb"
              ]
            },
            "default": [
              "olx",
              "quintoandar"
            ]
          },
          "state": {
            "title": "Estado (UF)",
            "enum": [
              "ac",
              "al",
              "am",
              "ap",
              "ba",
              "ce",
              "df",
              "es",
              "go",
              "ma",
              "mg",
              "ms",
              "mt",
              "pa",
              "pb",
              "pe",
              "pi",
              "pr",
              "rj",
              "rn",
              "ro",
              "rr",
              "rs",
              "sc",
              "se",
              "sp",
              "to"
            ],
            "type": "string",
            "description": "Código de estado de 2 letras. Requerido para OLX. QuintoAndar usa city.",
            "default": "sp"
          },
          "city": {
            "title": "Ciudad (slug)",
            "type": "string",
            "description": "Slug de ciudad para QuintoAndar y filtro de ciudad en OLX. Ejemplos: 'sao-paulo', 'rio-de-janeiro', 'belo-horizonte'.",
            "default": "sao-paulo"
          },
          "transactionType": {
            "title": "Tipo de transacción",
            "enum": [
              "sale",
              "rent"
            ],
            "type": "string",
            "description": "Venta (sale) o alquiler (rent).",
            "default": "sale"
          },
          "propertyType": {
            "title": "Tipo de inmueble",
            "enum": [
              "all",
              "apartments",
              "houses",
              "land",
              "commercial"
            ],
            "type": "string",
            "description": "Filtra por categoría. 'all' extrae todas las categorías disponibles.",
            "default": "all"
          },
          "priceMin": {
            "title": "Precio mínimo (BRL)",
            "minimum": 0,
            "type": "integer",
            "description": "Precio mínimo en Reais. Opcional."
          },
          "priceMax": {
            "title": "Precio máximo (BRL)",
            "minimum": 0,
            "type": "integer",
            "description": "Precio máximo en Reais. Opcional."
          },
          "bedroomsMin": {
            "title": "Mínimo de dormitorios",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Número mínimo de dormitorios (quartos). 0 = sin filtro."
          },
          "bathroomsMin": {
            "title": "Mínimo de baños",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Número mínimo de baños (banheiros). 0 = sin filtro. Solo aplica en portales que soportan este filtro."
          },
          "areaMin": {
            "title": "Área mínima (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "Área mínima en metros cuadrados. Opcional."
          },
          "maxListings": {
            "title": "Máximo de listings",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Límite total por run. OLX: 50 por página. QuintoAndar: 12 por página.",
            "default": 200
          },
          "publicationDays": {
            "title": "Publicados en los últimos N días",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "0 = sin filtro. Filtra listings por fecha de publicación."
          },
          "includeDetails": {
            "title": "Obtener página de detalle",
            "type": "boolean",
            "description": "Si true, fetcha la página de detalle de cada listing para campos adicionales (GPS, baños, descripción, amenidades). Más lento pero más rico.",
            "default": true
          },
          "includeDescription": {
            "title": "Incluir descripción textual",
            "type": "boolean",
            "description": "Si true, incluye el campo 'description' completo. Solo efectivo si includeDetails es true.",
            "default": false
          },
          "mode": {
            "title": "Modo de operación",
            "enum": [
              "FULL",
              "DELTA"
            ],
            "type": "string",
            "description": "FULL: extrae todos los listings hasta maxListings. DELTA: compara con el run anterior y emite solo NEW, UPDATED y REMOVED.",
            "default": "FULL"
          },
          "deltaStoreName": {
            "title": "Nombre del KV Store para delta",
            "type": "string",
            "description": "Named KV Store donde se persiste el estado del run anterior. Mismo nombre en runs sucesivos garantiza continuidad.",
            "default": "brazil-re-delta"
          },
          "proxyConfiguration": {
            "title": "Configuración de proxy",
            "type": "object",
            "description": "Usa Apify Proxy (RESIDENTIAL, country=BR) para producción. No requerido para tests ligeros.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "BR"
            }
          },
          "requestHandlerTimeoutSecs": {
            "title": "Timeout por request (segundos)",
            "minimum": 30,
            "maximum": 300,
            "type": "integer",
            "description": "Tiempo máximo de espera por cada request HTTP antes de reintentar. Aumentar si hay timeouts en conexiones lentas.",
            "default": 60
          },
          "maxRequestRetries": {
            "title": "Reintentos máximos por request",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Número máximo de reintentos por request fallido. Con proxy residencial, 3 reintentos es suficiente.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}