{
  "openapi": "3.0.1",
  "info": {
    "title": "Spanish Judicial Auctions, Enriched (BOE + Catastro)",
    "description": "Crawls the Spanish BOE auction portal and returns each property lot enriched with official cadastral data: floor area, year built, use, coordinates, plus normalised encumbrances, occupancy status and per-square-metre arithmetic. No personal data of debtors or any natural person, by design.",
    "version": "0.1",
    "x-build-id": "U80yA0RrjDYNenEJE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ernestmarza~spain-judicial-auctions-enriched/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ernestmarza-spain-judicial-auctions-enriched",
        "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/ernestmarza~spain-judicial-auctions-enriched/runs": {
      "post": {
        "operationId": "runs-sync-ernestmarza-spain-judicial-auctions-enriched",
        "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/ernestmarza~spain-judicial-auctions-enriched/run-sync": {
      "post": {
        "operationId": "run-sync-ernestmarza-spain-judicial-auctions-enriched",
        "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": {
          "auctionIds": {
            "title": "Specific auctions",
            "type": "array",
            "description": "Auction identifiers or detail URLs, one per entry. Accepts 'SUB-JA-2026-261745', a full 'detalleSubasta.php?idSub=...' URL, or the short 'subastas.boe.es/ds.php?id=...' permalink the BOE gazette publishes. When this is set the search is skipped entirely and only these auctions are fetched, which is both faster and cheaper.",
            "items": {
              "type": "string"
            }
          },
          "auctionState": {
            "title": "Auction state",
            "enum": [
              "open",
              "upcoming",
              "any"
            ],
            "type": "string",
            "description": "Which auctions to search for. The BOE portal's public search only supports auctions that are running or about to open; concluded, cancelled and suspended auctions cannot be enumerated and must be requested by identifier above.",
            "default": "open"
          },
          "auctionKinds": {
            "title": "Auction types",
            "type": "array",
            "description": "Which procedures to include. Judicial auctions come from the courts and are the classic distressed-property source; tax-agency auctions come from the AEAT; notarial auctions are run by a notary, usually out-of-court mortgage enforcement. Leave empty for all four.",
            "items": {
              "type": "string",
              "enum": [
                "judicial",
                "tax-agency",
                "notarial",
                "administrative"
              ],
              "enumTitles": [
                "Judicial (court-ordered)",
                "Tax agency (AEAT)",
                "Notarial",
                "Other administrative bodies"
              ]
            },
            "default": []
          },
          "province": {
            "title": "Province",
            "type": "string",
            "description": "Spanish province name or its two-digit INE code. Examples: 'Sevilla', 'Barcelona', '41'. Leave empty to search the whole country."
          },
          "locality": {
            "title": "Town or city",
            "type": "string",
            "description": "Matched against the town recorded on the property. Free text, matched by the portal itself."
          },
          "postalCode": {
            "title": "Postal code",
            "type": "string",
            "description": "Exactly five digits."
          },
          "addressContains": {
            "title": "Address contains",
            "type": "string",
            "description": "Free-text fragment matched against the property address by the portal, for example a street name."
          },
          "maxAuctions": {
            "title": "Maximum auctions to open",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many auctions to fetch in detail. Each auction costs three page loads plus one more per extra lot, and the crawl is deliberately paced, so this is the main control on how long a run takes."
          },
          "maxLots": {
            "title": "Maximum lots to return",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Hard ceiling on dataset items. One auction can contain several lots and one lot several assets, so this is not the same as the auction count. You are charged per lot returned."
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 250,
            "maximum": 10000,
            "type": "integer",
            "description": "Pause between page loads. Lowering this speeds the run up and increases the load placed on a government service that has no commercial interest in absorbing it. 1000 ms is the recommended floor."
          },
          "enrichWithCadastre": {
            "title": "Enrich with the cadastre",
            "type": "boolean",
            "description": "Look each property up in the Spanish cadastre's free public web services to add floor area, year built, use, plot area, number of units, coordinates and the official facade photograph. Adds roughly one second per lot. These services return no owner names.",
            "default": true
          },
          "onlyWithCadastralReference": {
            "title": "Only lots with a cadastral reference",
            "type": "boolean",
            "description": "Drop lots that neither publish a cadastral reference nor could be matched to one from their address. Useful when you intend to cross-reference the results against another property dataset.",
            "default": false
          },
          "excludePrimaryResidence": {
            "title": "Exclude primary residences",
            "type": "boolean",
            "description": "Skip lots the court has flagged as the occupant's habitual home. These carry the longest eviction timelines and the strongest statutory protections for the occupant.",
            "default": false
          },
          "minAuctionValue": {
            "title": "Minimum auction value (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Lots whose auction value is below this, or which publish no value at all, are dropped."
          },
          "maxAuctionValue": {
            "title": "Maximum auction value (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Lots whose auction value is above this, or which publish no value at all, are dropped."
          },
          "minDiscountPercent": {
            "title": "Minimum discount vs appraisal (%)",
            "minimum": -100,
            "maximum": 100,
            "type": "integer",
            "description": "Keep only lots whose auction value is at least this far below the published appraisal. Use with care: most judicial auctions publish an appraisal of 0,00 EUR, which this Actor reads as 'not supplied' rather than as a free property, so a discount filter will exclude nearly all of them."
          },
          "includeRawFields": {
            "title": "Include raw portal fields",
            "type": "boolean",
            "description": "Attach the label/value pairs exactly as the portal published them, alongside the normalised record. Useful for auditing the parser or for reaching a field this Actor does not model. Personal fields are excluded from this too.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}