Get Metric Data
get_metric_dataPull the time series for one fully-specified UKHSA metric. Requires all six levels (theme, sub_theme, topic, geography_type, geography, metric). Returns paginated observations {count, next, previous, results[]} where each result has date, metric_value, year, month, epiweek, sex, age, stratum, geography_code, etc. Optionally filter by year and control page_size / page. Example: infectious_disease / respiratory / COVID-19 / Nation / England / COVID-19_cases_casesByDay.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Optional. 1-based page number for paging through results. | |
| year | No | Optional. Filter to a single calendar year, e.g. 2024. | |
| theme | Yes | e.g. "infectious_disease". | |
| topic | Yes | e.g. "COVID-19". | |
| metric | Yes | Dotted/underscored metric name, e.g. "COVID-19_cases_casesByDay". | |
| geography | Yes | e.g. "England". | |
| page_size | No | Optional. Observations per page (default 5 here, max ~365). | |
| sub_theme | Yes | e.g. "respiratory". | |
| geography_type | Yes | e.g. "Nation". |