Italian "regioni", "province", municipality data, zip codes and Istat Codes always in sync in your application with this brand new APIs
Every year for administrative and demografic reasons, italians public administation use to make little adjustments on his "N.U.T.S." structures. Some time the municipalities structure change too. Some time a municipality is assigned to an another province, some other the change is made on the ZIP code or, as is called in Italy CAP (codice avviamento postale), to fit the new structures or in reply to a postal specific organizing need. For example in 2020 6 merge of municipalities are made for a total abolition of 14 municipalities and 1 new municipality is born called "Borgo d'Anaunia". The same year, on may, only in province of Milano (MI) 40 changes on ZIP codes are made and other affected cities are Bari, Cagliari, Catania, Cesena, Firenze, Livorno, Messina, Milano, Palermo, Parma, Pescara, Reggio Calabria, Rimini, Roma e Trento.
Changes mades allows users to a grace period of 6 months but after that a letter sent to an old zip code or to a non more existent municipality will not be delivered.
Since there isn't a real open data available for this issue, we have createde the new "Comuni Italiani" service: https://console.openapi.com/apis/cap/documentation
Is a super fast service that allow you to query by Province, Region, Istat Code, CAP and obtain a detailed structure of italian municipalities theire and relative zip code associated.
Its use is easy as it seems.
Assuming you are looking for all the municipalities under a specific CAP (05100 for example), you can query the service in a single GET call (once you obtained your bearer token) to https://cap.openapi.it/cap/05100 and you will get a response as follows:
{
"dati": {
"nome_provincia": "Terni",
"sigla_provincia": "TR",
"regione": "Umbria",
"comuni": [
"Terni"
],
"dettaglio_comuni": [
{
"nome": "Terni",
"popolazione": 109193,
"codice_catastale": "L117"
}
]
},
"successo": vero,
"messaggio": "",
"errore": nullo
}
As you can see additional data are reported like "population" and "codice catastale" (aka codice ISTAT).
But there's more. There are several types of communal data verification and updating services made available by Openapi. Here is a complete list:
The methods provinces, regions, suppressed municipalities and metropolitan municipalities provide 10,000 calls/month free of charge.
The best use of this simple but effective technology is in e-commerce integrations, autocomplete, address list data remediation, postalization and every time you want to update the geografical database structure of your application.
Try to think if a company owning several e-commerce have to deal with a simple ZIP code change.
Clients are calling because their order never arrived, meetings with a developer is scheduled, several application must be updated, swarms of possible bugs rise on the horizon!
This will not be your problem, because you understood the importance of delegating just in time and your applications are always in sync and automagically updated.