Run with Postman

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.

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

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://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");

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

basic information about city

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

advanced information about a city

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

offering information on discontinued municipal entities.

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();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://cap.openapi.it/comuni_soppressi?sigla_provincia=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

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

Get a list of Italian metropolitan cities

offering information on metropolitan cities, providing details about metropolitan areas and their features.

Authorizations:

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

Content type
application/json
{
  • "data": [