{
  "openapi": "3.0.1",
  "info": {
    "title": "Appalti pubblici Italia — affidamenti, vincitori, gare e bandi",
    "description": "Un'unica ricerca sugli appalti dei Comuni italiani: affidamenti diretti con il vincitore, gare, bandi ancora aperti, PEC e link ufficiali ANAC.",
    "version": "0.1",
    "x-build-id": "XxI4kFi4pIENfLqlk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/promptica~italy-procurement-all-in-one/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-promptica-italy-procurement-all-in-one",
        "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/promptica~italy-procurement-all-in-one/runs": {
      "post": {
        "operationId": "runs-sync-promptica-italy-procurement-all-in-one",
        "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/promptica~italy-procurement-all-in-one/run-sync": {
      "post": {
        "operationId": "run-sync-promptica-italy-procurement-all-in-one",
        "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": {
          "keywords": {
            "title": "Parole chiave",
            "type": "array",
            "description": "OR fra frasi esatte nell’oggetto; massimo 12 frasi, 8 parole ciascuna. Nessuna espansione automatica.",
            "items": {
              "type": "string"
            }
          },
          "region": {
            "title": "Regione",
            "type": "string",
            "description": "Nome della regione IPA; si combina con gli altri filtri."
          },
          "province": {
            "title": "Provincia",
            "type": "string",
            "description": "Nome o sigla della provincia IPA."
          },
          "municipality": {
            "title": "Comune",
            "type": "string",
            "description": "CF IPA consigliato; nome ammesso se univoco."
          },
          "cpvCodes": {
            "title": "Codici CPV",
            "type": "array",
            "description": "Codici di 8 cifre con eventuale cifra di controllo, oppure prefissi se cpvMatch=prefix.",
            "items": {
              "type": "string"
            }
          },
          "cpvMatch": {
            "title": "Corrispondenza CPV",
            "enum": [
              "exact",
              "prefix"
            ],
            "type": "string",
            "description": "Come confrontare i codici CPV: 'exact' (codice uguale) o 'prefix' (il codice inizia con quello indicato, 2-8 cifre). / How CPV codes are matched: exact or prefix.",
            "default": "exact"
          },
          "dateFrom": {
            "title": "Dal",
            "type": "string",
            "description": "YYYY-MM-DD, incluso; righe senza la data richiesta sono escluse."
          },
          "dateTo": {
            "title": "Al",
            "type": "string",
            "description": "YYYY-MM-DD, incluso."
          },
          "dateField": {
            "title": "Data del periodo",
            "enum": [
              "record_date",
              "publication_date",
              "award_date",
              "deadline"
            ],
            "type": "string",
            "description": "La stessa data vale per tutti i tipi. Timestamp con fuso confrontati per giorno UTC.",
            "default": "record_date"
          },
          "types": {
            "title": "Tipi",
            "type": "array",
            "description": "Cosa includere, uno o più fra: affidamenti, gare, bandi_aperti (predefinito: tutti). Una riga per CIG, senza doppioni. / What to include: affidamenti (direct awards), gare (all other procedures), bandi_aperti (open tenders).",
            "items": {
              "type": "string"
            },
            "default": [
              "affidamenti",
              "gare",
              "bandi_aperti"
            ]
          },
          "onlyWithWinner": {
            "title": "Solo con vincitore",
            "type": "boolean",
            "description": "Richiede un aggiudicatario nominativo verificato; può escludere tutti i bandi non ancora aggiudicati.",
            "default": false
          },
          "maxResults": {
            "title": "Massimo risultati",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Numero massimo di righe nel dataset (una riga per CIG). / Maximum dataset rows, one per CIG.",
            "default": 1000
          },
          "pageSize": {
            "title": "Dimensione pagina",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Righe chieste al servizio per ogni pagina; il valore predefinito va bene quasi sempre. / Rows per service page.",
            "default": 500
          },
          "indexUrl": {
            "title": "Servizio condiviso",
            "type": "string",
            "description": "HTTPS dell’indice condiviso. Il candidato richiede /premium/search, da attivare con ok della regia.",
            "default": "https://affidamenti.57-129-163-168.sslip.io"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}