All updated data on zip codes, municipalities, provinces, regions via API
Check and get real-time information on Italian zip codes, Istat codes and respective municipalities. Official source Poste Italiane.
All the knowledge you need
Here you can find some advice to consider to approach this API. If you prefer, we provide code samples, OAS3 documentation, the ability to try the API live via the Swagger UI or import the entire collection into Postman. We also offer a Sandbox environment where you can experiment with all kinds of requests completely free of charge.
Get the token in the appropriate section before you start.
- Oas file url https://console.openapi.com/oas/en/cap.openapi.json
- Fork or import with Postman
- Production domain cap.openapi.it
- Sandbox domain test.cap.openapi.it
- Production Scopes 8
-
Sandbox Scopes 8
- GET test.cap.openapi.it/cerca_comuni
- GET test.cap.openapi.it/cap
- GET test.cap.openapi.it/comuni_base
- GET test.cap.openapi.it/comuni_advance
- GET test.cap.openapi.it/regioni
- GET test.cap.openapi.it/province
- GET test.cap.openapi.it/citta_metropolitane
- GET test.cap.openapi.it/comuni_soppressi
Cap (1.0.0)
This service allows you to search italian cities and get their istat and cap codes.
Testing
Please note that the sandbox environment is loaded with a limited dataset and is intended to be used for testing purposes. Some search parameters might not work or return always the same data.Search cities by name, region and/or province
This method allows you to search italian cities and get their istat code
Authorizations:
query Parameters
comune | string Name of the city |
cap | string Cap of the city |
istat | string Istat code of the city |
codice_catasto | string Land registry code of the city |
regione | string Region of the city |
provincia | string Province of the city |
Responses
Response Schema: application/json
Array of objects | |
success | boolean |
message | string |
error | integer |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://cap.openapi.it/cerca_comuni?comune=SOME_STRING_VALUE&cap=SOME_STRING_VALUE&istat=SOME_STRING_VALUE&codice_catasto=SOME_STRING_VALUE®ione=SOME_STRING_VALUE&provincia=SOME_STRING_VALUE"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- "data": [
- {
- "istat": "70006",
- "comune": "Campobasso",
- "suppressed": false
- {
- "istat": "70078",
- "comune": "Termoli",
- "suppressed": false
- {
- "istat": "94023",
- "comune": "Isernia",
- "suppressed": false
- {
- "istat": "94052",
- "comune": "Venafro",
- "suppressed": false
- "success": true,
- "message": "",
- "error": null
Get basic information about a city
Additional data can be requested with /advanced
Authorizations:
path Parameters
istat_code required | string Istat code of the city, you can find it in the search results |
Responses
Response Schema: application/json
object | |
success | boolean |
message | string |
error | integer |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://cap.openapi.it/comuni_base/%7Bistat_code%7D"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- "data": {
- "istat": "70006",
- "comune": "Campobasso",
- "regione": "Molise",
- "provincia": "Campobasso",
- "cap": [
- "86100"
- "success": true,
- "message": "",
- "error": null
Get more information about a city
Additional data can be requested with /advanced
Authorizations:
path Parameters
istat_code required | string Istat code of the city, you can find it in the search results |
Responses
Response Schema: application/json
object | |
success | boolean |
message | string |
error | integer |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://cap.openapi.it/comuni_advance/%7Bistat_code%7D"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- "data": {
- "istat": "58091",
- "comune": "Roma",
- "regione": "Lazio",
- "provincia": "Roma",
- "prefisso": "06",
- "cod_fisco": "H501",
- "superficie": 1308,
- "num_residenti": 2770226,
- "nome_abitanti": "Romani",
- "patrono": {
- "nome": "SS. Pietro e Paolo",
- "data": "29 giugno"
- "municipio": {
- "municipio": "Via del Campidoglio"
- "istat_old": null,
- "sigla_provincia": "RM",
- "tel": "+39 06/67102001",
- "fax": "+39 06/67103590",
- "frazioni": [
- "Borgo Lotti",
- ".."
- "cap": [
- "00118",
- "..."
- "success": true,
- "message": "",
- "error": null
Get a list of suppressed municipalities
Authorizations:
query Parameters
sigla_provincia | string Example: sigla_provincia=AG The province code, like RM, MI, TO etc... |
Responses
Response Schema: application/json
Array of objects | |
success | boolean |
message | string |
error | integer |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://cap.openapi.it/comuni_soppressi?sigla_provincia=SOME_STRING_VALUE"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- "data": [
- {
- "istat": "24011",
- "comune": "Barbarano Vicentino",
- "cod_fisco": "A627",
- "sigla_provincia": "VI",
- "regione": "Veneto",
- "provincia": "Vicenza"
- {
- "...": "..."
- "success": true,
- "message": "",
- "error": null
Get a list of Italian metropolitan cities
Authorizations:
Responses
Response Schema: application/json
Array of objects | |
success | boolean |
message | string |
error | integer |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://cap.openapi.it/citta_metropolitane"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- "data": [
- {
- "denominazione": "MESSINA",
- "capoluogo": "Messina",
- "popolazione": 631297,
- "superficie": 3266,
- "densita": 193,
- "num_comuni": 108
- {
- "...": "..."
- "success": true,
- "message": "",
- "error": null
Get a list of cities that match a cap
Authorizations:
path Parameters
cap required | string A cap code |
Responses
Response Schema: application/json
object | |
success | boolean |
message | string |
error | integer |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://cap.openapi.it/cap/%7Bcap%7D"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- "data": {
- "comuni": [
- {
- "istat": "1016",
- "comune": "Balangero",
- "frazione": null,
- "comune_istat": "1016"
- {
- "istat": "1019",
- "comune": "Balme",
- "frazione": null,
- "comune_istat": "1019"
- {
- "istat": "1021",
- "comune": "Barbania",
- "frazione": null,
- "comune_istat": "1021"
- {
- "istat": "4701210002",
- "comune": "Pescia",
- "frazione": "Castelvecchio",
- "comune_istat": "47012"
- "provincia": "Torino",
- "sigla_provincia": "TO",
- "regione": "Piemonte"
- "success": true,
- "message": "",
- "error": null
Get the list of italian regions
Authorizations:
Responses
Response Schema: application/json
Array of objects | |
success | boolean |
message | string |
error | integer |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://cap.openapi.it/regioni"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- "data": [
- {
- "regione": "Abruzzo",
- "capoluogo": "L'Aquila",
- "superficie": 10831.84,
- "num_residenti": 1305770,
- "num_comuni": 305,
- "presidente": "Marco Marsilio",
- "cod_fiscale": "80003170661",
- "piva": "",
- "sito": "www.regione.abruzzo.it",
- "sede": "Regione Abruzzo / Palazzo Silone - Via Leonardo da Vinci 6, 67100 L'Aquila",
- "istat": "13",
- "num_province": 4
- {
- "...": "..."
- "success": true,
- "message": "",
- "error": null
Get the list of italian provinces
Authorizations:
Responses
Response Schema: application/json
Array of objects | |
success | boolean |
message | string |
error | integer |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://cap.openapi.it/province"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- "data": [
- {
- "sigla": "AG",
- "provincia": "Agrigento",
- "superficie": 3052.59,
- "residenti": 446081,
- "num_comuni": 43,
- "istat": "084",
- "regione": "Sicilia"
- {
- "...": "..."
- "success": true,
- "message": "",
- "error": null
Get an italian province
Authorizations:
path Parameters
code required | string Example: AG The province code, like RM, MI, TO etc... |
Responses
Response Schema: application/json
object | |
success | boolean |
message | string |
error | integer |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://cap.openapi.it/province/AG"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- "data": {
- "sigla": "AG",
- "provincia": "Agrigento",
- "superficie": 3052.59,
- "residenti": 446081,
- "num_comuni": 43,
- "istat": "084",
- "regione": "Sicilia"
- "success": true,
- "message": "",
- "error": null