Length of stay
GET
/v1/stats/stay-lengthAverage length of stay: nights divided by arrivals, month by month, wherever one table publishes both.
Analyst plan and upKey requiredJSON or CSVCached until the next release
Parameters
| Name | Type | Description |
|---|---|---|
| countryrequired | string query | ISO code of a country that carries this statistic (listed at /v1/countries/{iso}) e.g. JP |
| fromoptional | period query | First month to return e.g. 2024-01 |
Request
# Nights per arrival and its trend
curl "https://api.tourismapi.com/v1/stats/stay-length?country=CL" \
-H "X-API-Key: $TOURISM_API_KEY"const res = await fetch("https://api.tourismapi.com/v1/stats/stay-length?country=CL", {
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/stats/stay-length?country=CL",
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/stats/stay-length?country=CL");
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_d3788a8f0d",
"data_as_of": "2026-11-07T04:51:47Z",
"count": 62,
"country": "CL",
"method": {
"series": "tourist arrivals in chile: all establishments",
"unit": "nights per arrival"
}
},
"data": [
{
"period": "2020-07",
"nights_per_arrival": 2.516
},
{
"period": "2020-08",
"nights_per_arrival": 2.385
},
{
"period": "2020-09",
"nights_per_arrival": 2.279
}
]
}Response fields
| Field | Type | Example |
|---|---|---|
| period | string | 2020-07 |
| nights_per_arrival | number | 2.516 |