Zip Codes

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.

Useful tips to start with Zip Codes

Get the token in the appropriate section before you start.

Use the the online tool or generate it via API. Set the expire date, a usefull name and now add a bunch of scopes to limit the possible actions your token can do.

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

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

Additional data can be requested with /advanced

Authorizations:
bearerAuth
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

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

Additional data can be requested with /advanced

Authorizations:
bearerAuth
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

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

Authorizations:
bearerAuth
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

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

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

Get a list of Italian metropolitan cities

Authorizations:
bearerAuth

Responses

Response Schema: application/json
Array of objects
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": [
    ],
  • "success": true,
  • "message": "",
  • "error": null
}

Cap

Get a list of cities that match a cap

Authorizations:
bearerAuth
path Parameters
cap
required
string

A cap code

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

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

Regioni

Get the list of italian regions

Authorizations:
bearerAuth

Responses

Response Schema: application/json
Array of objects
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/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

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

Province

Get the list of italian provinces

Authorizations:
bearerAuth

Responses

Response Schema: application/json
Array of objects
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/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

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

Get an italian province

Authorizations:
bearerAuth
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

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

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