Nights by accommodation
GET
/v1/nights/by-accommodationNights split by type of accommodation for one country and period.
Developer plan and upKey requiredJSON or CSVCached until the next release
Parameters
| Name | Type | Description |
|---|---|---|
| isorequired | string path | ISO 3166 two-letter country code e.g. CL |
| periodoptional | period query | One period; defaults to the latest finished one e.g. 2026-08 |
Request
# Nights by hotels, camping, rentals and more
curl "https://api.tourismapi.com/v1/nights/by-accommodation?iso=CL&period=2026-08" \
-H "X-API-Key: $TOURISM_API_KEY"const res = await fetch("https://api.tourismapi.com/v1/nights/by-accommodation?iso=CL&period=2026-08", {
headers: { "X-API-Key": process.env.TOURISM_API_KEY }
});
if (!res.ok) throw new Error(`Tourism API ${res.status}`);
const { meta, data } = await res.json();
console.log(meta.data_as_of, data);import os, requests
r = requests.get(
"https://api.tourismapi.com/v1/nights/by-accommodation?iso=CL&period=2026-08",
headers={"X-API-Key": os.environ["TOURISM_API_KEY"]},
timeout=10,
)
r.raise_for_status()
body = r.json()
print(body["meta"]["data_as_of"], body["data"])$ch = curl_init("https://api.tourismapi.com/v1/nights/by-accommodation?iso=CL&period=2026-08");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-API-Key: " . getenv("TOURISM_API_KEY")],
]);
$body = json_decode(curl_exec($ch), true);
print_r($body["data"]);
Example response
{
"meta": {
"request_id": "req_97fd15c176",
"data_as_of": "2026-10-20T04:48:12Z",
"count": 1,
"country": "CL",
"measure": "nights",
"breakdown": "accommodation",
"period": "2026-08",
"freq": "M"
},
"data": [
{
"series": "sr_85g2v1ta",
"name": "Tourist nights in Chile: hotels",
"unit": "nights",
"value": 1333264
}
]
}Response fields
| Field | Type | Example |
|---|---|---|
| series | string | sr_85g2v1ta |
| name | string | Tourist nights in Chile: hotels |
| unit | string | nights |
| value | number | 1333264 |