{
  "openapi": "3.0.1",
  "info": {
    "title": "ComprarCasa Portugal Scraper - Real Estate Listings",
    "description": "Scrape every property listing from ComprarCasa (comprarcasa.pt), the Portuguese real estate network. Price, typology, useful, gross and land area, photos, energy certificate, coordinates, district, municipality, parish, agent and store. Sale and rent. No login.",
    "version": "0.1",
    "x-build-id": "1BysOVHUpCOZKaRU7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/studio-amba~comprarcasa-pt-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-studio-amba-comprarcasa-pt-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/studio-amba~comprarcasa-pt-scraper/runs": {
      "post": {
        "operationId": "runs-sync-studio-amba-comprarcasa-pt-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/studio-amba~comprarcasa-pt-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-studio-amba-comprarcasa-pt-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": {
          "country": {
            "title": "Country",
            "enum": [
              "PT",
              "ES",
              "ALL"
            ],
            "type": "string",
            "description": "comprarcasa.pt lists Portugal by default. The network also has a small Spain feed. ALL reads both in one run.",
            "default": "PT"
          },
          "transactionTypes": {
            "title": "Transaction type",
            "maxItems": 6,
            "uniqueItems": true,
            "type": "array",
            "description": "Sale, rent, business transfer and the other business types the site offers. Leave empty for all of them.",
            "items": {
              "type": "string",
              "enum": [
                "sale",
                "rent",
                "transfer",
                "holiday_rent",
                "exchange",
                "share_transfer"
              ],
              "enumTitles": [
                "Sale (Comprar)",
                "Rent (Arrendamento)",
                "Business transfer (Trespasse)",
                "Holiday rent (Arrendamento de férias)",
                "Exchange (Permuta)",
                "Share transfer (Cedência de quotas)"
              ]
            }
          },
          "propertyTypes": {
            "title": "Property type",
            "maxItems": 12,
            "uniqueItems": true,
            "type": "array",
            "description": "Only these property types. Leave empty for all types.",
            "items": {
              "type": "string",
              "enum": [
                "apartment",
                "house",
                "land",
                "shop",
                "office",
                "building",
                "warehouse",
                "farm",
                "estate",
                "garage",
                "development",
                "storage"
              ],
              "enumTitles": [
                "Apartment (Apartamento)",
                "House (Moradia, incl. semi-detached, terraced, chalet)",
                "Land (Terreno, loteamento, ruína)",
                "Shop / commercial (Loja, restaurante)",
                "Office (Escritório)",
                "Building (Prédio)",
                "Warehouse (Armazém)",
                "Farm (Quinta)",
                "Estate (Herdade)",
                "Garage (Garagem)",
                "New development (Empreendimento)",
                "Storage room (Arrecadação)"
              ]
            }
          },
          "district": {
            "title": "District (distrito)",
            "type": "string",
            "description": "Portuguese district, e.g. Braga, Porto, Lisboa, Évora, Leiria. Accents optional. The run fails with the list of districts that have listings if comprarcasa.pt has none there."
          },
          "municipality": {
            "title": "Municipality (concelho)",
            "type": "string",
            "description": "Municipality, e.g. Guimarães, Vila Nova de Gaia, Caldas da Rainha. Accents optional."
          },
          "parish": {
            "title": "Parish (freguesia)",
            "type": "string",
            "description": "Parish exactly as the site writes it, e.g. Cedofeita, Santo Ildefonso, Sé, Miragaia, São Nicolau e Vitória. Set the municipality too for a faster lookup."
          },
          "bedrooms": {
            "title": "Typology / bedrooms",
            "maxItems": 11,
            "type": "array",
            "description": "Number of bedrooms as a JSON list, e.g. [2, 3] (T0 = 0, T1 = 1, 10 means T10 or more). Leave empty for any.",
            "items": {
              "type": "integer"
            }
          },
          "minPrice": {
            "title": "Minimum price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum asking price or monthly rent in EUR."
          },
          "maxPrice": {
            "title": "Maximum price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum asking price or monthly rent in EUR."
          },
          "onlyAvailable": {
            "title": "Only available listings",
            "type": "boolean",
            "description": "comprarcasa.pt keeps sold, reserved and rented listings online with a stamp. Off (default): you get them too, with the status field set. On: only listings without such a stamp.",
            "default": false
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "newest",
              "price_asc",
              "price_desc",
              "area_asc",
              "area_desc"
            ],
            "type": "string",
            "description": "Order in which listings are collected. Matters when Max items is lower than the number of matching listings.",
            "default": "newest"
          },
          "startUrls": {
            "title": "Start URLs",
            "maxItems": 50,
            "type": "array",
            "description": "Optional comprarcasa.pt search URLs (https://www.comprarcasa.pt/imoveis/...) or listing URLs (https://www.comprarcasa.pt/imovel/...?id=...). When set, the filters above are only used to check the results. Max 50.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of listings to save. comprarcasa.pt has about 1,700 listings in Portugal, so the default 5000 covers the whole site.",
            "default": 5000
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "comprarcasa.pt has no anti-bot wall (see recon), so Apify's automatic proxy is enough.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}