v1

latestOpenAPI 3.1.0MIT2026-07-13111497.3 KB
Scottish Postcodes

Lookup Scottish Postcode

Lookup a Scottish postcode.

Returns Scottish Postcode Directory (SPD) data associated with the postcode. The response covers the full SPD field set: council area, electoral ward, Scottish and UK parliamentary geographies, health board, integration authority, data zone, intermediate zone, output area, locality, settlement, civil parish, island, national park, travel-to-work area, ITL/LAU, urban-rural classification, SIMD rank, ROA, census counts, and the corresponding GSS / official codes under the codes object.

Top-level fields hold the latest (canonical) value for each datapoint. Year-suffixed fields surface prior versions where the SPD publishes them.

Returns 404 if the postcode does not exist in SPD or is not valid.

For postcodes not in SPD but present in ONSPD (i.e. non-Scottish postcodes), a 404 is returned with the error message "Postcode exists in ONSPD but not in SPD."

Source: Scottish Postcode Directory (National Records of Scotland).

get/scotland/postcodes/{postcode}

Path parameters

postcodestring required

Specifies the postcode you wish to query

Response

Success

status200 required

Example response

{
  "result": {
    "postcode": "AB10 1XG",
    "pc_compact": "AB101XG",
    "outcode": "AB10",
    "incode": "1XG",
    "postcode_district": "AB10",
    "postcode_sector": "AB10 1",
    "user_type": "0",
    "date_of_introduction": "198001",
    "longitude": -2.1025,
    "latitude": 57.14945,
    "eastings": 393859,
    "northings": 806073,
    "split_indicator": "0",
    "grid_link_indicator": "1",
    "grid_link_positional_accuracy": "1",
    "council_area": "Aberdeen City",
    "electoral_ward": "Midstocket/Rosemount",
    "registration_district": "RD20",
    "enterprise_region": "Highlands and Islands",
    "strategic_development_planning_area": "SD01",
    "local_government_district": "Aberdeen City",
    "local_government_district_1991": "City of Aberdeen",
    "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",
    "health_board_area_2006": "Grampian",
    "health_board_area_1995": "Grampian",
    "integration_authority": "Aberdeen City",
    "output_area": "S00136537",
    "output_area_2011": "S00088970",
    "output_area_2001": "S00000700",
    "data_zone": "West End North - 01",
    "data_zone_2011": "S01006571",
    "data_zone_2001": "S01000125",
    "intermediate_zone": "West End North",
    "intermediate_zone_2011": "S02000007",
    "intermediate_zone_2001": "S02000017",
    "locality": "Aberdeen",
    "locality_2020": "Aberdeen",
    "locality_2001": "Aberdeen",
    "settlement": "Aberdeen, Milltimber, and Peterculter",
    "settlement_2020": "Aberdeen Settlement",
    "settlement_2001": "Aberdeen Settlement",
    "civil_parish": "Old Machar",
    "island": "Mainland of Scotland",
    "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,
    "roa_community_planning_partnership": "Aberdeen City",
    "roa_local": "Aberdeen City",
    "census_household_count_2011": 8,
    "census_household_count_2001": 12,
    "census_population_count_2011": 18,
    "census_population_count_2001": 26,
    "codes": {
      "council_area": "S12000033",
      "electoral_ward": "S13002841",
      "enterprise_region": "S99999999",
      "local_government_district": "S12000033",
      "local_government_district_1991": "S99999999",
      "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",
      "health_board_area_2006": "S08000006",
      "health_board_area_1995": "0",
      "integration_authority": "S37000002",
      "data_zone": "S01013550",
      "data_zone_2011": "S01006571",
      "data_zone_2001": "S01000125",
      "intermediate_zone": "S02002527",
      "intermediate_zone_2011": "S02000007",
      "intermediate_zone_2001": "S02000017",
      "locality": "S19000001",
      "settlement": "S20000001",
      "civil_parish": "S07000001",
      "island": "S20000001",
      "travel_to_work_area": "S22000047",
      "lau_level_1": "TLM50",
      "itl_level_2": "TLM5",
      "itl_level_3": "TLM50",
      "registration_district": "RD20",
      "strategic_development_planning_area": "SD01",
      "roa_community_planning_partnership": "S12000033",
      "roa_local": "S12000033"
    }
  }
}