Scottish Postcode Schema
The Scottish Postcode schema represents the full set of geographies the Scottish Postcode Directory (SPD) ships against a postcode: administrative, electoral, health, statistical, and census. It is returned by the /scotland/postcodes/:postcode endpoint.
Top-level fields hold the canonical (latest) value for each datapoint. Year-suffixed fields surface prior versions where SPD publishes them (e.g. data_zone is the 2022 Data Zone; data_zone_2011 and data_zone_2001 are historical baselines). The codes object mirrors the same datapoints with their GSS / official codes.
scottish_parliamentary_constituency and scottish_parliamentary_region now hold the 2025 designation (Second Review of Scottish Parliament Boundaries, SSI 2025/285), which took effect at the 7 May 2026 Holyrood election - boundaries and names changed. The superseded 2021 values moved to scottish_parliamentary_constituency_2021 and scottish_parliamentary_region_2021. Consumers pinned to the 2021 boundaries should read the _2021 fields.
Example
{
"status": 200,
"result": {
"postcode": "AB10 1XG",
"postcode_district": "AB10",
"postcode_sector": "AB10 1",
"incode": "1XG",
"outcode": "AB10",
"user_type": "0",
"date_of_introduction": "199406",
"date_of_deletion": null,
"longitude": -2.10250,
"latitude": 57.14945,
"eastings": 393859,
"northings": 806073,
"council_area": "Aberdeen City",
"electoral_ward": "Midstocket/Rosemount",
"uk_parliamentary_constituency": "Aberdeen South",
"scottish_parliamentary_region": "North East Scotland",
"scottish_parliamentary_region_2021": "North East Scotland",
"scottish_parliamentary_constituency": "Aberdeen Central",
"scottish_parliamentary_constituency_2021": "Aberdeen Central",
"health_board_area": "Grampian",
"integration_authority": "Aberdeen City",
"data_zone": "West End North - 01",
"data_zone_2011": "S01006571",
"intermediate_zone": "West End North",
"output_area": "S00136537",
"locality": "Aberdeen",
"settlement": "Aberdeen, Milltimber, and Peterculter",
"civil_parish": "Old Machar",
"island": "Mainland of Scotland",
"national_park": null,
"travel_to_work_area": "Aberdeen",
"lau_level_1": "Aberdeen City",
"itl_level_2": "North Eastern Scotland",
"itl_level_3": "Aberdeen City and Aberdeenshire",
"urban_rural_6_fold": "1",
"urban_rural_8_fold": "1",
"scottish_index_of_multiple_deprivation": 6414,
"census_household_count": 0,
"census_population_count": 0,
"codes": {
"council_area": "S12000033",
"electoral_ward": "S13002841",
"uk_parliamentary_constituency": "S14000061",
"scottish_parliamentary_region": "S17000026",
"scottish_parliamentary_region_2021": "S17000014",
"scottish_parliamentary_constituency": "S16000151",
"scottish_parliamentary_constituency_2021": "S16000074",
"health_board_area": "S08000020",
"integration_authority": "S37000002",
"data_zone": "S01013550",
"intermediate_zone": "S02002527",
"locality": "S19000001",
"settlement": "S20000001",
"civil_parish": "S07000001",
"national_park": null,
"travel_to_work_area": "S22000047"
}
}
}
Reference
Identity & spatial
| Field | Type | Description | Example |
|---|---|---|---|
postcode | string | Royal Mail postcode (canonical formatting with single space). | "AB10 1XG" |
pc_compact | string | Postcode with all spaces removed. | "AB101XG" |
postcode_district | string | Equivalent to the outward code. | "AB10" |
postcode_sector | string | Outward code plus the first character of the inward code. | "AB10 1" |
outcode / incode | string | Outward / inward halves of the postcode. | "AB10" / "1XG" |
user_type | string | null | SPD user type ("0" = small user, "1" = large user). | "0" |
date_of_introduction | string | null | Date the postcode was introduced (YYYYMM). | "199406" |
date_of_deletion | string | null | Date the postcode was deleted (YYYYMM); null for live postcodes. | null |
linked_small_user_postcode | string | null | For large-user postcodes, the linked small-user postcode (if any). | null |
longitude / latitude | number | null | WGS84 coordinates. | -2.10250 |
eastings / northings | integer | null | OS National Grid grid reference (1m resolution). | 393859 |
split_indicator | string | null | Marks postcodes that span more than one administrative unit. | "0" |
grid_link_indicator | string | null | How the postcode was linked to its grid reference. | "1" |
grid_link_positional_accuracy | string | null | Positional accuracy of the grid reference. | "1" |
never_digitised | boolean | True if the postcode has never been digitised (no grid reference established). | false |
Administrative geographies
| Field | Type | Description | Example |
|---|---|---|---|
council_area | string | null | 2019 council area name (current unitary authority). | "Aberdeen City" |
electoral_ward | string | null | 2022 electoral ward name. | "Midstocket/Rosemount" |
local_government_district | string | null | 1995 local government district name (pre-unitary boundary). | "Aberdeen City" |
local_government_district_1991 | string | null | 1991 local government district name (historical). | "City of Aberdeen" |
enterprise_region | string | null | 2008 enterprise region name. | "Highlands and Islands" |
registration_district | string | null | 2007 registration district code. (SPD provides codes only — no names.) | "RD20" |
strategic_development_planning_area | string | null | 2013 SDPA code. | "SD01" |
civil_parish | string | null | 1930 Scottish civil parish name (latest historical baseline). | "Old Machar" |
island | string | null | Island name; "Mainland of Scotland" for non-island postcodes. | "Mainland of Scotland" |
national_park | string | null | 2010 national park name (Cairngorms / Loch Lomond and the Trossachs). | null |
Parliamentary
| Field | Type | Description | Example |
|---|---|---|---|
uk_parliamentary_constituency | string | null | 2024 UK Parliamentary constituency. | "Aberdeen South" |
scottish_parliamentary_region | string | null | 2025 Scottish Parliamentary region (current; SSI 2025/285, 7 May 2026 election). | "North East Scotland" |
scottish_parliamentary_region_2021 | string | null | 2021 Scottish Parliamentary region (superseded). | "North East Scotland" |
scottish_parliamentary_constituency | string | null | 2025 Scottish Parliamentary constituency (current; SSI 2025/285, 7 May 2026 election). | "Aberdeen Central" |
scottish_parliamentary_constituency_2021 | string | null | 2021 Scottish Parliamentary constituency (superseded). | "Aberdeen Central" |
Health
| Field | Type | Description | Example |
|---|---|---|---|
health_board_area | string | null | 2019 NHS health board area (operational). | "Grampian" |
health_board_area_2006 | string | null | 2006 health board area (historical). | "Grampian" |
health_board_area_1995 | string | null | 1995 health board area (historical). | "Grampian" |
integration_authority | string | null | 2019 health and social care integration authority. | "Aberdeen City" |
Statistical & census
| Field | Type | Description | Example |
|---|---|---|---|
output_area | string | null | 2022 census Output Area code (smallest census geography). | "S00136537" |
output_area_2011 / output_area_2001 / output_area_1991 | string | null | Historical Output Area codes. | "S00088970" |
data_zone | string | null | 2022 Data Zone name (Scottish equivalent of LSOA). | "West End North - 01" |
data_zone_2011 / data_zone_2001 | string | null | Historical Data Zone codes. | "S01006571" |
intermediate_zone | string | null | 2022 Intermediate Zone name (Scottish equivalent of MSOA). | "West End North" |
intermediate_zone_2011 / intermediate_zone_2001 | string | null | Historical Intermediate Zone codes. | "S02000007" |
locality | string | null | 2022 locality name. | "Aberdeen" |
locality_2020 / locality_2001 / locality_1991 | string | null | Historical locality names. | "Aberdeen" |
settlement | string | null | 2022 settlement name. | "Aberdeen, Milltimber, and Peterculter" |
settlement_2020 / settlement_2001 | string | null | Historical settlement names. | "Aberdeen Settlement" |
travel_to_work_area | string | null | 2011 Travel to Work Area. | "Aberdeen" |
lau_level_1 | string | null | 2025 LAU level 1 name (replaces previous NUTS classifications). | "Aberdeen City" |
itl_level_2 / itl_level_3 | string | null | 2025 ITL level 2 / 3 names (replaces NUTS 2 / 3). | "North Eastern Scotland" |
urban_rural_6_fold / urban_rural_8_fold | string | null | 2022 Scottish Government urban-rural classification codes. | "1" |
scottish_index_of_multiple_deprivation | integer | null | SIMD 2020 rank for the postcode's Data Zone (1 = most deprived, 6976 = least deprived). | 6414 |
roa_community_planning_partnership | string | null | 2006 Community Planning Partnership name. | "Aberdeen City" |
roa_local | string | null | 2006 Regional Outcome Agreement local authority. | "Aberdeen City" |
census_household_count / census_population_count | integer | null | Counts at the 2022 census. May be 0 for empty / zero-suppressed postcodes. | 0 |
census_household_count_2011 / census_population_count_2011 | integer | null | Counts at the 2011 census. | 8 / 18 |
census_household_count_2001 / census_population_count_2001 | integer | null | Counts at the 2001 census. | 12 / 26 |
census_household_count_1991 / census_population_count_1991 | integer | null | Counts at the 1991 census. | null |
codes object
Mirrors every name field above with its GSS / official code, where SPD publishes one. Where SPD ships only a code (e.g. registration_district, strategic_development_planning_area), the same value appears as the top-level field. Pseudo codes (e.g. S99999999) appear where a geography does not apply.