---
title: "Age structure and dependency ratios"
method: GET
path: "/api/v1/un-population/age-structure"
tags: ["Statistical Agencies"]
---

# Age structure and dependency ratios

`GET /api/v1/un-population/age-structure`

Composite covering age structure from UN DESA World Population Prospects 2024: id 46 (PopByAge5AndSex - population by 5-year age groups and sex), id 83 (ChildDepRatio), id 84 (OldAgeDepRatio), and id 86 (TotalDepRatio). Merged into one payload; split on `indicatorId` when consuming.

## Query parameters

- `location` string, required — Country or area as ISO3 (USA), ISO2 (US), or M49 numeric (840).
- `start_year` integer, nullable — Start year of the requested range (YYYY). Defaults to current_year - 5.
- `end_year` integer, nullable — End year of the requested range (YYYY). Defaults to current_year.

## Response `200`

Population by 5-year age groups plus dependency ratios.

- EnvelopeUNPopSeriesPayload
  - `data` UNPopSeriesPayload, required — Shared payload shape for all data endpoints (population, fertility, ...).
    - `location_m49` integer, required — Resolved UN M49 numeric code used for the upstream lookup.
    - `location_input` string, required — Original client-supplied location token (ISO3, ISO2, or M49).
    - `indicator_ids` integer[], required — UN DESA indicator ids included in this response.
    - `start_year` integer, required — Start year of the requested range.
    - `end_year` integer, required — End year of the requested range.
    - `variant_id` integer, nullable — Projection variant id applied to the request, if any.
    - `rows` UNPopDataRow[], required — Observation rows merged across requested indicators.
      - `locationId` integer, nullable — UN M49 numeric code for the location.
      - `location` string, nullable — Location name as published by UN DESA.
      - `iso3` string, nullable — ISO 3166-1 alpha-3 code where published.
      - `iso2` string, nullable — ISO 3166-1 alpha-2 code where published.
      - `indicatorId` integer, nullable — UN DESA indicator id for this row (49=Total population, 19=TFR, etc).
      - `indicator` string, nullable — Indicator name as published by UN DESA.
      - `indicatorShortName` string, nullable — Stable indicator shortName (e.g. TPopulation, TFR5, E0).
      - `variantId` integer, nullable — Projection variant id (4 = Medium, 1 = Low, 2 = High, 3 = Constant fertility).
      - `variant` string, nullable — Variant label where published.
      - `sexId` integer, nullable — Sex dimension id (1 = Male, 2 = Female, 3 = Both sexes).
      - `sex` string, nullable — Sex label where published.
      - `ageId` integer, nullable — Age group dimension id.
      - `ageLabel` string, nullable — Age group label (e.g. '0-4', '85+', 'Total').
      - `ageStart` integer, nullable — Inclusive lower bound of the age group in years.
      - `ageEnd` integer, nullable — Inclusive upper bound of the age group in years (null for open-ended groups).
      - `categoryId` integer, nullable — Category dimension id (family planning / marital status only).
      - `category` string, nullable — Category label where published.
      - `timeLabel` string, nullable — Original upstream time label (typically the reference year as a string).
      - `timeId` integer, nullable — Internal time identifier used by upstream.
      - `timeMid` number, nullable — Mid-point time value (fractional year) for abridged series.
      - `year` integer, nullable — Reference calendar year for the observation.
      - `value` number, nullable — Observed value in the indicator's native units.
      - `unit` string, nullable — Unit of measure (persons, years, percent, per 1000, etc).
    - `total` integer, required — Total number of rows returned.
  - `meta` SugraMeta, required — Metadata attached to every /api/v1/* response envelope.
    - `endpoint` string, required — Requested endpoint path.
    - `data_time` string, required — ISO 8601 UTC timestamp of the source data, not of the request.
    - `response_time` string, required — ISO 8601 UTC timestamp when this response was produced.
    - `provider` string, required — API name and version.
    - `source` string, nullable — Identifier of the primary upstream source used for this response.
    - `attribution` string, nullable — Human-readable attribution mandated by an upstream source (e.g. a securities regulator or self-regulatory organization). Present only on responses whose source requires the owner and source to be clearly identified. Do not remove or alter it when using the response.
    - `fallback_used` boolean, nullable — True when the primary source failed and a fallback produced the data.
    - `fallback_chain` string[], nullable — Ordered list of sources attempted, in the order they were tried.
    - `cached` boolean, nullable — True when this response was served from the internal cache.
    - `stale` boolean, nullable — True when the cached response was returned after the upstream rate-limited or errored. Clients can use this to detect degraded data.

## Other responses

- `401` — Missing or invalid `x-api-key` header.
- `422` — Validation Error
- `429` — Daily rate limit exceeded. Check `X-RateLimit-Reset` for the next window.
- `503` — Upstream source is temporarily unavailable. Retry after a short delay.

---

[API](https://skmtc.net/sugra/apis/sugra-api.md) · [All operations](https://skmtc.net/sugra/apis/sugra-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sugra/sugra-api/versions/dcf7427e6897/schema)
