---
id: "gb_postcode_sector"
kind: "datatype"
status: "draft"
is_pii: false
name: "UK postcode sector"
regexp: "^[A-Z]{1,2}\\d[A-Z\\d]? \\d$"
categories: ["geo"]
country: ["GB"]
langs: ["en"]
quality: 85
url: "https://registry.apicrafter.io/datatype/gb_postcode_sector"
---

# UK postcode sector (`gb_postcode_sector`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Postcode sector of a UK postcode: the outward code, a space and the first digit of the inward code (LS27 0). Data published for small areas without full postcodes gives it.

- Parent datatype: [`postindex`](https://registry.apicrafter.io/datatype/postindex.md)
- Personal data (PII): no
- Categories: Geographic identifiers (geo)
- Countries: United Kingdom (GB)
- Languages: English (en)
- Classification: categorical

## Detection

Regular expression (Python `re`):

```
^[A-Z]{1,2}\d[A-Z\d]? \d$
```

## Examples

- `LS27 0` — Leeds
- `LS9 7` — Leeds
- `LS15 8` — Leeds
- `LS27` (invalid example) — A postcode district
- `LS27 0AB` (invalid example) — A full postcode

## Metacrafter rules

1 rules: 1 match the field name, 0 match values.

- `gbpostcodesectorfield` (field, `gb/gb_geo.yaml`)

## Supported by tools

- [`metacrafter`](https://registry.apicrafter.io/tool/metacrafter.md)

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom>

## Quality

Score 85/100. Missing: mapping (Wikidata, Schema.org, ...), translation.

JSON: <https://registry.apicrafter.io/api/v1/datatypes/gb_postcode_sector.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/GB/geo/gb_postcode_sector.yaml>
