{
  "openapi": "3.0.1",
  "info": {
    "title": "Scraper API Gare e Appalti Pubblici Italiani",
    "description": "Trova bandi di gara, appalti pubblici, avvisi e opportunità aperte in Italia dalla fonte ufficiale ANAC, in un unico output JSON normalizzato. Veloce, economico e affidabile. (Italian public tenders scraper)",
    "version": "0.5",
    "x-build-id": "R2vAwDZWl4OHEOfE2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lofomachines~italian-public-tenders-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lofomachines-italian-public-tenders-scraper",
        "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/lofomachines~italian-public-tenders-scraper/runs": {
      "post": {
        "operationId": "runs-sync-lofomachines-italian-public-tenders-scraper",
        "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/lofomachines~italian-public-tenders-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-lofomachines-italian-public-tenders-scraper",
        "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": "Inserisci una o più parole chiave (in blocco, una per riga). Ogni parola chiave viene cercata separatamente nei bandi ufficiali ANAC e il limite 'Numero massimo di gare' vale per ciascuna. Esempi: software, manutenzione, mensa scolastica, pulizia. Lascia vuoto per scaricare tutte le opportunità aperte.",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Stato",
            "enum": [
              "open",
              "all"
            ],
            "type": "string",
            "description": "Mantieni solo le opportunità ancora aperte oppure restituisci ogni avviso trovato.",
            "default": "open"
          },
          "contractCategory": {
            "title": "Categoria del contratto",
            "enum": [
              "all",
              "supplies",
              "services",
              "works",
              "mixed",
              "other"
            ],
            "type": "string",
            "description": "Filtra per natura dell'appalto.",
            "default": "all"
          },
          "noticeTypes": {
            "title": "Tipi di avviso",
            "enum": [
              "all_open_tenders",
              "bandi_only",
              "pre_information_only",
              "market_investigations_only",
              "operator_lists_only",
              "all_notice_types"
            ],
            "type": "string",
            "description": "Quali tipologie di avviso ANAC includere nella ricerca.",
            "default": "all_open_tenders"
          },
          "sortBy": {
            "title": "Ordina i risultati per",
            "enum": [
              "publicationDesc",
              "publicationAsc",
              "deadlineAsc",
              "deadlineDesc",
              "relevance"
            ],
            "type": "string",
            "description": "Come ordinare l'output finale. Gli avvisi vengono sempre recuperati dai più recenti, poi riordinati secondo questa scelta: con un limite (Numero massimo di gare) ottieni quindi gli avvisi più recenti riordinati come preferisci.",
            "default": "publicationDesc"
          },
          "maxItems": {
            "title": "Numero massimo di gare (per ogni parola chiave)",
            "minimum": 0,
            "type": "integer",
            "description": "Numero massimo di gare restituite PER OGNI parola chiave. Con 2 parole chiave e valore 100 puoi ottenere fino a 200 gare totali (i duplicati tra parole chiave vengono salvati una sola volta). Usa 0 per restituire tutte le gare trovate per ogni parola chiave.",
            "default": 0
          },
          "includeNoticeHistory": {
            "title": "Includi la cronologia dell'avviso",
            "type": "boolean",
            "description": "Aggiunge la cronologia degli avvisi correlati. Aumenta i tempi e i costi del run (una chiamata in più per gara). Lascia disattivato per il massimo della velocità.",
            "default": false
          },
          "includeRawDetails": {
            "title": "Includi i dati grezzi della fonte",
            "type": "boolean",
            "description": "Conserva i payload originali ANAC e le sezioni di dettaglio in ogni risultato. Aumenta la dimensione del dataset; lascia disattivato per un output più snello ed economico.",
            "default": false
          },
          "referenceDate": {
            "title": "Data di riferimento",
            "type": "string",
            "description": "Data usata per stabilire se una gara è ancora aperta. Lascia vuoto per usare la data odierna (fuso Europe/Rome)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}