{
  "openapi": "3.0.1",
  "info": {
    "title": "Casa 47 Spain Public Housing Rental Scraper",
    "description": "Export every affordable rental home published by Casa 47, Spain's state housing entity: rent, size, bedrooms, elevator, storage room and GPS coordinates. Official API, no browser.",
    "version": "0.1",
    "x-build-id": "IVqS9BSFarW9UlPmP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/angaba92~casa47-public-housing-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-angaba92-casa47-public-housing-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/angaba92~casa47-public-housing-scraper/runs": {
      "post": {
        "operationId": "runs-sync-angaba92-casa47-public-housing-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/angaba92~casa47-public-housing-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-angaba92-casa47-public-housing-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": {
          "maxItems": {
            "title": "Maximum listings",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of housing listings to deliver. Inventory varies by call. A truncated run does not advance the monitoring baseline.",
            "default": 100
          },
          "provinces": {
            "title": "Provinces or regions",
            "type": "array",
            "description": "Filter by province or region name, e.g. Valencia, Alicante, Cataluña, Galicia, Navarra, Asturias, Castilla-La Mancha. Leave empty for all of Spain.",
            "items": {
              "type": "string"
            }
          },
          "minPriceEur": {
            "title": "Minimum monthly rent (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Only return homes with a monthly rent at or above this amount."
          },
          "maxPriceEur": {
            "title": "Maximum monthly rent (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Only return homes with a monthly rent at or below this amount."
          },
          "minBedrooms": {
            "title": "Minimum bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Only return homes with at least this many bedrooms."
          },
          "minSizeM2": {
            "title": "Minimum built size (m2)",
            "minimum": 0,
            "type": "integer",
            "description": "Only return homes with at least this built floor area in square metres."
          },
          "requireElevator": {
            "title": "Only homes with elevator",
            "type": "boolean",
            "description": "Return only buildings that have an elevator.",
            "default": false
          },
          "requireStorageRoom": {
            "title": "Only homes with storage room",
            "type": "boolean",
            "description": "Return only homes that include a storage room (trastero).",
            "default": false
          },
          "onlyNew": {
            "title": "Only new or price-changed listings",
            "type": "boolean",
            "description": "Return new or price-changed homes relative to the last committed snapshot in stateStoreName. The first onlyNew run records a baseline without rows. Item or charge truncation does not advance the baseline; repeated rows are possible until all matches are delivered.",
            "default": false
          },
          "stateStoreName": {
            "title": "Monitoring state store",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,62}$",
            "type": "string",
            "description": "Persistent key-value store for this monitor, within your Apify account. Use a distinct name per filter set or schedule. Do not run the same monitor concurrently. Default preserves the existing casa47-listing-state store.",
            "default": "casa47-listing-state"
          },
          "updateState": {
            "title": "Commit monitoring baseline",
            "type": "boolean",
            "description": "Set false for previews or QA: read the baseline but never change it. True commits a full portal snapshot only when every matching listing has been delivered, or on the first onlyNew baseline run.",
            "default": true
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "priceAsc",
              "priceDesc",
              "sizeAsc",
              "sizeDesc",
              "bedroomsDesc",
              "newest",
              "reference"
            ],
            "type": "string",
            "description": "How to order the returned listings.",
            "default": "priceAsc"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}