---
title: "Age bands: national and city"
method: GET
path: "/age/{country_code}"
tags: ["Age bands"]
---

# Age bands: national and city

`GET /age/{country_code}`

## Request

- Base URL: `https://panafricadata.com` (the document declares no server; this is the origin it was published from)
- URL: `https://panafricadata.com/age/{country_code}`
- Auth: API key in header `X-API-Key`
- TypeScript: <https://skmtc.dev/panafricadata/apis/pan-africa-data-api/docs/age/:country_code/get.ts> (a function with typed inputs; its response is checked against the schema)

Age bands 0-14, 15-24, 25-34, 35-44, 45-54, 55-64 and 65+ for one country, as shares (0-1) and
counts. `national`: UN World Population Prospects 2024. `cities`: Pan Africa Data estimates
(WorldPop age shares on UN WUP city populations) for functional cities whose coverage is at least
0.8 in every year 2015-2035; `excluded_cities` lists this country's cities that fail that rule.
The two levels come from different sources. One cell = one band in one year, at $0.25.

## Path parameters

- `country_code` string, required

## Query parameters

- `level` string: 'all', 'national' or 'city'
- `city` string, nullable: One functional_city_id (e.g. KE-FC-NAIROBI); city level only
- `year_from` integer
- `year_to` integer

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-25** `05c7ed0515f2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/panafricadata/apis/pan-africa-data-api/changes/age/:country_code/get.md)

---

[API](https://skmtc.dev/panafricadata/apis/pan-africa-data-api.md) - [All operations](https://skmtc.dev/panafricadata/apis/pan-africa-data-api/llms.txt) - [OpenAPI document](https://skmtc.dev/panafricadata/apis/pan-africa-data-api/revisions/1803a1857b20?raw)
