# Italy Public Administration Directory – PEC & e-Invoicing (`orchestrated_daffodil/italy-pa-directory`) Actor

Official directory of Italian public bodies from IndicePA (AgID): Comuni, ASL, schools, universities, ministries and their offices, with institutional PEC, website, fiscal code and Codice Univoco Ufficio for e-invoicing. No personal data.

- **URL**: https://apify.com/orchestrated_daffodil/italy-pa-directory.md
- **Developed by:** [Daffodil Data](https://apify.com/orchestrated_daffodil) (community)
- **Categories:** Lead generation, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 1,000 record returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Public Administration Directory – PEC & e-Invoicing Codes (IndicePA)

**What it does:** returns the official directory of Italian public administrations from IndicePA (AgID) – Comuni, ASL, schools, universities, ministries and their offices – with fiscal code, address, institutional PEC, website and the **Codice Univoco Ufficio (SDI code)** for e-invoicing. No personal data.

**What it costs:** **$0.002 per record** – **1,000 public bodies = $2**, 10,000 records = $20 – plus a $0.00005 start fee per run (Apify's standard start event). Silver plan users get 10% off and Gold plan users 20% off the record price. No subscription, no extra platform fees.

**Real output** (e-invoicing office of the Comune di Sanremo from a run on 19 November 2026, main fields only – full record in the [Output](#output) section):

```json
{
  "name": "Comune di Sanremo",
  "fiscalCode": "00253750087",
  "categoryName": "Comuni e loro Consorzi e Associazioni",
  "municipality": "Sanremo",
  "province": "IM",
  "region": "Liguria",
  "pec": "fatturapa.comune.sanremo@legalmail.it",
  "officeCode": "UF1U8R",
  "officeName": "Uff_eFatturaPA",
  "eInvoicingStartDate": "2015-03-31",
  "lastUpdated": "2026-02-12"
}
```

Get the **official list of Italian public administrations** – municipalities (Comuni), regions, provinces, ASL and hospitals, schools, universities, ministries, chambers of commerce, professional orders, contracting authorities and public-service companies – as a clean dataset (JSON, CSV, Excel) or via API.

For every body you get the **fiscal code, category, address, municipality / province / region, institutional PEC, website and social links**. Switch to **e-invoicing offices** to get the **Codice Univoco Ufficio (SDI code)** you need to send an electronic invoice (FatturaPA) to a public administration.

Data comes live from **IndicePA**, the official index of Italian public administrations run by AgID, published as open data under **CC BY 4.0**.

> Not affiliated with or endorsed by AgID. Data is retrieved from the public IndicePA open-data API.

### What can this Actor do?

- 🏛️ **~23,000 public bodies** (`entities`): Comuni, Regioni, ASL, schools, universities, ministries, ordini professionali, stazioni appaltanti…
- 🏢 **Offices / organisational units** (`offices`): departments of each body with office code, address, office phone and PEC
- 🧾 **E-invoicing offices** (`einvoicing`): **Codice Univoco Ufficio** for FatturaPA / SDI, invoicing fiscal code, e-invoicing start date, PEPPOL code
- 📍 **Location filters**: municipality, province (MI, RM, IM…) or region
- 🏷️ **Official categories**: e.g. only Comuni, only ASL, only state schools
- 🔎 **Name search** and **lookup by fiscal code, IPA code or office code**
- 🔒 **No personal data**: names, personal e-mails and phone numbers of officials are never exported

### Who is it for?

- **Suppliers of the public sector** who need the right **SDI code** and PEC to invoice a public body
- **B2G sales and marketing teams** building lists of target administrations (e.g. all Comuni in Lombardy, all ASL, all universities) with institutional contacts
- **Bid managers** enriching public tenders with the buyer's official data (works well with our [EU Public Tenders Scraper (TED)](https://apify.com/orchestrated_daffodil/eu-public-tenders-ted))
- **Accounting and ERP integrations** validating fiscal codes and office codes
- **Researchers, journalists and civic-tech projects** mapping Italian public administration
- **AI agents / RAG pipelines** that need structured, up-to-date data on Italian public bodies

### How to use

1. Choose **What to return**: public bodies, offices, or e-invoicing offices.
2. Optionally filter by **municipality, province or region**, **category**, and **name**.
3. Or look up specific bodies by **fiscal code**, **IPA code** or **office code**.
4. Set **Max records** and click **Start**. Download the results or connect them to Google Sheets, Make, Zapier, n8n or your CRM.

#### Input examples

All e-invoicing offices of the municipalities in the province of Imperia:

```json
{
  "dataset": "einvoicing",
  "provinces": ["IM"],
  "categories": ["L6"],
  "maxItems": 200
}
```

All local health authorities (ASL) in Lombardy:

```json
{ "dataset": "entities", "regions": ["Lombardia"], "categories": ["L7"] }
```

Find the SDI code of a body from its fiscal code:

```json
{ "dataset": "einvoicing", "fiscalCodes": ["00253750087"] }
```

### Output

Real record from a run of this Actor (e-invoicing office of the Comune di Sanremo, empty fields omitted):

```json
{
  "dataset": "einvoicing",
  "ipaCode": "c_i138",
  "name": "Comune di Sanremo",
  "acronym": null,
  "fiscalCode": "00253750087",
  "categoryCode": "L6",
  "categoryName": "Comuni e loro Consorzi e Associazioni",
  "type": "Pubbliche Amministrazioni",
  "atecoCode": null,
  "miurCode": null,
  "istatEntityCode": null,
  "inLiquidation": null,
  "address": "Corso Cavallotti 59",
  "postalCode": "18038",
  "municipality": "Sanremo",
  "province": "IM",
  "region": "Liguria",
  "istatMunicipalityCode": "008055",
  "cadastralCode": "I138",
  "pec": "fatturapa.comune.sanremo@legalmail.it",
  "emails": [
    {
      "address": "fatturapa.comune.sanremo@legalmail.it",
      "type": "Pec"
    }
  ],
  "website": null,
  "facebook": null,
  "linkedin": null,
  "twitter": null,
  "youtube": null,
  "officeCode": "UF1U8R",
  "officeName": "Uff_eFatturaPA",
  "parentOfficeCode": null,
  "aooCode": null,
  "phone": null,
  "invoicingFiscalCode": "00253750087",
  "eInvoicingStartDate": "2015-03-31",
  "peppolCode": null,
  "lastUpdated": "2026-02-12",
  "source": "IndicePA – Indice dei domicili digitali delle Pubbliche Amministrazioni (AgID), licence CC BY 4.0",
  "sourceUrl": "https://indicepa.gov.it/ipa-dati/"
}
```

| Field | Description |
|---|---|
| `name`, `fiscalCode`, `ipaCode` | Official name, fiscal code / VAT number and IndicePA code of the body |
| `categoryCode`, `categoryName`, `type` | Official IndicePA category (e.g. L6 = Comuni) and type |
| `address`, `postalCode`, `municipality`, `province`, `region` | Location (municipality, province and region from ISTAT) |
| `pec`, `emails` | Institutional PEC and other institutional addresses |
| `website`, `facebook`, `linkedin`, `twitter`, `youtube` | Official web presence (public bodies) |
| `officeCode`, `officeName` | Codice Univoco Ufficio and office name (offices / e-invoicing) |
| `invoicingFiscalCode`, `eInvoicingStartDate`, `peppolCode` | E-invoicing details |
| `lastUpdated` | Last update in IndicePA |

### Pricing

**Pay per result: $0.002 per record** ($2 per 1,000 records), plus $0.00005 per run start (Apify's synthetic `apify-actor-start` event, which also gives the run 5 seconds of free compute). Plan discounts: Silver $0.0018, Gold/Platinum $0.0016 per record. You pay only for records saved to the dataset – see the **Pricing** tab. The Actor uses a lightweight official API (no browser, no proxies), so runs finish in seconds: our test runs returned 100 public bodies in about 9 seconds and 101 e-invoicing offices in about 5 seconds.

### FAQ

**Is this data official and legal to reuse?**
Yes. IndicePA is the official index maintained by AgID, and its datasets are published as open data under the Creative Commons Attribution 4.0 licence. Please credit "IndicePA – AgID" when you republish the data.

**Does it include personal data?**
No. IndicePA also lists the names and contacts of the officials in charge; this Actor deliberately drops them, and also drops e-mail addresses that contain the official's surname. You get institutional data only. You remain responsible for using the data in line with GDPR and Italian law (for example, rules on unsolicited marketing to PEC addresses).

**How fresh is the data?**
The Actor queries IndicePA live on every run. IndicePA is updated by the administrations themselves; the `lastUpdated` field shows when each record last changed.

**Which code do I put in an electronic invoice?**
Use the `officeCode` of the `einvoicing` dataset (6 characters) as "Codice Destinatario". If a body has several e-invoicing offices, choose the one indicated in your contract or order; offices named "TEST" are test endpoints published by the body itself.

**Can I get all of Italy?**
Yes. Leave the location filters empty and raise **Max records** (about 23,000 public bodies; offices and e-invoicing offices are more numerous).

**Something is missing or wrong?**
Open an issue on the Actor page. If a record itself is wrong, it must be corrected by the administration in IndicePA.

# Actor input Schema

## `dataset` (type: `string`):

entities = public bodies (one row per administration). offices = organisational units (departments/offices) of each body. einvoicing = offices that receive electronic invoices, with their Codice Univoco Ufficio (SDI code).

## `search` (type: `string`):

Optional. Words that must appear in the body name (or office name for offices/e-invoicing), e.g. 'comune', 'ospedale', 'tributi', 'liceo'. Case-insensitive; all words must match.

## `municipalities` (type: `array`):

Optional. Official Italian municipality names, e.g. Sanremo, Milano, Roma. Case and accents are ignored.

## `provinces` (type: `array`):

Optional. Province codes (MI, RM, IM, TO…) or names (Milano, Imperia…).

## `regions` (type: `array`):

Optional. Region names, e.g. Lombardia, Lazio, Liguria, Sicilia.

## `categories` (type: `array`):

Optional. Official IndicePA categories (e.g. Comuni, ASL, schools, universities, stazioni appaltanti).

## `fiscalCodes` (type: `array`):

Optional. Look up specific bodies by their fiscal code / VAT number, e.g. 00253750087.

## `ipaCodes` (type: `array`):

Optional. IndicePA codes of the bodies, e.g. c_i138.

## `officeCodes` (type: `array`):

Optional, offices/e-invoicing only. Six-character office codes, e.g. UFXXXX.

## `excludeInLiquidation` (type: `boolean`):

Public bodies only: skip bodies flagged as in liquidation.

## `maxItems` (type: `integer`):

Maximum number of records to return (you are charged per record).

## Actor input object example

```json
{
  "dataset": "entities",
  "municipalities": [
    "Sanremo"
  ],
  "excludeInLiquidation": true,
  "maxItems": 100
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all matching IndicePA records

# 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 = {
    "municipalities": [
        "Sanremo"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("orchestrated_daffodil/italy-pa-directory").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 = { "municipalities": ["Sanremo"] }

# Run the Actor and wait for it to finish
run = client.actor("orchestrated_daffodil/italy-pa-directory").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 '{
  "municipalities": [
    "Sanremo"
  ]
}' |
apify call orchestrated_daffodil/italy-pa-directory --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,orchestrated_daffodil/italy-pa-directory"
        }
    }
}
```

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/VTh5utlwEvr0JxFhV/builds/QsgMSEFOMH2rmWkKi/openapi.json
