Introduction
These APIs are made to retrieve information regarding the COVID ordinances made by the Italian government.
Base URL
https://api.covitaly.it
Authenticating requests
This API is not authenticated.
APIs endpoints
zones/
This endpoint allows you to see the color status of all available zones/regions in Italy.
Example request:
curl -X GET \
-G "https://api.covitaly.it/zones" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
const url = new URL(
"https://api.covitaly.it/zones"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.covitaly.it/zones',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.covitaly.it/zones'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"last_update": "2020-12-27 20:39:10",
"zones_status": {
"piemonte": "yellow",
"veneto": "yellow",
"lombardia": "yellow",
"emiliaromagna": "yellow",
"umbria": "yellow",
"lazio": "yellow",
"toscana": "yellow",
"abruzzo": "orange",
"molise": "yellow",
"basilicata": "yellow",
"puglia": "yellow",
"marche": "yellow",
"sicilia": "yellow",
"sardegna": "yellow",
"liguria": "yellow",
"trento": "yellow",
"bolzano": "yellow",
"friuliveneziagiulia": "yellow",
"valledaosta": "yellow",
"campania": "yellow",
"calabria": "yellow"
}
}
Received response:
Request failed with error:
zones/{region}
This endpoint allows you to see to get a single region status by name.
Example request:
curl -X GET \
-G "https://api.covitaly.it/zones/magnam" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
const url = new URL(
"https://api.covitaly.it/zones/magnam"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.covitaly.it/zones/magnam',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.covitaly.it/zones/magnam'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (404):
Not found (no region found with that name)
Received response:
Request failed with error:
status/
This endpoint allows you to group the regions in Italy by the current status.
Example request:
curl -X GET \
-G "https://api.covitaly.it/status" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
const url = new URL(
"https://api.covitaly.it/status"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.covitaly.it/status',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.covitaly.it/status'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"last_update": "2020-12-27 20:39:10",
"status_zones": {
"yellow": [
"piemonte",
"veneto",
"lombardia",
"emiliaromagna",
"umbria",
"lazio",
"toscana",
"molise",
"basilicata",
"puglia",
"marche",
"sicilia",
"sardegna",
"liguria",
"trento",
"bolzano",
"friuliveneziagiulia",
"valledaosta",
"campania",
"calabria"
],
"orange": [
"abruzzo"
],
"red": [],
"white": [],
"undefined": []
}
}
Received response:
Request failed with error: