{
  "openapi": "3.0.1",
  "info": {
    "title": "ANAC Italy Public Procurement Scraper - Tenders & Awards",
    "description": "Italian public tenders (CIG), awards, bidders, subcontracts, contract lifecycle, 48k contracting authorities, SOA certificates and OCDS releases from ANAC open data.",
    "version": "0.1",
    "x-build-id": "TP266mNidmN9OkBnh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parseforge~anac-italy-procurement-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parseforge-anac-italy-procurement-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/parseforge~anac-italy-procurement-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parseforge-anac-italy-procurement-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/parseforge~anac-italy-procurement-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parseforge-anac-italy-procurement-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",
        "required": [
          "collections"
        ],
        "properties": {
          "collections": {
            "title": "Collections",
            "type": "array",
            "description": "Which ANAC tables to pull. Tenders (CIG) is the core one — every other procurement table joins to it on the `cig` field. Each collection bills its own event, so pick only what you need.",
            "items": {
              "type": "string",
              "enum": [
                "datasets",
                "resources",
                "organizations",
                "groups",
                "tags",
                "reference-codes",
                "tenders",
                "smart-tenders",
                "awards",
                "winners",
                "participants",
                "contract-start",
                "contract-end",
                "testing",
                "suspensions",
                "progress-reports",
                "variants",
                "subcontracts",
                "economic-framework",
                "funding-sources",
                "publications",
                "work-types",
                "work-categories",
                "dpcm-categories",
                "contracting-authorities",
                "cost-centres",
                "cup-links",
                "pnrr-indicators",
                "soa-certificates",
                "soa-categories",
                "ocds-releases"
              ],
              "enumTitles": [
                "Catalogue datasets",
                "Catalogue distributions",
                "Publishing organisations",
                "Themes",
                "Tags and vocabularies",
                "Reference code tables",
                "Tenders (CIG)",
                "Simplified tenders (SmartCIG)",
                "Awards",
                "Winning operators",
                "Bidders",
                "Contract start",
                "Contract end",
                "Final testing",
                "Suspensions",
                "Progress reports (SAL)",
                "Contract variations",
                "Subcontracts",
                "Economic framework",
                "Funding sources",
                "Publication dates",
                "Work types",
                "Work categories (SOA)",
                "DPCM aggregation categories",
                "Contracting authorities",
                "Cost centres",
                "CIG to CUP links",
                "PNRR indicators",
                "SOA certificates",
                "SOA certificate categories",
                "OCDS releases"
              ]
            },
            "default": [
              "tenders"
            ]
          },
          "snapshot": {
            "title": "Which files to read",
            "enum": [
              "period",
              "latest-update",
              "full"
            ],
            "type": "string",
            "description": "**Selected period** reads the per-month archives for the years below — the only way to reach history. **Latest monthly update** reads the newest incremental file ANAC published. **Full snapshot** reads the complete table (large; not published for tenders and SmartCIG, which fall back to the latest update).",
            "default": "period"
          },
          "years": {
            "title": "Years",
            "type": "array",
            "description": "Years to read when the mode above is *Selected period*. Tenders go back to 2007, SmartCIG to 2011, OCDS releases to 2018.",
            "items": {
              "type": "string",
              "enum": [
                "2007",
                "2008",
                "2009",
                "2010",
                "2011",
                "2012",
                "2013",
                "2014",
                "2015",
                "2016",
                "2017",
                "2018",
                "2019",
                "2020",
                "2021",
                "2022",
                "2023",
                "2024",
                "2025",
                "2026"
              ],
              "enumTitles": [
                "2007",
                "2008",
                "2009",
                "2010",
                "2011",
                "2012",
                "2013",
                "2014",
                "2015",
                "2016",
                "2017",
                "2018",
                "2019",
                "2020",
                "2021",
                "2022",
                "2023",
                "2024",
                "2025",
                "2026"
              ]
            },
            "default": [
              "2025"
            ]
          },
          "months": {
            "title": "Months",
            "type": "array",
            "description": "Months to read within each year. Leave empty for all twelve. Only tenders, SmartCIG and OCDS are split by month; the other tables ignore this.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12"
              ],
              "enumTitles": [
                "January",
                "February",
                "March",
                "April",
                "May",
                "June",
                "July",
                "August",
                "September",
                "October",
                "November",
                "December"
              ]
            },
            "default": [
              "1"
            ]
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 5000000,
            "type": "integer",
            "description": "Hard cap on rows written across every collection. The download stops the moment the cap is met, so a small cap costs a small transfer even on a 200 MB archive.",
            "default": 1000
          },
          "maxItemsPerCollection": {
            "title": "Max rows per collection",
            "minimum": 1,
            "maximum": 5000000,
            "type": "integer",
            "description": "Optional per-collection cap, so one huge table cannot eat the whole budget when several are selected."
          },
          "searchTerms": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep rows whose subject, supplier or buyer name contains any of these (case-insensitive substring). Example: `fotovoltaico`, `ambulanza`.",
            "items": {
              "type": "string"
            }
          },
          "cigs": {
            "title": "CIG codes",
            "type": "array",
            "description": "Keep only these tender identifiers. Works across every procurement table, which is how you assemble the full lifecycle of one contract.",
            "items": {
              "type": "string"
            }
          },
          "fiscalCodes": {
            "title": "Fiscal codes / VAT numbers",
            "type": "array",
            "description": "Keep rows where any party — buyer, winner, bidder, subcontractor — carries one of these codice fiscale or partita IVA values. Punctuation and country prefixes are ignored.",
            "items": {
              "type": "string"
            }
          },
          "cpvCodes": {
            "title": "CPV codes",
            "type": "array",
            "description": "Common Procurement Vocabulary prefixes, matched from the left. `45` keeps all construction, `45112000-5` keeps just that class.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Italian region names, matched against the ANAC regional section. Example: `LOMBARDIA`, `SICILIA`.",
            "items": {
              "type": "string"
            }
          },
          "provinces": {
            "title": "Provinces",
            "type": "array",
            "description": "Province name or ISO code. Example: `MILANO`, `IT-MI`.",
            "items": {
              "type": "string"
            }
          },
          "sectors": {
            "title": "Contract sector",
            "type": "array",
            "description": "The main object of the contract.",
            "items": {
              "type": "string",
              "enum": [
                "LAVORI",
                "SERVIZI",
                "FORNITURE"
              ],
              "enumTitles": [
                "Works (lavori)",
                "Services (servizi)",
                "Supplies (forniture)"
              ]
            }
          },
          "procedureTypes": {
            "title": "Procedure types",
            "type": "array",
            "description": "Award procedure, by ANAC code or by name. Example: `AFFIDAMENTO DIRETTO`, `PROCEDURA APERTA`, or the numeric code `24`. Read the `reference-codes` collection for the full table.",
            "items": {
              "type": "string"
            }
          },
          "statuses": {
            "title": "Status",
            "type": "array",
            "description": "Record status, matched as a substring. Example: `ATTIVO`, `SCADUTO`.",
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Minimum amount (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Drops rows whose contract or award value is below this. Rows with no monetary field are dropped too."
          },
          "maxAmount": {
            "title": "Maximum amount (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Drops rows whose contract or award value is above this."
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "ISO date. Filters on the row's own publication, communication or award date."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "ISO date, inclusive."
          },
          "onlyPnrr": {
            "title": "Only PNRR / PNC contracts",
            "type": "boolean",
            "description": "Keep only tenders funded by Italy's Recovery and Resilience Plan.",
            "default": false
          },
          "onlySingleBid": {
            "title": "Only single-bid awards",
            "type": "boolean",
            "description": "Keep only awards that drew exactly one bidder — the standard first red flag in competition analysis.",
            "default": false
          },
          "excludeCancelled": {
            "title": "Exclude cancelled records",
            "type": "boolean",
            "description": "Drop tenders carrying a cancellation date or reason.",
            "default": false
          },
          "catalogQuery": {
            "title": "Catalogue search",
            "type": "string",
            "description": "Full-text query passed to CKAN when scraping the catalogue collections (datasets, distributions). Solr syntax works."
          },
          "catalogGroups": {
            "title": "Catalogue themes",
            "type": "array",
            "description": "Restrict catalogue results to these DCAT theme groups.",
            "items": {
              "type": "string",
              "enum": [
                "agricoltura",
                "ambiente",
                "cultura",
                "economia",
                "energia",
                "giustizia",
                "governo",
                "internazionali",
                "regioni",
                "salute",
                "scienza",
                "societa",
                "trasporti"
              ],
              "enumTitles": [
                "Agricoltura",
                "Ambiente",
                "Cultura",
                "Economia",
                "Energia",
                "Giustizia",
                "Governo",
                "Internazionali",
                "Regioni",
                "Salute",
                "Scienza",
                "Società",
                "Trasporti"
              ]
            }
          },
          "catalogFormats": {
            "title": "Catalogue formats",
            "type": "array",
            "description": "Restrict catalogue results to datasets publishing these distribution formats.",
            "items": {
              "type": "string",
              "enum": [
                "CSV",
                "JSON",
                "TTL"
              ],
              "enumTitles": [
                "CSV",
                "JSON",
                "RDF Turtle"
              ]
            }
          },
          "includeRawColumns": {
            "title": "Include untouched source columns",
            "type": "boolean",
            "description": "Adds a `raw` object holding every column exactly as ANAC wrote it, alongside the typed fields. Roughly doubles row size.",
            "default": false
          },
          "includeOcdsRelease": {
            "title": "Include the full OCDS release object",
            "type": "boolean",
            "description": "Keeps the complete OCDS 1.1 release under `release`. Turn off for a flat summary row. Releases over 512 KB are dropped either way and flagged with `releaseTruncated`.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "**Keep this on.** The ANAC portal's WAF blocks the Apify platform's own IP range with HTTP 403, so a run without a proxy returns nothing. Apify's datacenter proxy is enough — residential is not needed.",
            "default": {
              "useApifyProxy": true
            }
          },
          "timeoutSecs": {
            "title": "Scraping time budget",
            "minimum": 30,
            "maximum": 86400,
            "type": "integer",
            "description": "Seconds the actor may spend fetching before it flushes and exits cleanly. Kept under the run timeout so a long run still returns what it has.",
            "default": 1500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}