Location intelligence

Postcode to Ward and Constituency API

Look up the ward, Westminster constituency, local authority, county, region and country for any UK postcode. Each area comes back with its ONS code and name.

Administrative areas API endpoint

GET/api/v1/area/administrative-areas

Costs 1 credit. Westminster constituencies use the boundaries in force since the July 2024 general election. nameWelsh is set for Welsh areas that have a separate Welsh name. A name is null when the code is not in the latest ONS names files, which can happen for a ward whose boundaries changed recently.

Billing details in the response

Successful chargeable JSON responses include a top-level billing object. The endpoint examples on this page focus on the endpoint-specific data, so this repeated block may not be shown in every example.

"billing": {
  "mode": "prepaid",
  "creditsCharged": 1,
  "creditsRemaining": 1999,
  "creditsRefreshAt": "2026-08-14T09:30:00.000Z"
}
Field or headerMeaning
billing.creditsCharged
X-Credits-Charged
Credits charged by this call. Failed and non-chargeable calls return 0 in the header.
billing.creditsRemaining
X-Credits-Remaining
The credit balance after the call.
billing.creditsRefreshAt
X-Credits-Refresh-At
The next monthly credit refresh as an ISO 8601 timestamp. Trial and non-renewing balances return null and omit the header.

All authenticated API-key calls expose the billing headers, including validation errors and zero-credit status or management requests. Only successful chargeable JSON responses add the billing object to the response body.

When credits run out

If your balance is lower than the cost of a request, the API returns HTTP 402 and charges nothing. The error includes the credits needed, your balance and a link to change plan.

{
  "statusCode": 402,
  "statusMessage": "Payment Required",
  "data": {
    "success": false,
    "error": {
      "code": "INSUFFICIENT_CREDITS",
      "message": "This request costs 35 API credits. Upgrade your plan or wait for your monthly refresh: https://propertyinsights.co.uk/billing",
      "required": 35,
      "available": 12,
      "upgradeUrl": "https://propertyinsights.co.uk/billing"
    }
  }
}

Administrative areas API parameters

NameRequiredTypeDescription
postcodeYesstringFull UK postcode.

Source and coverage

Source
ONS National Statistics Postcode Lookup, under the Open Government Licence v3.0
Coverage
United Kingdom. Region and county apply in England only and are null elsewhere.

Example request

curl -X GET "https://propertyinsights.co.uk/api/v1/area/administrative-areas?postcode=ZZ1%201ZZ" \
  -H "x-api-key: YOUR_API_KEY"

Example response

{
  "success": true,
  "data": {
    "postcode": "ZZ1 1ZZ",
    "country": {
      "code": "E92000001",
      "name": "England",
      "nameWelsh": "Lloegr"
    },
    "region": {
      "code": "E12000009",
      "name": "South West",
      "nameWelsh": "De Orllewin"
    },
    "county": null,
    "localAuthority": {
      "code": "E06000000",
      "name": "Fictional District",
      "nameWelsh": null
    },
    "ward": {
      "code": "E05000000",
      "name": "Fictional Ward",
      "nameWelsh": null
    },
    "westminsterConstituency": {
      "code": "E14000000",
      "name": "Fictional Central",
      "nameWelsh": null
    }
  }
}

OpenAPI specification

Authentication, parameters, billing headers and response schemas are also published in the machine-readable OpenAPI documents in JSON and YAML.