API Documentation
Programmatically access all data on Italy's 7,896 municipalities. Free REST API, no authentication required.
No Auth
Free public API β start immediately, no API key needed
7,896 Municipalities
Complete data on all Italian municipalities, updated 2025
CDN Cache
Responses cached 1h, stale-while-revalidate for performance
Overview
The DatiItalia API provides access to open data on Italian municipalities from ISTAT, MEF and ISPRA. All data is updated to the latest official releases: ISTAT 2025 (demographics), MEF 2023 (income), ISPRA 2024 (land), EEA 2022 (air).
Tip
All endpoints return JSON. Responses are cached for 1 hour to optimize performance.
π Municipalities
Endpoints to access registry data of Italian municipalities.
/api/comuniReturns the list of all 7,896 Italian municipalities with ISTAT code, name, province and region.
Parameters
| Parameter | Type | Description |
|---|---|---|
regione | string | Filter by region name (e.g., "Lombardia") |
provincia | string | Filter by province abbreviation (e.g., "MI") |
limit | integer | Maximum number of results (default: 100, max: 1000) |
offset | integer | Offset for pagination (default: 0) |
/api/comuni/{codice_istat}Returns the complete details of a single municipality identified by ISTAT code.
Parameters
| Parameter | Type | Description |
|---|---|---|
codice_istatrequired | string | Municipality ISTAT code (6 digits, e.g., "015146") |
/api/comuni/cercaSearch municipalities by name. Returns up to 10 results sorted by relevance. Ideal for autocomplete.
Parameters
| Parameter | Type | Description |
|---|---|---|
qrequired | string | Search query (minimum 2 characters) |
π₯ Demographics
Demographic data: population, density, historical trends.
/api/demografia/{codice_istat}Complete demographic data of a municipality: total, male, female population, births, deaths.
Parameters
| Parameter | Type | Description |
|---|---|---|
codice_istatrequired | string | Municipality ISTAT code |
anno | integer | Specific year (optional) |
/api/demografia/classifica/{indicatore}Rank municipalities by demographic indicator.
Parameters
| Parameter | Type | Description |
|---|---|---|
indicatorerequired | string | popolazione | densita |
ordine | string | desc (default) | asc |
limit | integer | Default: 50, max: 500 |
offset | integer | Offset for pagination |
πΆ Income
MEF income data: average income, median, number of taxpayers per municipality.
/api/redditi/{codice_istat}Income data of a municipality: average income, median, number of taxpayers, income brackets.
Parameters
| Parameter | Type | Description |
|---|---|---|
codice_istatrequired | string | Municipality ISTAT code |
anno | integer | Specific year (optional) |
/api/redditi/classifica/{indicatore}Rank municipalities by income.
Parameters
| Parameter | Type | Description |
|---|---|---|
indicatorerequired | string | reddito | contribuenti |
ordine | string | desc (default) | asc |
limit | integer | Default: 50, max: 500 |
π± Environment
ISPRA data: air quality and land consumption.
/api/ambiente/{codice_istat}Environmental data of a municipality: air quality (PM10, PM2.5, NO2, ozone) and land consumption.
Parameters
| Parameter | Type | Description |
|---|---|---|
codice_istatrequired | string | Municipality ISTAT code |
/api/ambiente/aria/classificaRank municipalities by air quality (PM2.5, PM10, NO2).
Parameters
| Parameter | Type | Description |
|---|---|---|
indicatore | string | pm10 | pm25 | no2 |
order | string | asc (default) | desc |
limit | integer | Number of results |
/api/ambiente/suolo/classificaRank municipalities by land consumption.
Parameters
| Parameter | Type | Description |
|---|---|---|
order | string | asc | desc (default) |
limit | integer | Number of results |
β Quality of Life
Composite quality of life index and search wizard.
/api/qualita-vita/classificaRank municipalities by quality of life index (composite: income 30%, environment 25%, services 20%, demographics 15%, safety 10%).
Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results |
offset | integer | Offset for pagination |
regione | string | Filter by region |
min_pop | integer | Minimum population |
max_pop | integer | Maximum population |
/api/qualita-vita/wizardWizard to find the most suitable municipalities based on personal preferences.
Parameters
| Parameter | Type | Description |
|---|---|---|
budgetrequired | string | basso | medio | alto |
dimensionerequired | string | piccolo (<5k) | medio (5-50k) | grande (>50k) |
prioritarequired | string | reddito | ambiente | servizi | bilanciato |
regione | string | Filter by region (optional) |
βοΈ Compare
Compare data across multiple municipalities simultaneously.
/api/confrontaCompare demographic and income data of multiple municipalities.
Parameters
| Parameter | Type | Description |
|---|---|---|
comunirequired | string | ISTAT codes separated by comma (max 4) |
anno | integer | Reference year |
/api/confronta/nazionale-medieReturns national averages for comparison.
Parameters
| Parameter | Type | Description |
|---|---|---|
anno | integer | Reference year (optional) |
Code Examples
# Cerca comune curl "https://datitalia.eu/api/comuni/cerca?q=Roma" # Dettaglio comune curl "https://datitalia.eu/api/comuni/058091" # Dati demografici curl "https://datitalia.eu/api/demografia/058091" # Classifica per densita curl "https://datitalia.eu/api/demografia/classifica/densita?limit=20" # Confronta comuni curl "https://datitalia.eu/api/confronta?comuni=058091,015146,006056"
Limits & Cache
Fair Use
The API is free for personal and commercial use. Please don't abuse it: if you expect >10k requests/day, contact us.
Cache Headers
All responses include Cache-Control headers to optimize performance:
Cache-Control: public, max-age=3600, stale-while-revalidate=86400
Rate Limiting
Currently no strict rate limit, but abusive requests will be blocked. Use the If-None-Match header for conditional requests if supported by your client.