{
  "openapi": "3.0.1",
  "info": {
    "title": "Aragon Tenders Scraper — Public Contracts Registry (CKAN)",
    "description": "Scrape the Aragon public contracts registry (major and minor contracts) from the official opendata.aragon.es CKAN portal, with server-side filtering by year, contract type and free-text search. Registro de contratos públicos de la Comunidad Autónoma de Aragón.",
    "version": "0.1",
    "x-build-id": "rhI06LpVPMjfJXd7z"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/xamto1987~aragon-tenders/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-xamto1987-aragon-tenders",
        "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/xamto1987~aragon-tenders/runs": {
      "post": {
        "operationId": "runs-sync-xamto1987-aragon-tenders",
        "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/xamto1987~aragon-tenders/run-sync": {
      "post": {
        "operationId": "run-sync-xamto1987-aragon-tenders",
        "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": {
          "tipoRegistro": {
            "title": "Register type / Tipo de registro",
            "enum": [
              "mayores",
              "menores"
            ],
            "type": "string",
            "description": "'mayores' = major contracts (formal tender files, with lots and a tender budget). 'menores' = minor contracts (direct award, with no prior tender). They are two different CKAN resources with slightly different columns. / ES: contratos mayores (licitación formal) o menores (adjudicación directa).",
            "default": "mayores"
          },
          "keywords": {
            "title": "Keywords / Palabras clave",
            "type": "array",
            "description": "Terms to search for across ALL text columns of the register (CKAN's server-side free-text 'q' search). Each term is queried separately and the results merged (any term matches, same as in catalonia-tenders). Empty = no text filter. / ES: búsqueda de texto libre en servidor; cada término por separado, resultados combinados.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tipoContrato": {
            "title": "Contract type / Tipo de contrato",
            "enum": [
              "",
              "Suministros",
              "Servicios",
              "Obras",
              "Mixto",
              "Concesión de servicios",
              "Administrativo especial"
            ],
            "type": "string",
            "description": "Server-side exact-match filter on the 'TIPO DE CONTRATO' column. Real values verified with curl over a 1,000-row sample of major contracts. Empty = all types. / ES: filtro en servidor por igualdad exacta; vacío = todos.",
            "default": ""
          },
          "ano": {
            "title": "Year / Año",
            "type": "string",
            "description": "Server-side exact-match filter on the 'ANO' column. The register covers 2023 onwards. Empty = all available years. / ES: filtro en servidor sobre la columna ANO; el registro cubre desde 2023."
          },
          "importeMinimo": {
            "title": "Minimum amount (EUR) / Importe mínimo",
            "type": "integer",
            "description": "Filters on the award amount excluding VAT (or, failing that, the tender budget excluding VAT). WARNING: CKAN's 'datastore_search' only supports exact match in 'filters', not ranges, so this filter is applied CLIENT-SIDE after each server page is fetched. / ES: filtro en cliente, porque CKAN no admite rangos."
          },
          "importeMaximo": {
            "title": "Maximum amount (EUR) / Importe máximo",
            "type": "integer",
            "description": "Same as 'importeMinimo', as an upper bound (also client-side). / ES: igual que importeMinimo, como cota superior, también en cliente."
          },
          "incluirContactosNominales": {
            "title": "Include named individuals' data / Incluir datos nominales de personas físicas",
            "type": "boolean",
            "description": "OFF BY DEFAULT. The register's 'NIF ADJUDICATARIO' column includes unmasked tax IDs of natural persons (sole traders) in part of both the minor and the major contracts — verified with curl (real sample: tax IDs with a '***NNNN**' mask, same as in BDNS). While this option is off, if the awardee is not unambiguously a legal person, 'adjudicatario.nif' and '.razonSocial' are nulled and only '.tipoPersona' remains. Turning it on includes personal data: its processing and redistribution are your responsibility (GDPR / LOPDGDD). / ES: desactivado por defecto; anula nombre y NIF del adjudicatario autónomo.",
            "default": false
          },
          "maxItems": {
            "title": "Max items / Máximo de resultados",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Hard cap on the number of contracts saved to the dataset. The Actor stops cleanly when it is reached. / ES: tope de contratos del dataset.",
            "default": 200
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}