Age pyramid
GET
/v1/population/{iso}/pyramidA country's women and men in seventeen five-year age bands, 0 to 4 up to 80 and over, for the newest year held or the year asked, with each band's share.
On every plan, Free includedKey requiredJSON or CSVCached until the next release
Parameters
| Name | Type | Description |
|---|---|---|
| isorequired | string path | ISO 3166 two-letter country code e.g. CL |
| yearoptional | integer query | Calendar year e.g. 2026 |
Request
# Women and men in five-year age bands
curl "https://api.tourismapi.com/v1/population/CL/pyramid" \
-H "X-API-Key: $TOURISM_API_KEY"const res = await fetch("https://api.tourismapi.com/v1/population/CL/pyramid", {
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/population/CL/pyramid",
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/population/CL/pyramid");
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_8adbb3a8ae",
"data_as_of": "2026-10-21T17:42:33Z",
"count": 17,
"iso": "CL",
"year": 2025,
"bands": "five-year age bands, youngest first; 80+ is everyone 80 and over"
},
"data": [
{
"ages": "0-4",
"female": 444608,
"male": 462977,
"total": 907585,
"share_pct": 4.57
},
{
"ages": "5-9",
"female": 558001,
"male": 578436,
"total": 1136437,
"share_pct": 5.72
},
{
"ages": "10-14",
"female": 609304,
"male": 632896,
"total": 1242200,
"share_pct": 6.25
}
]
}Response fields
| Field | Type | Example |
|---|---|---|
| ages | string | 0-4 |
| female | number | 444608 |
| male | number | 462977 |
| total | number | 907585 |
| share_pct | number | 4.57 |