{
  "openapi": "3.0.1",
  "info": {
    "title": "Licitaciones Públicas España (PLACSP) — Excel y alertas",
    "description": "Licitaciones públicas de España desde el feed oficial de la PLACSP, filtradas por CPV, importe, región, tipo de contrato y palabras clave. Órgano de contratación, plazos y adjudicatario. Exporta a Excel o CSV y prográmalo como alerta diaria. Actor no oficial.",
    "version": "0.1",
    "x-build-id": "zXdpDlf3VPvEe4ctc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rianone~spain-public-tenders/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rianone-spain-public-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/rianone~spain-public-tenders/runs": {
      "post": {
        "operationId": "runs-sync-rianone-spain-public-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/rianone~spain-public-tenders/run-sync": {
      "post": {
        "operationId": "run-sync-rianone-spain-public-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": {
          "statuses": {
            "title": "Estado de la licitación",
            "type": "array",
            "description": "Devuelve solo estos estados. Déjalo vacío para incluir todos.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Palabras clave",
            "type": "array",
            "description": "Busca en el objeto, el identificador y el órgano de contratación. No distingue tildes.",
            "items": {
              "type": "string"
            }
          },
          "cpvCodes": {
            "title": "Códigos CPV",
            "type": "array",
            "description": "Filtra por prefijo CPV; por ejemplo, 4523 encuentra construcción.",
            "items": {
              "type": "string"
            }
          },
          "contractTypes": {
            "title": "Tipos de contrato",
            "type": "array",
            "description": "Usa 1 para suministros, 2 para servicios y 3 para obras.",
            "items": {
              "type": "string"
            }
          },
          "contractingAuthorities": {
            "title": "Órganos de contratación",
            "type": "array",
            "description": "Busca por parte del nombre o por NIF del órgano de contratación.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Lugar de ejecución",
            "type": "array",
            "description": "Busca por provincia, comunidad, municipio o código NUTS; por ejemplo Madrid o ES300.",
            "items": {
              "type": "string"
            }
          },
          "minValueEur": {
            "title": "Valor estimado mínimo (EUR)",
            "type": "number",
            "description": "Incluye únicamente licitaciones con valor estimado igual o superior."
          },
          "maxValueEur": {
            "title": "Valor estimado máximo (EUR)",
            "type": "number",
            "description": "Incluye únicamente licitaciones con valor estimado igual o inferior."
          },
          "awardedOnly": {
            "title": "Solo licitaciones adjudicadas",
            "type": "boolean",
            "description": "Conserva solo los registros que ya indican adjudicatario.",
            "default": false
          },
          "maxResults": {
            "title": "Máximo de licitaciones",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Número máximo de registros devueltos. Entre 1 y 500; el valor por defecto es 200.",
            "default": 200
          },
          "exportFiles": {
            "title": "Ficheros para descargar",
            "type": "array",
            "description": "Guarda CSV y/o Excel en el almacén de la ejecución, además del dataset.",
            "items": {
              "type": "string"
            },
            "default": [
              "csv",
              "xlsx"
            ]
          },
          "exportLanguage": {
            "title": "Idioma de los ficheros",
            "enum": [
              "es",
              "en"
            ],
            "type": "string",
            "description": "Idioma de las cabeceras del CSV y del Excel.",
            "default": "es"
          },
          "cacheMinutes": {
            "title": "Actualizar la fuente cada (minutos)",
            "minimum": 0,
            "type": "integer",
            "description": "Reutiliza la descarga reciente para reducir consultas a PLACSP. Usa 0 para consultar la fuente de nuevo.",
            "default": 60
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}