API Documentation

Programmatically access all data on Italy's 7,896 municipalities. Free REST API, no authentication required.

Base URL: https://datitalia.eu/api
⚑

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.

GET/api/comuni

Returns the list of all 7,896 Italian municipalities with ISTAT code, name, province and region.

Parameters

ParameterTypeDescription
regionestringFilter by region name (e.g., "Lombardia")
provinciastringFilter by province abbreviation (e.g., "MI")
limitintegerMaximum number of results (default: 100, max: 1000)
offsetintegerOffset for pagination (default: 0)
Try in browser
GET/api/comuni/{codice_istat}

Returns the complete details of a single municipality identified by ISTAT code.

Parameters

ParameterTypeDescription
codice_istatrequiredstringMunicipality ISTAT code (6 digits, e.g., "015146")
GET/api/comuni/cerca

Search municipalities by name. Returns up to 10 results sorted by relevance. Ideal for autocomplete.

Parameters

ParameterTypeDescription
qrequiredstringSearch query (minimum 2 characters)
Try in browser

πŸ‘₯ Demographics

Demographic data: population, density, historical trends.

GET/api/demografia/{codice_istat}

Complete demographic data of a municipality: total, male, female population, births, deaths.

Parameters

ParameterTypeDescription
codice_istatrequiredstringMunicipality ISTAT code
annointegerSpecific year (optional)
GET/api/demografia/classifica/{indicatore}

Rank municipalities by demographic indicator.

Parameters

ParameterTypeDescription
indicatorerequiredstringpopolazione | densita
ordinestringdesc (default) | asc
limitintegerDefault: 50, max: 500
offsetintegerOffset for pagination

πŸ’Ά Income

MEF income data: average income, median, number of taxpayers per municipality.

GET/api/redditi/{codice_istat}

Income data of a municipality: average income, median, number of taxpayers, income brackets.

Parameters

ParameterTypeDescription
codice_istatrequiredstringMunicipality ISTAT code
annointegerSpecific year (optional)
GET/api/redditi/classifica/{indicatore}

Rank municipalities by income.

Parameters

ParameterTypeDescription
indicatorerequiredstringreddito | contribuenti
ordinestringdesc (default) | asc
limitintegerDefault: 50, max: 500

🌱 Environment

ISPRA data: air quality and land consumption.

GET/api/ambiente/{codice_istat}

Environmental data of a municipality: air quality (PM10, PM2.5, NO2, ozone) and land consumption.

Parameters

ParameterTypeDescription
codice_istatrequiredstringMunicipality ISTAT code
GET/api/ambiente/aria/classifica

Rank municipalities by air quality (PM2.5, PM10, NO2).

Parameters

ParameterTypeDescription
indicatorestringpm10 | pm25 | no2
orderstringasc (default) | desc
limitintegerNumber of results
Try in browser
GET/api/ambiente/suolo/classifica

Rank municipalities by land consumption.

Parameters

ParameterTypeDescription
orderstringasc | desc (default)
limitintegerNumber of results
Try in browser

⭐ Quality of Life

Composite quality of life index and search wizard.

GET/api/qualita-vita/classifica

Rank municipalities by quality of life index (composite: income 30%, environment 25%, services 20%, demographics 15%, safety 10%).

Parameters

ParameterTypeDescription
limitintegerNumber of results
offsetintegerOffset for pagination
regionestringFilter by region
min_popintegerMinimum population
max_popintegerMaximum population
Try in browser
GET/api/qualita-vita/wizard

Wizard to find the most suitable municipalities based on personal preferences.

Parameters

ParameterTypeDescription
budgetrequiredstringbasso | medio | alto
dimensionerequiredstringpiccolo (<5k) | medio (5-50k) | grande (>50k)
prioritarequiredstringreddito | ambiente | servizi | bilanciato
regionestringFilter by region (optional)
Try in browser

βš–οΈ Compare

Compare data across multiple municipalities simultaneously.

GET/api/confronta

Compare demographic and income data of multiple municipalities.

Parameters

ParameterTypeDescription
comunirequiredstringISTAT codes separated by comma (max 4)
annointegerReference year
Try in browser
GET/api/confronta/nazionale-medie

Returns national averages for comparison.

Parameters

ParameterTypeDescription
annointegerReference year (optional)
Try in browser

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.