Skip to main content

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 Parliament 2025 boundaries

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

FieldTypeDescriptionExample
postcodestringRoyal Mail postcode (canonical formatting with single space)."AB10 1XG"
pc_compactstringPostcode with all spaces removed."AB101XG"
postcode_districtstringEquivalent to the outward code."AB10"
postcode_sectorstringOutward code plus the first character of the inward code."AB10 1"
outcode / incodestringOutward / inward halves of the postcode."AB10" / "1XG"
user_typestring | nullSPD user type ("0" = small user, "1" = large user)."0"
date_of_introductionstring | nullDate the postcode was introduced (YYYYMM)."199406"
date_of_deletionstring | nullDate the postcode was deleted (YYYYMM); null for live postcodes.null
linked_small_user_postcodestring | nullFor large-user postcodes, the linked small-user postcode (if any).null
longitude / latitudenumber | nullWGS84 coordinates.-2.10250
eastings / northingsinteger | nullOS National Grid grid reference (1m resolution).393859
split_indicatorstring | nullMarks postcodes that span more than one administrative unit."0"
grid_link_indicatorstring | nullHow the postcode was linked to its grid reference."1"
grid_link_positional_accuracystring | nullPositional accuracy of the grid reference."1"
never_digitisedbooleanTrue if the postcode has never been digitised (no grid reference established).false

Administrative geographies

FieldTypeDescriptionExample
council_areastring | null2019 council area name (current unitary authority)."Aberdeen City"
electoral_wardstring | null2022 electoral ward name."Midstocket/Rosemount"
local_government_districtstring | null1995 local government district name (pre-unitary boundary)."Aberdeen City"
local_government_district_1991string | null1991 local government district name (historical)."City of Aberdeen"
enterprise_regionstring | null2008 enterprise region name."Highlands and Islands"
registration_districtstring | null2007 registration district code. (SPD provides codes only — no names.)"RD20"
strategic_development_planning_areastring | null2013 SDPA code."SD01"
civil_parishstring | null1930 Scottish civil parish name (latest historical baseline)."Old Machar"
islandstring | nullIsland name; "Mainland of Scotland" for non-island postcodes."Mainland of Scotland"
national_parkstring | null2010 national park name (Cairngorms / Loch Lomond and the Trossachs).null

Parliamentary

FieldTypeDescriptionExample
uk_parliamentary_constituencystring | null2024 UK Parliamentary constituency."Aberdeen South"
scottish_parliamentary_regionstring | null2025 Scottish Parliamentary region (current; SSI 2025/285, 7 May 2026 election)."North East Scotland"
scottish_parliamentary_region_2021string | null2021 Scottish Parliamentary region (superseded)."North East Scotland"
scottish_parliamentary_constituencystring | null2025 Scottish Parliamentary constituency (current; SSI 2025/285, 7 May 2026 election)."Aberdeen Central"
scottish_parliamentary_constituency_2021string | null2021 Scottish Parliamentary constituency (superseded)."Aberdeen Central"

Health

FieldTypeDescriptionExample
health_board_areastring | null2019 NHS health board area (operational)."Grampian"
health_board_area_2006string | null2006 health board area (historical)."Grampian"
health_board_area_1995string | null1995 health board area (historical)."Grampian"
integration_authoritystring | null2019 health and social care integration authority."Aberdeen City"

Statistical & census

FieldTypeDescriptionExample
output_areastring | null2022 census Output Area code (smallest census geography)."S00136537"
output_area_2011 / output_area_2001 / output_area_1991string | nullHistorical Output Area codes."S00088970"
data_zonestring | null2022 Data Zone name (Scottish equivalent of LSOA)."West End North - 01"
data_zone_2011 / data_zone_2001string | nullHistorical Data Zone codes."S01006571"
intermediate_zonestring | null2022 Intermediate Zone name (Scottish equivalent of MSOA)."West End North"
intermediate_zone_2011 / intermediate_zone_2001string | nullHistorical Intermediate Zone codes."S02000007"
localitystring | null2022 locality name."Aberdeen"
locality_2020 / locality_2001 / locality_1991string | nullHistorical locality names."Aberdeen"
settlementstring | null2022 settlement name."Aberdeen, Milltimber, and Peterculter"
settlement_2020 / settlement_2001string | nullHistorical settlement names."Aberdeen Settlement"
travel_to_work_areastring | null2011 Travel to Work Area."Aberdeen"
lau_level_1string | null2025 LAU level 1 name (replaces previous NUTS classifications)."Aberdeen City"
itl_level_2 / itl_level_3string | null2025 ITL level 2 / 3 names (replaces NUTS 2 / 3)."North Eastern Scotland"
urban_rural_6_fold / urban_rural_8_foldstring | null2022 Scottish Government urban-rural classification codes."1"
scottish_index_of_multiple_deprivationinteger | nullSIMD 2020 rank for the postcode's Data Zone (1 = most deprived, 6976 = least deprived).6414
roa_community_planning_partnershipstring | null2006 Community Planning Partnership name."Aberdeen City"
roa_localstring | null2006 Regional Outcome Agreement local authority."Aberdeen City"
census_household_count / census_population_countinteger | nullCounts at the 2022 census. May be 0 for empty / zero-suppressed postcodes.0
census_household_count_2011 / census_population_count_2011integer | nullCounts at the 2011 census.8 / 18
census_household_count_2001 / census_population_count_2001integer | nullCounts at the 2001 census.12 / 26
census_household_count_1991 / census_population_count_1991integer | nullCounts 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.