{
  "openapi": "3.0.1",
  "info": {
    "title": "Catastro",
    "description": "Este actor automatiza la búsqueda de notificaciones catastrales publicadas en el Tablón Edictal Único (TEU) del Boletín Oficial del Estado (BOE) y permite consultar los servicios web públicos de la Sede Electrónica del Catastro.",
    "version": "1.0",
    "x-build-id": "ZRxECox8sALeRHn6Q"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/legaltech~catastro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-legaltech-catastro",
        "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/legaltech~catastro/runs": {
      "post": {
        "operationId": "runs-sync-legaltech-catastro",
        "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/legaltech~catastro/run-sync": {
      "post": {
        "operationId": "run-sync-legaltech-catastro",
        "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": {
          "searchTerms": {
            "title": "Términos de Búsqueda",
            "maxItems": 50,
            "type": "array",
            "description": "Introduce la lista de NIFs, referencias catastrales, nombres, etc. que quieres buscar. Si existe un anuncio donde aparezca en el día actual devolverá los resultados.",
            "items": {
              "type": "string"
            }
          },
          "timezone": {
            "title": "Zona Horaria (Opcional)",
            "type": "string",
            "description": "Tu zona horaria (ej. 'Europe/Madrid') para asegurar que la búsqueda por fecha se realiza en el día correcto. Si se deja en blanco, se usará UTC.",
            "default": "Europe/Madrid"
          },
          "catastroQueries": {
            "title": "Consultas de la API de Catastro",
            "maxItems": 50,
            "type": "array",
            "description": "Consultas opcionales a los servicios públicos de Catastro. Puede usarse junto con searchTerms o de forma independiente. Cada elemento usa una operación y sus parámetros oficiales.",
            "items": {
              "type": "object",
              "properties": {
                "operation": {
                  "title": "Operación de Catastro",
                  "description": "Servicio público de Catastro que se desea consultar.",
                  "type": "string",
                  "enum": [
                    "province",
                    "municipality",
                    "municipalityCodes",
                    "via",
                    "viaCodes",
                    "number",
                    "numberCodes",
                    "location",
                    "locationCodes",
                    "refCat",
                    "refCatCodes",
                    "parcel",
                    "parcelCodes",
                    "coordinatesToRef",
                    "nearby",
                    "refToCoordinates"
                  ]
                },
                "parameters": {
                  "title": "Parámetros de la consulta",
                  "description": "Parámetros oficiales del servicio REST/JSON de Catastro seleccionado. Ojo: algunos nombres no coinciden con el PDF oficial de Catastro (que documenta la variante SOAP), verificados contra las páginas .../json/help en vivo de cada servicio:\n• via / number: el filtro de nombre es \"NomVia\" (no \"NombreVia\"), junto con \"TipoVia\", \"Provincia\", \"Municipio\".\n• viaCodes / numberCodes: solo admiten \"CodigoProvincia\", \"CodigoMunicipio\", \"CodigoMunicipioINE\" y \"CodigoVia\" — NO filtran por nombre de vía; sin \"CodigoVia\" devuelven el callejero completo del municipio.\n• coordinatesToRef / nearby: los parámetros son \"CoorX\"/\"CoorY\" (no \"Coordenada_X\"/\"Coordenada_Y\").\n• refCat / refCatCodes / location(Codigos) / parcel(Codigos): usan \"RefCat\" (no \"RC\"), y admite 14, 18 o 20 caracteres.",
                  "type": "object",
                  "additionalProperties": true
                },
                "maxResultados": {
                  "title": "Límite de resultados (opcional)",
                  "description": "Si la respuesta de Catastro contiene una lista (provincias, municipios, callejero, etc.), corta la lista más grande de la respuesta a este número de elementos y añade \"resultadosTruncados\"/\"totalResultadosDisponibles\" al resultado. Útil para evitar respuestas de varios MB al pedir el callejero completo de un municipio. No afecta a consultas que ya devuelven un único inmueble o coordenada.",
                  "type": "integer",
                  "minimum": 1
                }
              },
              "required": [
                "operation"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}