Run with Postman

Cap

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.

Comuni

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
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

codice_fisco
string
Default: "<string>"

Responses

Response Schema: application/json
Array of objects[ items ]
success
boolean
message
string
error
integer

Request samples

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://test.cap.openapi.it/cerca_comuni?comune=SOME_STRING_VALUE&cap=SOME_STRING_VALUE&istat=SOME_STRING_VALUE&codice_catasto=SOME_STRING_VALUE&regione=SOME_STRING_VALUE&provincia=SOME_STRING_VALUE&codice_fisco=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

Content type
application/json
{
  • "data": [
    ],
  • "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
Default: "<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

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://test.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

Content type
application/json
{
  • "data": {
    },
  • "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
Default: "<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

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://test.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

Content type
application/json
{
  • "data": {
    },
  • "success": true,
  • "message": "",
  • "error": null
}

Get a list of suppressed municipalities

Authorizations:
query Parameters
sigla_provincia
string
Default: "<string>"
Example: sigla_provincia=AG

The province code, like RM, MI, TO etc...

Responses

Response Schema: application/json
Array of objects[ items ]
success
boolean
message
string
error
integer

Request samples

CURL *hnd = curl_easy_init(