This service allows you to search italian cities and get their istat and cap codes.
This method allows you to search italian cities and get their istat code
comune | string Default: "<string>" Name of the city |
cap | string Default: "<string>" Cap of the city |
istat | string Default: "<string>" Istat code of the city |
codice_catasto | string Default: "<string>" Land registry code of the city |
regione | string Default: "<string>" Region of the city |
provincia | string Default: "<string>" Province of the city |
Array of objects[ items ] | |
success | boolean |
message | string |
error | integer |
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);
{- "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
}
Additional data can be requested with /advanced
istat_code required | string Default: "<string>" Istat code of the city, you can find it in the search results |
object | |
success | boolean |
message | string |
error | integer |
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);
{- "data": {
- "istat": "70006",
- "comune": "Campobasso",
- "regione": "Molise",
- "provincia": "Campobasso",
- "cap": [
- "86100"
]
}, - "success": true,
- "message": "",
- "error": null
}
Additional data can be requested with /advanced
istat_code required | string Default: "<string>" Istat code of the city, you can find it in the search results |
object | |
success | boolean |
message | string |
error | integer |
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);
{- "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",
- "email": "ld.gabinetto@comune.roma.it",
- "pec": "protocollo.segretariato@pec.comune.roma.it",
- "tel": "+39 06/67102001",
- "fax": "+39 06/67103590",
- "frazioni": [
- "Borgo Lotti",
- ".."
], - "cap": [
- "00118",
- "..."
]
}, - "success": true,
- "message": "",
- "error": null
}