Concepts

Areas and boundaries

Boundaries in the UK change all the time. Wards are redrawn, councils merge and constituencies are reshaped. The API keeps track of exactly which version of an area you mean, so your data and your maps always match.

Area codes

Every official area has a code. Birmingham City Council is E08000025, and a code's first letter usually tells you the country: E for England, W for Wales, S for Scotland and N for Northern Ireland. Some Northern Ireland statistics use their own codes, like 95AA01S1.

Codes are the reliable way to name an area. Names aren't unique, but codes are.

Geographies

A geography is a kind of area. You'll see these most often:

GeographyWhat it is
wardElectoral wards, the building blocks of councils
localAuthorityCouncils, like Leeds or Cornwall
constituencyWestminster parliamentary constituencies
regionThe English regions, like the North West
lsoaSmall statistical areas in England and Wales
dataZoneSmall statistical areas in Scotland

List geographies returns every one the Atlas knows about.

Boundary releases

A boundary release is a dated snapshot of one geography's boundaries, as its publisher released them. Its id tells you what it is:

  • 2024-07-uk-bgc is the July 2024 release covering the UK.
  • The middle part is the coverage, such as uk, gb, ew (England and Wales), en or sc.
  • The last part is the publisher's boundary type: bgc (or gcb in a few older releases) is generalised and clipped to the coastline, and bfc is full resolution and clipped to the coastline.
  • A suffix such as -v2 marks a corrected edition the publisher reissued. A few releases from other publishers have shorter ids, like 2011-ni.
  • A year can have more than one release. Use the full id, including its month and coverage, when you need one exact set of shapes.

Not sure which release to use for a date? Find boundaries for a date picks the right one. The geography pages list every available release and its coverage.

Moving to a newer release? Compare boundary releases lists the codes the two share, the codes added and the codes gone, and where there's published evidence, whether a shared code's boundary stayed the same.

Naming an exact area

Because the same code can appear in several releases, an area's full identity has three parts: its geography, its boundary release and its code. You'll see them together in URLs:

curl "https://api.ukdataatlas.com/v1/areas/constituency/2024-07-uk-bgc/E14001262"

To get every area in a release, such as all wards for a lookup table, list them a page at a time, or download the release whole from its boundary release page.

curl "https://api.ukdataatlas.com/v1/areas?geography=ward&release=2024-12-uk-bgc&limit=100"

What an area contains

To ask which wards are in Manchester, list the council's children. childGeography picks the kind of area, and without it you get the newest release of each geography that was current alongside the council's.

curl "https://api.ukdataatlas.com/v1/areas/localAuthority/latest/E08000003/children?childGeography=ward"

Parents work the other way. A ward's parents include its council and the constituencies it falls inside, and depth follows the chain further up.

curl "https://api.ukdataatlas.com/v1/areas/ward/latest/E05011350/parents"

Both only list areas that fit wholly inside one another, as their publishers declare. Where areas only partly overlap, such as wards that straddle a constituency boundary, use a crosswalk instead.

When areas change

Councils merge, wards are redrawn and constituencies are reshaped, so a code can stop appearing in newer releases. Ask for Allerdale (E07000026) in the latest release and you get area_not_in_release, with presentIn listing the releases that still hold it. Ask one of those for the code's history to find out what happened:

curl "https://api.ukdataatlas.com/v1/areas/localAuthority/2022-12-uk-bgc-v2/E07000026/history"

Allerdale's successor is Cumberland (E06000063), from April 2023, and Cumberland's own history lists the three councils it was merged-from. Each link names the published lookup it comes from:

RelationWhat it means
successor, predecessorThe publisher's lookup says one area became another.
merged-from, split-fromThe new area was made from several old ones, or is one part of an old area.
equivalent-toThe same extent in the neighbouring release, so nothing changed between them.

sameCodeReleases lists every release that uses the same code. That alone doesn't mean the boundary stayed the same, since publishers sometimes redraw an area and keep its code.

The archive starts at different years for each geography: 2008 for local authorities, 2011 for wards and 2015 for constituencies. Each geography page lists exactly which releases it has. Earlier boundaries aren't in the Atlas yet.

Which areas data is on

Publishers release statistics against the area codes that were current when they made them. When you ask for data, you name that set of codes with two parameters:

  • geography: the kind of area the publisher used, such as ward.
  • codeYear: the year of the codes they used, such as 2023.

This doesn't choose which boundaries to draw. To put values on a map, add a release. The API only accepts one that contains every area code in the data, so nothing silently goes missing. A release that doesn't fit is refused with incompatible_geometry, naming the releases that would, and a measure's evidence document lists every compatible release.

Shapes

Shapes come back as GeoJSON in ordinary longitude and latitude (WGS 84). Full detail can be heavy, so geometry endpoints take a tier of full, high, medium or low. medium or low is usually right for web maps.

Useful endpoints

get/boundary-releasesList boundary releasesget/boundary-releases/{geography}/{release}Get a boundary releaseget/areasList areasget/areas/{geography}/{release}/{code}Get an areaget/areas/{geography}/{release}/{code}/childrenList child areasget/areas/{geography}/{release}/{code}/parentsList parent areasget/areas/{geography}/{release}/{code}/historyGet an area's historyget/areas:validateCheck codes or namesget/areas/{geography}/{release}/{code}/geometryGet an area's shape