{
  "openapi": "3.0.1",
  "info": {
    "title": "Licitaciones públicas de España - open data (no oficial)",
    "description": "Licitaciones públicas de España desde el feed oficial de la PLACSP: registros tipados con objeto, estado, tipo de contrato, valor estimado, CPV, órgano de contratación, fechas y adjudicatario. CSV/Excel listos. No oficial: actor no afiliado a la PLACSP.",
    "version": "0.1",
    "x-build-id": "5VIuDhGJUTalEnoLc"
  },
  "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": "Only these tender statuses are returned. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Palabras clave (objeto)",
            "type": "array",
            "description": "Partial match on the tender object, ID or contracting authority (accents optional).",
            "items": {
              "type": "string"
            }
          },
          "cpvCodes": {
            "title": "Códigos CPV",
            "type": "array",
            "description": "Filter by CPV code (prefix match, e.g. '4523' = construcción).",
            "items": {
              "type": "string"
            }
          },
          "contractTypes": {
            "title": "Tipo de contrato",
            "type": "array",
            "description": "Filter by contract type code: 1=Suministros, 2=Servicios, 3=Obras.",
            "items": {
              "type": "string"
            }
          },
          "contractingAuthorities": {
            "title": "Órganos de contratación",
            "type": "array",
            "description": "Partial match on the contracting authority name or NIF.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Lugar de ejecución",
            "type": "array",
            "description": "Partial match on the region / NUTS code (e.g. Madrid, ES521).",
            "items": {
              "type": "string"
            }
          },
          "minValueEur": {
            "title": "Valor mínimo (EUR)",
            "type": "number",
            "description": "Only tenders with an estimated value at or above this."
          },
          "maxValueEur": {
            "title": "Valor máximo (EUR)",
            "type": "number",
            "description": "Only tenders with an estimated value at or below this."
          },
          "awardedOnly": {
            "title": "Solo licitaciones adjudicadas",
            "type": "boolean",
            "description": "Keep only tenders that already have an awardee.",
            "default": false
          },
          "maxResults": {
            "title": "Máximo de licitaciones",
            "minimum": 0,
            "type": "integer",
            "description": "Caps the run (and the pay-per-event cost). Leave empty or 0 for everything in the feed (the feed holds the most recent updates, up to ~500).",
            "default": 200
          },
          "exportFiles": {
            "title": "También guardar ficheros listos para abrir (CSV / XLSX)",
            "type": "array",
            "description": "Writes downloadable files to the run's key-value store: a standard CSV and an Excel workbook with money columns as real numbers, autofilter and a provenance sheet. Free - they do not add events.",
            "items": {
              "type": "string"
            },
            "default": [
              "csv",
              "xlsx"
            ]
          },
          "exportLanguage": {
            "title": "Idioma de los ficheros exportados",
            "enum": [
              "es",
              "en"
            ],
            "type": "string",
            "description": "Language of the exported files.",
            "default": "es"
          },
          "chargeReport": {
            "title": "Cobrar por el evento de informe",
            "type": "boolean",
            "description": "Adds the run-report event (aggregate statistics across the returned tenders).",
            "default": true
          },
          "cacheMinutes": {
            "title": "Cachear la fuente (minutos)",
            "type": "integer",
            "description": "Reuses a previously downloaded feed if it is younger than this. Keeps the load on the PLACSP endpoint low. Use 0 to always fetch fresh.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}