Units
GET
/v1/unitsThe units used across the API and how to read scaled values.
On every plan, Free includedKey requiredJSON or CSVCached until the next release
Parameters
No parameters.
Request
# Every unit and how values are scaled
curl "https://api.tourismapi.com/v1/units" \
-H "X-API-Key: $TOURISM_API_KEY"const res = await fetch("https://api.tourismapi.com/v1/units", {
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/units",
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/units");
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_55d1900b9d",
"data_as_of": "2026-10-20T04:48:26Z",
"count": 1
},
"data": {
"counts": [
{
"unit": "nights",
"scale": 1
},
{
"unit": "visitors",
"scale": 1
},
{
"unit": "establishments",
"scale": 1
}
],
"rates": [
{
"unit": "percent",
"scale": 1
},
{
"unit": "nights per arrival",
"scale": 1
}
],
"currencies": [
"TWD",
"USD",
"ZAR"
],
"periods": [
"2026-Q2 a quarter",
"2026 a year",
"2026-10-12 a day"
]
}
}Response fields
| Field | Type | Example |
|---|---|---|
| counts | array | 3 items |
| rates | array | 2 items |
| currencies | array | 3 items |
| periods | array | 3 items |