# Appalti pubblici Italia — affidamenti, vincitori, gare e bandi (`promptica/italy-procurement-all-in-one`) Actor

Un'unica ricerca sugli appalti dei Comuni italiani: affidamenti diretti con il vincitore, gare, bandi ancora aperti, PEC e link ufficiali ANAC.

- **URL**: https://apify.com/promptica/italy-procurement-all-in-one.md
- **Developed by:** [Lorenzo Talamucci](https://apify.com/promptica) (community)
- **Categories:** Lead generation, Business
- **Security:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Italy Procurement All-in-One — direct awards, winners, tenders and open calls

Search Italian municipal procurement (Comuni) in one run: **direct awards with the published winner, all procedure types, tenders still open for bids, buyer PEC and official ANAC links**. One row per CIG (the Italian contract ID), deduplicated across sources, with the source and check date of every field.

Built for suppliers to the Italian public sector, bid consultants and market analysts who need to know *who bought what, from whom, for how much — and which calls they can still answer today*.

### What you get

- **Historical purchases**: direct awards and procedures from ANAC open data (CIG and SmartCIG), about 3.58 million procedure records classified by type.
- **Winners**: awardee name and tax ID where ANAC, municipal L.190 transparency files or award decisions publish them. Missing winners stay empty with the reason; nothing is guessed from participants.
- **Open calls**: tenders whose offer deadline has not passed (about 5,200 at any time), from ANAC Pubblicità Legale, with estimated value, deadline and documents. Expired deadlines are re-checked and removed during the run.
- **Buyer contacts**: PEC, address and website from the IPA public register.
- **Platform**: MePA / SINTEL attribution when published.

Every main field comes with `*_source`, `*_source_url`, `*_checked_at` and `*_unavailable_reason`, so each value can be checked by hand on the official page.

### Input example

```json
{
  "keywords": ["bagni chimici", "servizi igienici mobili"],
  "region": "Lazio",
  "types": ["affidamenti", "gare", "bandi_aperti"],
  "maxResults": 1000
}
```

- `keywords`: exact phrases in the subject, OR between phrases (no hidden synonyms).
- `region`, `province`, `municipality`: geography (municipality by name or IPA tax code).
- `cpvCodes` with `cpvMatch` `exact` or `prefix`.
- `dateFrom` / `dateTo` on `record_date`, `publication_date`, `award_date` or `deadline`.
- `types`: `affidamenti` (direct awards), `gare` (all procedures), `bandi_aperti` (open calls).
- `onlyWithWinner`: only rows with a named awardee.

Filters combine with AND. A historical search needs at least one filter (keywords, CPV, place or period); `bandi_aperti` alone can list every open call.

### Output

One dataset row per CIG with `record_type` = `direct_award`, `procedure` or `open_tender`; title, buyer, CPV, procedure type, amounts (`estimated_value_eur`, `tender_amount_eur`, `award_amount_eur` kept separate), dates, deadline, winner entities, documents and source links. The `OUTPUT` record in the key-value store holds the run manifest: snapshot total, rows emitted, data generation, component freshness and any warning.

### Coverage and limits

- Data is refreshed every night from ANAC and Pubblicità Legale; a failed update keeps the previous generation and the manifest says how fresh each component is.
- Small direct awards from 2024 onward (SmartCIG) often have **no public winner** in any official source without captcha: they are returned with the winner empty and the reason.
- Tender base amounts are published in structured form only for a minority of open calls; the estimated value is always kept separate.
- Invalid input, an empty search or an unavailable source end the run normally with a status message and zero rows, never a failed run.

### Pricing

Pay per event: a small start fee per run and a fee per result row. You only pay for rows written to the dataset; `maxResults` caps your spend. See the Pricing tab for current prices.

***

### Italiano

Una sola ricerca sugli appalti dei Comuni italiani: **affidamenti diretti con il vincitore pubblicato, gare di ogni procedura, bandi ancora aperti, PEC dell'ente e link ufficiali ANAC**. Una riga per CIG, senza doppioni fra le fonti, con fonte e data di controllo di ogni campo.

Per i fornitori della PA, i consulenti gare e chi analizza il mercato pubblico: chi ha comprato cosa, da chi, a quanto, e a quali bandi si può ancora partecipare oggi.

- **Storico**: affidamenti e procedure dagli open data ANAC (CIG e SmartCIG), circa 3,58 milioni di procedure classificate.
- **Vincitori**: nome e codice fiscale dove ANAC, i file L.190 dei Comuni o le determine li pubblicano. Se mancano, il campo resta vuoto con il motivo.
- **Bandi aperti**: circa 5.200 bandi con termine ancora valido, da Pubblicità Legale ANAC, con valore stimato, scadenza e documenti.
- **Contatti dell'ente**: PEC, indirizzo e sito dal registro IPA.

Limite dichiarato: per molti affidamenti diretti piccoli dal 2024 (SmartCIG) il vincitore non è pubblicato in nessuna fonte ufficiale consultabile senza captcha.

Dati aggiornati ogni notte. Input non valido o fonte non disponibile: la run termina regolarmente con un messaggio di stato e zero righe.

Dettagli tecnici, gate e prove: [TECNICO.md](TECNICO.md).

# Actor input Schema

## `keywords` (type: `array`):

OR fra frasi esatte nell’oggetto; massimo 12 frasi, 8 parole ciascuna. Nessuna espansione automatica.

## `region` (type: `string`):

Nome della regione IPA; si combina con gli altri filtri.

## `province` (type: `string`):

Nome o sigla della provincia IPA.

## `municipality` (type: `string`):

CF IPA consigliato; nome ammesso se univoco.

## `cpvCodes` (type: `array`):

Codici di 8 cifre con eventuale cifra di controllo, oppure prefissi se cpvMatch=prefix.

## `cpvMatch` (type: `string`):

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.

## `dateFrom` (type: `string`):

YYYY-MM-DD, incluso; righe senza la data richiesta sono escluse.

## `dateTo` (type: `string`):

YYYY-MM-DD, incluso.

## `dateField` (type: `string`):

La stessa data vale per tutti i tipi. Timestamp con fuso confrontati per giorno UTC.

## `types` (type: `array`):

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).

## `onlyWithWinner` (type: `boolean`):

Richiede un aggiudicatario nominativo verificato; può escludere tutti i bandi non ancora aggiudicati.

## `maxResults` (type: `integer`):

Numero massimo di righe nel dataset (una riga per CIG). / Maximum dataset rows, one per CIG.

## `pageSize` (type: `integer`):

Righe chieste al servizio per ogni pagina; il valore predefinito va bene quasi sempre. / Rows per service page.

## `indexUrl` (type: `string`):

HTTPS dell’indice condiviso. Il candidato richiede /premium/search, da attivare con ok della regia.

## Actor input object example

```json
{
  "keywords": [
    "bagni chimici"
  ],
  "cpvMatch": "exact",
  "dateField": "record_date",
  "types": [
    "affidamenti",
    "gare",
    "bandi_aperti"
  ],
  "onlyWithWinner": false,
  "maxResults": 1000,
  "pageSize": 500,
  "indexUrl": "https://affidamenti.57-129-163-168.sslip.io"
}
```

# Actor output Schema

## `items` (type: `string`):

No description

## `manifest` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keywords": [
        "bagni chimici"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("promptica/italy-procurement-all-in-one").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "keywords": ["bagni chimici"] }

# Run the Actor and wait for it to finish
run = client.actor("promptica/italy-procurement-all-in-one").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keywords": [
    "bagni chimici"
  ]
}' |
apify call promptica/italy-procurement-all-in-one --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,promptica/italy-procurement-all-in-one"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/NgbqlYIDkkam9wDha/builds/XxI4kFi4pIENfLqlk/openapi.json
