Lookup a Scottish Postcode
This endpoint returns the full Scottish Postcode Directory (SPD) record for a Scottish postcode: council area, electoral ward, NHS health board and integration authority, data zone and intermediate zone, locality and settlement, civil parish, urban-rural classification, Scottish Index of Multiple Deprivation, census household and population counts, and the equivalent GSS / official codes — including historical (year-suffixed) values where the upstream record carries them.
A successful request returns HTTP status code 200 and a JSON object containing the postcode's SPD data.
If the postcode is not found in the Scottish Postcode Directory (SPD), the API returns a 404 response. For postcodes that exist in the ONS Postcode Directory (ONSPD) but not in SPD, a 404 response is returned with the message "Postcode exists in ONSPD but not in SPD".
For the full field listing see the Scottish Postcode Schema. The API Documentation details the OpenAPI shape.
Endpoint
GET https://api.postcodes.io/scotland/postcodes/:postcode
Example Request
GET https://api.postcodes.io/scotland/postcodes/AB101XG
The above would match any of these inputs: "AB10 1XG", "ab101xg", "Ab10 1Xg", etc.
Example Response
{
"status": 200,
"result": {
"postcode": "AB10 1XG",
"pc_compact": "AB101XG",
"postcode_district": "AB10",
"postcode_sector": "AB10 1",
"incode": "1XG",
"outcode": "AB10",
"user_type": "0",
"date_of_introduction": "198001",
"date_of_deletion": null,
"linked_small_user_postcode": null,
"longitude": -2.10250,
"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_constituency": "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",
"output_area_1991": null,
"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",
"locality_1991": null,
"settlement": "Aberdeen, Milltimber, and Peterculter",
"settlement_2020": "Aberdeen Settlement",
"settlement_2001": "Aberdeen Settlement",
"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,
"roa_community_planning_partnership": "Aberdeen City",
"roa_local": "Aberdeen City",
"census_household_count": 0,
"census_household_count_2011": 8,
"census_household_count_2001": 12,
"census_household_count_1991": null,
"census_population_count": 0,
"census_population_count_2011": 18,
"census_population_count_2001": 26,
"census_population_count_1991": null,
"never_digitised": false,
"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": "S17000016",
"scottish_parliamentary_constituency": "S16000094",
"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",
"national_park": null,
"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"
}
}
}