{
  "openapi": "3.1.0",
  "info": {
    "version": "0.1.0",
    "title": "uprns.io API",
    "summary": "Open UK UPRN, USRN and postcode lookup",
    "termsOfService": "https://uprns.io/about",
    "contact": {
      "email": "support@ideal-postcodes.co.uk",
      "name": "Support",
      "url": "https://ideal-postcodes.co.uk/support"
    },
    "license": {
      "name": "See LICENSE in LICENSE",
      "url": "https://github.com/ideal-postcodes/feedback"
    },
    "description": "Free, open lookup of UK Unique Property Reference Numbers (UPRNs), Unique\nStreet Reference Numbers (USRNs) and postcodes. A sister service to\npostcodes.io.\n\nEach resource has one URL and two representations. Request it in a browser for\nHTML; send `Accept: application/json` (or append a `.json` suffix) for JSON.\nThe same records are also served as JSON from the API base\n`https://api.uprns.io` (host-based, no content negotiation needed).\n\n## What this is - and isn't\n\nAn **identifier + geography** service, not an address service. No open dataset\ncarries address text against a UPRN that may be republished, so this API\nreturns **no address lines, no property classification, and no live/historic\nlifecycle status**. Those live only in licensed products (OS AddressBase /\nNGD). For full postal addresses appended to a UPRN, use the commercial Ideal\nPostcodes API.\n\n## Coverage\n\nGreat Britain only (England, Scotland, Wales). Northern Ireland UPRNs are not\ncovered - the only authoritative NI source (LPS Pointer) is not open data.\n\n## Geography assignment\n\nPer-UPRN postcode and geography are taken from the authoritative point-in-polygon\nassignment (ONS UPRN Directory), not a nearest-postcode approximation. Census\ngeographies are also available under `best_fit` using ONS's population-weighted\nbest-fit methodology, for consumers matching official statistical outputs.\n\n## Data sources & attribution\n\nAssembled from Open Government Licence v3.0 datasets, refreshed on the OS\nAddressBase 6-weekly epoch cycle:\n\n- **ONS UPRN Directory (ONSUD)** & **National Statistics UPRN Lookup (NSUL)**, **ONS Postcode Directory (ONSPD)** - Office for National Statistics\n- **OS Open UPRN**, **OS Open USRN**, **OS Open Linked Identifiers**, **OS Open Roads**, **OS Open TOID**, **OS Open Names** - Ordnance Survey\n\nUse of this data requires the following attribution:\n\n> Contains OS data (C) Crown copyright and database right [year]\n> Contains Royal Mail data (C) Royal Mail copyright and database right [year]\n> Source: Office for National Statistics licensed under the Open Government Licence v3.0\n> Contains National Statistics data (C) Crown copyright and database right [year]\n"
  },
  "servers": [
    {
      "url": "https://api.uprns.io",
      "description": "Production API"
    },
    {
      "url": "https://uprns.io",
      "description": "Content-negotiated site"
    }
  ],
  "tags": [
    {
      "name": "UPRNs",
      "description": "Look up Unique Property Reference Numbers."
    },
    {
      "name": "USRNs",
      "description": "Look up streets via Unique Street Reference Numbers."
    },
    {
      "name": "Postcodes",
      "description": "Look up postcodes with administrative geography and member UPRNs."
    },
    {
      "name": "Spatial",
      "description": "Nearest-UPRN and reverse-geocode queries."
    }
  ],
  "externalDocs": {
    "description": "Guides and examples",
    "url": "https://docs.ideal-postcodes.co.uk"
  },
  "paths": {
    "/uprn/{uprn}": {
      "get": {
        "tags": [
          "UPRNs"
        ],
        "summary": "Look up a UPRN",
        "operationId": "getUprn",
        "description": "Resolve a UPRN to coordinates, postcode, administrative geography and\nlinked identifiers. HTML by default; JSON via `Accept: application/json`\nor a `.json` suffix.\n",
        "parameters": [
          {
            "name": "uprn",
            "in": "path",
            "required": true,
            "description": "1-12 digit UPRN. Leading zeros are not used.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,12}$"
            },
            "example": "100023336956"
          }
        ],
        "responses": {
          "200": {
            "description": "UPRN found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UprnRecord"
                }
              }
            }
          },
          "404": {
            "description": "UPRN not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usrn/{usrn}": {
      "get": {
        "tags": [
          "USRNs"
        ],
        "summary": "Look up a USRN",
        "operationId": "getUsrn",
        "description": "Resolve a USRN to its street name (derived), classification, location and\nthe UPRNs linked to it.\n",
        "parameters": [
          {
            "name": "usrn",
            "in": "path",
            "required": true,
            "description": "USRN identifier.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,8}$"
            },
            "example": "20600142"
          }
        ],
        "responses": {
          "200": {
            "description": "USRN found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsrnRecord"
                }
              }
            }
          },
          "404": {
            "description": "USRN not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/postcode/{postcode}": {
      "get": {
        "tags": [
          "Postcodes"
        ],
        "summary": "Look up a postcode",
        "operationId": "getPostcode",
        "description": "Resolve a postcode to its administrative geography and the UPRNs assigned\nto it. Whitespace and case insensitive.\n",
        "parameters": [
          {
            "name": "postcode",
            "in": "path",
            "required": true,
            "description": "UK postcode, any spacing/case.",
            "schema": {
              "type": "string"
            },
            "example": "SW1A 2AA"
          }
        ],
        "responses": {
          "200": {
            "description": "Postcode found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostcodeRecord"
                }
              }
            }
          },
          "404": {
            "description": "Postcode not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/nearest": {
      "get": {
        "tags": [
          "Spatial"
        ],
        "summary": "Nearest UPRNs to a coordinate",
        "operationId": "getNearest",
        "description": "Returns the UPRNs nearest a coordinate, ordered by distance.",
        "parameters": [
          {
            "name": "longitude",
            "in": "query",
            "required": true,
            "description": "WGS84 longitude.",
            "schema": {
              "type": "number",
              "format": "double",
              "minimum": -180,
              "maximum": 180
            },
            "example": -0.12767
          },
          {
            "name": "latitude",
            "in": "query",
            "required": true,
            "description": "WGS84 latitude.",
            "schema": {
              "type": "number",
              "format": "double",
              "minimum": -90,
              "maximum": 90
            },
            "example": 51.503541
          },
          {
            "name": "radius",
            "in": "query",
            "description": "Search radius in metres. Defaults to 100, max 2000.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000,
              "default": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum results. Defaults to 10, max 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NearestResult"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing coordinates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reverse": {
      "get": {
        "tags": [
          "Spatial"
        ],
        "summary": "Reverse geocode to the nearest UPRN",
        "operationId": "getReverse",
        "description": "Returns the single UPRN nearest a coordinate.",
        "parameters": [
          {
            "name": "longitude",
            "in": "query",
            "required": true,
            "description": "WGS84 longitude.",
            "schema": {
              "type": "number",
              "format": "double",
              "minimum": -180,
              "maximum": 180
            },
            "example": -0.12767
          },
          {
            "name": "latitude",
            "in": "query",
            "required": true,
            "description": "WGS84 latitude.",
            "schema": {
              "type": "number",
              "format": "double",
              "minimum": -90,
              "maximum": 90
            },
            "example": 51.503541
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReverseResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing coordinates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "UprnRecord": {
        "title": "UPRN Record",
        "description": "The full open record for a UPRN: identity, coordinates, postcode, linked\nidentifiers and the complete administrative/statistical geography. Geography\nfields are null where the source assigns none; pseudo GSS codes\n(e.g. `E99999999`) appear under `codes` for \"not applicable\" areas.\n",
        "allOf": [
          {
            "type": "object",
            "required": [
              "uprn",
              "longitude",
              "latitude",
              "eastings",
              "northings",
              "postcode",
              "usrn",
              "toid",
              "road_link_toid",
              "town"
            ],
            "properties": {
              "uprn": {
                "title": "UPRN",
                "type": "string",
                "description": "Unique Property Reference Number, 1-12 digits. Persistent; never reused.",
                "example": "100023336956"
              },
              "longitude": {
                "title": "Longitude",
                "type": [
                  "number",
                  "null"
                ],
                "format": "double",
                "description": "ETRS89 longitude (OS Open UPRN).",
                "example": -0.12767
              },
              "latitude": {
                "title": "Latitude",
                "type": [
                  "number",
                  "null"
                ],
                "format": "double",
                "description": "ETRS89 latitude (OS Open UPRN).",
                "example": 51.503541
              },
              "eastings": {
                "title": "Eastings",
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int32",
                "description": "British National Grid easting (X), 1m resolution.",
                "example": 530047
              },
              "northings": {
                "title": "Northings",
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int32",
                "description": "British National Grid northing (Y), 1m resolution.",
                "example": 179951
              },
              "postcode": {
                "title": "Postcode",
                "type": [
                  "string",
                  "null"
                ],
                "description": "Authoritative postcode for this UPRN (ONS UPRN Directory PCDS). Not a nearest-postcode approximation.",
                "example": "SW1A 2AA"
              },
              "usrn": {
                "title": "USRN",
                "type": [
                  "string",
                  "null"
                ],
                "description": "USRN of the street this property sits on (OS Open Linked Identifiers, highest-confidence link).",
                "example": "20600142"
              },
              "toid": {
                "title": "Building TOID",
                "type": [
                  "string",
                  "null"
                ],
                "description": "TopographicArea TOID of the building footprint (OS Open Linked Identifiers).",
                "example": "osgb1000002500000000"
              },
              "road_link_toid": {
                "title": "RoadLink TOID",
                "type": [
                  "string",
                  "null"
                ],
                "description": "RoadLink TOID of the nearest road segment (OS Open Linked Identifiers).",
                "example": "osgb4000000023123456"
              },
              "town": {
                "title": "Town / Populated Place",
                "type": [
                  "string",
                  "null"
                ],
                "description": "Nearest populated place (OS Open Names) - the town or settlement this UPRN sits in.",
                "example": "London"
              },
              "best_fit": {
                "$ref": "#/components/schemas/BestFit"
              }
            }
          },
          {
            "$ref": "#/components/schemas/AdminGeography"
          }
        ]
      },
      "PostcodeRecord": {
        "title": "Postcode Record",
        "description": "A postcode with its administrative geography and the UPRNs assigned to it.",
        "allOf": [
          {
            "type": "object",
            "required": [
              "postcode",
              "longitude",
              "latitude",
              "eastings",
              "northings",
              "uprn_count",
              "uprns"
            ],
            "properties": {
              "postcode": {
                "title": "Postcode",
                "type": "string",
                "description": "Postcode in canonical form.",
                "example": "SW1A 2AA"
              },
              "longitude": {
                "title": "Longitude",
                "type": [
                  "number",
                  "null"
                ],
                "format": "double",
                "description": "WGS84 longitude of the postcode centroid.",
                "example": -0.12767
              },
              "latitude": {
                "title": "Latitude",
                "type": [
                  "number",
                  "null"
                ],
                "format": "double",
                "description": "WGS84 latitude of the postcode centroid.",
                "example": 51.503541
              },
              "eastings": {
                "title": "Eastings",
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int32",
                "description": "British National Grid easting of the centroid.",
                "example": 530047
              },
              "northings": {
                "title": "Northings",
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int32",
                "description": "British National Grid northing of the centroid.",
                "example": 179951
              },
              "uprn_count": {
                "title": "UPRN Count",
                "type": "integer",
                "format": "int32",
                "description": "Number of UPRNs assigned to this postcode.",
                "example": 12
              },
              "uprns": {
                "title": "UPRNs",
                "type": "array",
                "description": "UPRNs assigned to this postcode. Large postcodes are paginated by the page surface; the JSON record carries the full list.",
                "items": {
                  "type": "string"
                },
                "example": [
                  "100023336956",
                  "100023336957"
                ]
              }
            }
          },
          {
            "$ref": "#/components/schemas/AdminGeography"
          }
        ]
      },
      "UsrnRecord": {
        "title": "USRN Record",
        "type": "object",
        "description": "A Unique Street Reference Number. The street name and classification are\nderived openly: OS Open USRN provides geometry and type; OS Open Linked\nIdentifiers links the USRN to an OS Open Roads segment carrying the name.\n",
        "required": [
          "usrn",
          "name",
          "street_type",
          "road_classification",
          "road_classification_number",
          "local_authority",
          "longitude",
          "latitude",
          "bbox",
          "uprn_count",
          "uprns"
        ],
        "properties": {
          "usrn": {
            "title": "USRN",
            "type": "string",
            "description": "Unique Street Reference Number.",
            "example": "20600142"
          },
          "name": {
            "title": "Street Name",
            "type": [
              "string",
              "null"
            ],
            "description": "Derived street name (OS Open Roads via OS Open Linked Identifiers). Null for unnamed streets.",
            "example": "Downing Street"
          },
          "street_type": {
            "title": "Street Type",
            "type": [
              "string",
              "null"
            ],
            "description": "OS Open USRN street type: Designated Street Name, Numbered Street, Unnamed Street, or Privately Maintained Street.",
            "example": "Designated Street Name"
          },
          "road_classification": {
            "title": "Road Classification",
            "type": [
              "string",
              "null"
            ],
            "description": "OS Open Roads classification (A Road, B Road, Motorway, Unclassified, ...). Null where no road link is matched.",
            "example": "Unclassified"
          },
          "road_classification_number": {
            "title": "Road Classification Number",
            "type": [
              "string",
              "null"
            ],
            "description": "Road number such as A38 or M32, where classified.",
            "example": null
          },
          "local_authority": {
            "title": "Local Authority",
            "type": [
              "string",
              "null"
            ],
            "description": "Local authority district the street centroid falls within.",
            "example": "Westminster"
          },
          "longitude": {
            "title": "Longitude",
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "WGS84 longitude of the street centroid.",
            "example": -0.12767
          },
          "latitude": {
            "title": "Latitude",
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "WGS84 latitude of the street centroid.",
            "example": 51.503541
          },
          "bbox": {
            "title": "Bounding Box",
            "type": [
              "object",
              "null"
            ],
            "description": "WGS84 bounding box of the street geometry. Null where no geometry is stored.",
            "required": [
              "minx",
              "miny",
              "maxx",
              "maxy"
            ],
            "properties": {
              "minx": {
                "title": "Min Longitude",
                "type": "number",
                "format": "double",
                "description": "West edge (minimum WGS84 longitude).",
                "example": -0.129
              },
              "miny": {
                "title": "Min Latitude",
                "type": "number",
                "format": "double",
                "description": "South edge (minimum WGS84 latitude).",
                "example": 51.502
              },
              "maxx": {
                "title": "Max Longitude",
                "type": "number",
                "format": "double",
                "description": "East edge (maximum WGS84 longitude).",
                "example": -0.126
              },
              "maxy": {
                "title": "Max Latitude",
                "type": "number",
                "format": "double",
                "description": "North edge (maximum WGS84 latitude).",
                "example": 51.505
              }
            }
          },
          "uprn_count": {
            "title": "UPRN Count",
            "type": "integer",
            "format": "int32",
            "description": "Number of UPRNs linked to this USRN.",
            "example": 6
          },
          "uprns": {
            "title": "UPRNs",
            "type": "array",
            "description": "UPRNs linked to this USRN (OS Open Linked Identifiers).",
            "items": {
              "type": "string"
            },
            "example": [
              "100023336956",
              "100023336957"
            ]
          }
        }
      },
      "NearestResult": {
        "title": "Nearest Result",
        "description": "A UPRN with its distance from the query point.",
        "allOf": [
          {
            "$ref": "#/components/schemas/UprnRecord"
          },
          {
            "type": "object",
            "required": [
              "distance"
            ],
            "properties": {
              "distance": {
                "title": "Distance",
                "type": "number",
                "format": "double",
                "description": "Distance from the query point in metres.",
                "example": 12.4
              }
            }
          }
        ]
      },
      "ReverseResult": {
        "title": "Reverse Geocode Result",
        "description": "The single nearest UPRN with its distance from the query point.",
        "allOf": [
          {
            "$ref": "#/components/schemas/UprnRecord"
          },
          {
            "type": "object",
            "required": [
              "distance"
            ],
            "properties": {
              "distance": {
                "title": "Distance",
                "type": "number",
                "format": "double",
                "description": "Distance from the query point in metres.",
                "example": 3.1
              }
            }
          }
        ]
      },
      "BestFit": {
        "title": "Best-fit Census Geographies",
        "type": "object",
        "description": "2021 Census geographies assigned by ONS's population-weighted best-fit\nmethodology (National Statistics UPRN Lookup). Use these to match official\nONS statistical outputs; they may differ from the authoritative\npoint-in-polygon values near boundaries.\n",
        "required": [
          "oa",
          "lsoa",
          "msoa"
        ],
        "properties": {
          "oa": {
            "title": "Output Area (best-fit)",
            "type": [
              "string",
              "null"
            ],
            "description": "2021 Output Area GSS code, NSUL best-fit.",
            "example": "E00023938"
          },
          "lsoa": {
            "title": "LSOA (best-fit)",
            "type": [
              "string",
              "null"
            ],
            "description": "2021 LSOA GSS code, NSUL best-fit.",
            "example": "E01004736"
          },
          "msoa": {
            "title": "MSOA (best-fit)",
            "type": [
              "string",
              "null"
            ],
            "description": "2021 MSOA GSS code, NSUL best-fit.",
            "example": "E02000977"
          }
        }
      },
      "AdminGeography": {
        "title": "Administrative & Statistical Geography",
        "type": "object",
        "description": "The full open geography set, as human-readable names. Every code-backed\nfield has its GSS code under `codes`. Shared by UPRN and postcode records.\n",
        "required": [
          "country",
          "region",
          "admin_county",
          "admin_district",
          "admin_ward",
          "parish",
          "ced",
          "parliamentary_constituency",
          "senedd_constituency",
          "senedd_constituency_no",
          "lsoa",
          "msoa",
          "oa",
          "lsoa11",
          "msoa11",
          "workplace_zone",
          "output_area_classification",
          "rural_urban",
          "built_up_area",
          "ttwa",
          "national_park",
          "index_of_multiple_deprivation",
          "sub_icb",
          "nhs_england_region",
          "nhs_ha",
          "primary_care_trust",
          "cancer_alliance",
          "pfa",
          "lep1",
          "lep2",
          "european_electoral_region",
          "nuts",
          "codes"
        ],
        "properties": {
          "country": {
            "title": "Country",
            "type": [
              "string",
              "null"
            ],
            "description": "UK constituent country (England, Scotland or Wales).",
            "example": "England"
          },
          "region": {
            "title": "Region",
            "type": [
              "string",
              "null"
            ],
            "description": "Region (formerly Government Office Region). England only.",
            "example": "London"
          },
          "admin_county": {
            "title": "County",
            "type": [
              "string",
              "null"
            ],
            "description": "Administrative county. Null where the location falls outside a county-level authority.",
            "example": null
          },
          "admin_district": {
            "title": "Local Authority District",
            "type": [
              "string",
              "null"
            ],
            "description": "Local authority district or unitary authority.",
            "example": "Westminster"
          },
          "admin_ward": {
            "title": "Ward",
            "type": [
              "string",
              "null"
            ],
            "description": "Electoral / administrative ward.",
            "example": "St James's"
          },
          "parish": {
            "title": "Parish / Community",
            "type": [
              "string",
              "null"
            ],
            "description": "Civil parish (England) or community (Wales).",
            "example": "Westminster, unparished area"
          },
          "ced": {
            "title": "County Electoral Division",
            "type": [
              "string",
              "null"
            ],
            "description": "County electoral division. England county areas only.",
            "example": null
          },
          "parliamentary_constituency": {
            "title": "Westminster Constituency (2024)",
            "type": [
              "string",
              "null"
            ],
            "description": "UK Parliamentary constituency, July 2024 boundaries.",
            "example": "Cities of London and Westminster"
          },
          "senedd_constituency": {
            "title": "Senedd Cymru Constituency",
            "type": [
              "string",
              "null"
            ],
            "description": "Senedd Cymru (Welsh Parliament) constituency. Wales only, derived by spatial join.",
            "example": null
          },
          "senedd_constituency_no": {
            "title": "Senedd Cymru Constituency Number",
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Senedd Cymru constituency number (1-16). Wales only.",
            "example": null
          },
          "lsoa": {
            "title": "LSOA (2021)",
            "type": [
              "string",
              "null"
            ],
            "description": "2021 Census LSOA name. In Scotland this is the Data Zone.",
            "example": "Westminster 018C"
          },
          "msoa": {
            "title": "MSOA (2021)",
            "type": [
              "string",
              "null"
            ],
            "description": "2021 Census MSOA name. In Scotland this is the Intermediate Zone.",
            "example": "Westminster 018"
          },
          "oa": {
            "title": "Output Area (2021)",
            "type": [
              "string",
              "null"
            ],
            "description": "2021 Census Output Area code - the smallest census geography.",
            "example": "E00023938"
          },
          "lsoa11": {
            "title": "LSOA (2011)",
            "type": [
              "string",
              "null"
            ],
            "description": "2011 Census LSOA name.",
            "example": "Westminster 018C"
          },
          "msoa11": {
            "title": "MSOA (2011)",
            "type": [
              "string",
              "null"
            ],
            "description": "2011 Census MSOA name.",
            "example": "Westminster 018"
          },
          "workplace_zone": {
            "title": "Workplace Zone (2011)",
            "type": [
              "string",
              "null"
            ],
            "description": "2011 Census Workplace Zone code.",
            "example": "E33043250"
          },
          "output_area_classification": {
            "title": "Output Area Classification (2021)",
            "type": [
              "string",
              "null"
            ],
            "description": "2021 ONS Output Area Classification (supergroup/group/subgroup) name.",
            "example": "Cosmopolitan student neighbourhoods"
          },
          "rural_urban": {
            "title": "Rural-Urban Classification (2021)",
            "type": [
              "string",
              "null"
            ],
            "description": "2021 Rural-Urban Classification.",
            "example": "Urban major conurbation"
          },
          "built_up_area": {
            "title": "Built-up Area (2024)",
            "type": [
              "string",
              "null"
            ],
            "description": "Built-up Area (2024).",
            "example": "Greater London"
          },
          "ttwa": {
            "title": "Travel to Work Area",
            "type": [
              "string",
              "null"
            ],
            "description": "Travel to Work Area - where most people both live and work.",
            "example": "London"
          },
          "national_park": {
            "title": "National Park",
            "type": [
              "string",
              "null"
            ],
            "description": "National Park this location falls within, if any.",
            "example": null
          },
          "index_of_multiple_deprivation": {
            "title": "Index of Multiple Deprivation",
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "IMD rank for this location's LSOA. Lower ranks are more deprived. Scales differ per country and are not comparable across them.",
            "example": 14843
          },
          "sub_icb": {
            "title": "Sub-ICB Location",
            "type": [
              "string",
              "null"
            ],
            "description": "NHS Sub-ICB Location (formerly CCG). England only.",
            "example": "NHS North West London ICB - W2U3Z"
          },
          "nhs_england_region": {
            "title": "NHS England Region",
            "type": [
              "string",
              "null"
            ],
            "description": "NHS England Region. England only.",
            "example": "London"
          },
          "nhs_ha": {
            "title": "Strategic Health Authority",
            "type": [
              "string",
              "null"
            ],
            "description": "NHS health authority area (Health Board in Scotland/Wales).",
            "example": "London"
          },
          "primary_care_trust": {
            "title": "Primary Care Organisation",
            "type": [
              "string",
              "null"
            ],
            "description": "Primary care organisation. Naming differs across UK regions.",
            "example": "Westminster"
          },
          "cancer_alliance": {
            "title": "Cancer Alliance",
            "type": [
              "string",
              "null"
            ],
            "description": "Cancer Alliance. England only.",
            "example": "RM Partners (West London)"
          },
          "pfa": {
            "title": "Police Force Area",
            "type": [
              "string",
              "null"
            ],
            "description": "Police force area.",
            "example": "Metropolitan Police"
          },
          "lep1": {
            "title": "Local Enterprise Partnership (Primary)",
            "type": [
              "string",
              "null"
            ],
            "description": "Primary Local Enterprise Partnership (historic; LEPs wound down 2024).",
            "example": "London"
          },
          "lep2": {
            "title": "Local Enterprise Partnership (Secondary)",
            "type": [
              "string",
              "null"
            ],
            "description": "Secondary Local Enterprise Partnership, where overlapping.",
            "example": null
          },
          "european_electoral_region": {
            "title": "European Electoral Region",
            "type": [
              "string",
              "null"
            ],
            "description": "European Electoral Region (historic).",
            "example": "London"
          },
          "nuts": {
            "title": "International Territorial Level (ITL)",
            "type": [
              "string",
              "null"
            ],
            "description": "ITL code (formerly NUTS). Retained under the `nuts` name for backward compatibility.",
            "example": "London"
          },
          "codes": {
            "$ref": "#/components/schemas/GeographyCodes"
          }
        }
      },
      "GeographyCodes": {
        "title": "Geography GSS Codes",
        "type": "object",
        "description": "Official GSS codes for the geographies named on the parent object. Pseudo codes (e.g. E99999999) denote 'not applicable'.",
        "required": [
          "admin_county",
          "admin_district",
          "admin_ward",
          "parish",
          "ced",
          "parliamentary_constituency",
          "lsoa",
          "msoa",
          "oa",
          "lsoa11",
          "msoa11",
          "workplace_zone",
          "output_area_classification",
          "rural_urban",
          "built_up_area",
          "ttwa",
          "national_park",
          "sub_icb",
          "nhs_england_region",
          "nhs_ha",
          "primary_care_trust",
          "cancer_alliance",
          "pfa",
          "lep1",
          "lep2",
          "european_electoral_region",
          "nuts"
        ],
        "properties": {
          "admin_county": {
            "type": [
              "string",
              "null"
            ],
            "description": "County GSS code.",
            "example": "E99999999"
          },
          "admin_district": {
            "type": [
              "string",
              "null"
            ],
            "description": "Local authority district GSS code.",
            "example": "E09000033"
          },
          "admin_ward": {
            "type": [
              "string",
              "null"
            ],
            "description": "Ward GSS code.",
            "example": "E05013806"
          },
          "parish": {
            "type": [
              "string",
              "null"
            ],
            "description": "Parish GSS code.",
            "example": "E43000236"
          },
          "ced": {
            "type": [
              "string",
              "null"
            ],
            "description": "County electoral division GSS code.",
            "example": "E99999999"
          },
          "parliamentary_constituency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Parliamentary constituency GSS code (2024).",
            "example": "E14001172"
          },
          "lsoa": {
            "type": [
              "string",
              "null"
            ],
            "description": "2021 LSOA GSS code.",
            "example": "E01004736"
          },
          "msoa": {
            "type": [
              "string",
              "null"
            ],
            "description": "2021 MSOA GSS code.",
            "example": "E02000977"
          },
          "oa": {
            "type": [
              "string",
              "null"
            ],
            "description": "2021 Output Area code.",
            "example": "E00023938"
          },
          "lsoa11": {
            "type": [
              "string",
              "null"
            ],
            "description": "2011 LSOA GSS code.",
            "example": "E01004736"
          },
          "msoa11": {
            "type": [
              "string",
              "null"
            ],
            "description": "2011 MSOA GSS code.",
            "example": "E02000977"
          },
          "workplace_zone": {
            "type": [
              "string",
              "null"
            ],
            "description": "2011 Workplace Zone code.",
            "example": "E33043250"
          },
          "output_area_classification": {
            "type": [
              "string",
              "null"
            ],
            "description": "2021 Output Area Classification code.",
            "example": "4b3"
          },
          "rural_urban": {
            "type": [
              "string",
              "null"
            ],
            "description": "2021 Rural-Urban Classification code.",
            "example": "A1"
          },
          "built_up_area": {
            "type": [
              "string",
              "null"
            ],
            "description": "Built-up Area (2024) code.",
            "example": "E63004290"
          },
          "ttwa": {
            "type": [
              "string",
              "null"
            ],
            "description": "Travel to Work Area code.",
            "example": "E30000234"
          },
          "national_park": {
            "type": [
              "string",
              "null"
            ],
            "description": "National Park GSS code.",
            "example": null
          },
          "sub_icb": {
            "type": [
              "string",
              "null"
            ],
            "description": "Sub-ICB Location GSS code.",
            "example": "E38000256"
          },
          "nhs_england_region": {
            "type": [
              "string",
              "null"
            ],
            "description": "NHS England Region GSS code.",
            "example": "E40000003"
          },
          "nhs_ha": {
            "type": [
              "string",
              "null"
            ],
            "description": "Health authority GSS code.",
            "example": "E18000007"
          },
          "primary_care_trust": {
            "type": [
              "string",
              "null"
            ],
            "description": "Primary care organisation code.",
            "example": "E16000057"
          },
          "cancer_alliance": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cancer Alliance GSS code.",
            "example": "E56000009"
          },
          "pfa": {
            "type": [
              "string",
              "null"
            ],
            "description": "Police Force Area GSS code.",
            "example": "E23000001"
          },
          "lep1": {
            "type": [
              "string",
              "null"
            ],
            "description": "Primary LEP GSS code.",
            "example": "E37000051"
          },
          "lep2": {
            "type": [
              "string",
              "null"
            ],
            "description": "Secondary LEP GSS code.",
            "example": null
          },
          "european_electoral_region": {
            "type": [
              "string",
              "null"
            ],
            "description": "European Electoral Region GSS code.",
            "example": "E15000007"
          },
          "nuts": {
            "type": [
              "string",
              "null"
            ],
            "description": "ITL code.",
            "example": "TLI"
          }
        }
      },
      "Error": {
        "title": "Error",
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "HTTP status code.",
            "example": 404
          },
          "error": {
            "type": "string",
            "description": "Human-readable error message.",
            "example": "UPRN not found"
          }
        }
      }
    }
  }
}