{
  "openapi": "3.0.1",
  "info": {
    "title": "Pisos.com Scraper",
    "description": "Real estate listings scraper for pisos",
    "version": "0.0",
    "x-build-id": "P7ozrfl9oU0JGwZlC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/unfenced-group~pisos-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-unfenced-group-pisos-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/unfenced-group~pisos-scraper/runs": {
      "post": {
        "operationId": "runs-sync-unfenced-group-pisos-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/unfenced-group~pisos-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-unfenced-group-pisos-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": {
          "transaction": {
            "title": "Transaction",
            "enum": [
              "sale",
              "rent"
            ],
            "type": "string",
            "description": "Transaction",
            "default": "sale"
          },
          "propertyType": {
            "title": "Property type",
            "enum": [
              "apartment",
              "house",
              "land",
              "garage",
              "office",
              "attic",
              "duplex",
              "studio"
            ],
            "type": "string",
            "description": "Property type",
            "default": "apartment"
          },
          "location": {
            "title": "Location slug",
            "type": "string",
            "description": "Spanish city or province slug as in pisos.com URLs, e.g. 'madrid', 'barcelona', 'sevilla', 'valencia'.",
            "default": "madrid"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "newest",
              "cheapest",
              "mostexp",
              "mostrooms",
              "largest"
            ],
            "type": "string",
            "description": "Sort by",
            "default": "relevance"
          },
          "minPrice": {
            "title": "Min price",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum price in EUR (sale price, or monthly rent). Applied on pisos.com and then enforced exactly, so every returned listing is at or above this price. Listings without a published price are excluded when a price filter is set."
          },
          "maxPrice": {
            "title": "Max price",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum price in EUR (sale price, or monthly rent). Applied on pisos.com and then enforced exactly, so every returned listing is at or below this price. Listings without a published price are excluded when a price filter is set."
          },
          "daysOld": {
            "title": "Max listing age (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Only return listings first published within the last N days. The publication date is read from each listing's detail page, so this opens the detail page of every candidate (same price per result, longer run time). Up to 3 x Max items candidates are checked per run."
          },
          "fetchDetails": {
            "title": "Fetch listing details",
            "type": "boolean",
            "description": "Open each listing's detail page for the full description, publication and update dates, built and usable area, price per m², energy rating, condition, age, community fees, heating, reference, all features, advertiser name, address and phone, and the full photo gallery. Same price per result, longer run time.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of listings to return. With 'Only new or changed listings' enabled, this is the number of listings checked per run (for example the 100 newest); only the new or changed ones among them are returned and charged.",
            "default": 100
          },
          "onlyNewOrChanged": {
            "title": "Only new or changed listings",
            "type": "boolean",
            "description": "For scheduled monitoring. Remembers every listing between runs and returns only listings that are new or whose price, size, rooms, bathrooms, floor, title or description changed since the previous run. Unchanged listings are skipped and not charged. The first run returns everything and sets the baseline. State is kept per search (same location, type, transaction and sort, or same start URLs) for 90 days in your own key-value store 'pisos-scraper-monitor'.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Optional name for the monitoring state, e.g. 'santander-flats'. Use it to keep two monitors on the same search separate, or to start a fresh baseline by choosing a new name. Leave empty to derive it from the search parameters."
          },
          "reconcileDatasets": {
            "title": "Reconcile with delivered datasets (repair)",
            "type": "array",
            "description": "Repair a monitor whose state records listings that never reached your dataset. Select every dataset this monitor has delivered into (the default dataset of each earlier run). Listings in the monitor state but in none of these datasets are removed from the state and returned as NEW in this run, so you pay only for listings you have not received. Leave empty for normal runs."
          },
          "deliveredListingIds": {
            "title": "Delivered listing IDs (repair, alternative)",
            "type": "array",
            "description": "Alternative to selecting datasets, e.g. when an earlier dataset has expired: the listing IDs (the 'id' field) you have received from this monitor. Combined with any selected datasets. Leave empty for normal runs.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Start URLs",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}