An updated database of italian CAP and Nomenclature of Territorial Units for Statistics

Italian "regioni", "province", municipality data, zip codes and Istat Codes always in sync in your application with this brand new APIs

  • Author: Simone Desantis
  • //
  • Date: 10/09/2020
  • //
  • Reading time: 2 min

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 current year (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 the new "Comuni Italiani" service is born: https://developers.openapi.it/services/comuni
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.

The 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://comuni.openapi.it/cap/05100 and you will get a response as follow:

{
  "data": {
    "nome_provincia": "Terni",
    "sigla_provincia": "TR",
    "regione": "Umbria",
    "comuni": [
      "Terni"
    ],
    "dettaglio_comuni": [
      {
        "nome": "Terni",
        "popolazione": 109193,
        "codice_catastale": "L117"
      }
    ]
  },
  "success": true,
  "message": "",
  "error": null
} 

As you can see additional data are reported like "population" and "codice catastale" (aka codice ISTAT).

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.

An updated database of italian CAP and Nomenclature of Territorial Units for Statistics

Share on:


Join OpenAPI! Register now, you will have access to free calls every day.