Location intelligence
Census API: Demographics by Postcode
Retrieve eight census datasets in one response, covering age, household composition, tenure, bedrooms, ethnicity, religion, qualifications, and occupations. England and Wales use Census 2021. Scotland uses Scotland's Census 2022, with null counts where the Scottish tables have no matching category and a note for each dataset.
Census API endpoint
/api/v1/area/demographicsEngland and Wales responses include income: the ONS modelled mean annual household income for the 2021 MSOA with 95% confidence limits. It is an area average, not the income of one household, and the housing cost measures are equivalised. Scottish responses have no income block. Scottish responses keep the England and Wales field names. Where the Scottish small-area tables have no matching category the count and percentage are null, and Scottish categories such as age_16_24, social_rented and degree_or_above are added. Each Scottish dataset has a note explaining the differences, and source names the census and geography. NRS perturbs small-area counts, so categories may not add up exactly to the total.
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 header | Meaning |
|---|---|
| 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"
}
}
}Census API parameters
| Name | Required | Type | Description |
|---|---|---|---|
| postcode | Yes | string | Full England, Wales or Scotland postcode. |
Source and coverage
- Source
- Census 2021 and income estimates for small areas (Office for National Statistics), and Scotland's Census 2022 (National Records of Scotland)
- Coverage
- England and Wales at LSOA 2021 level, Scotland at 2011 data zone level
Example request
curl -X GET "https://propertyinsights.co.uk/api/v1/area/demographics?postcode=S11%208YL" \
-H "x-api-key: YOUR_API_KEY"Example response
{
"success": true,
"data": {
"postcode": "S11 8YL",
"area": {
"lsoaCode": "E01008049",
"localAuthorityName": "Sheffield City Council"
},
"census": {
"age": {
"total": 1643,
"categories": {
"age_25_34": {
"count": 312,
"percentage": 19
}
}
}
},
"income": {
"msoa": {
"code": "E02001652",
"name": "Sheffield 042"
},
"financialYear": "FYE 2023",
"totalAnnual": {
"value": 61200,
"lower": 52300,
"upper": 71600
},
"netAnnualAfterHousingEquivalised": {
"value": 34100,
"lower": 29800,
"upper": 39000
}
}
}
}OpenAPI specification
Authentication, parameters, billing headers and response schemas are also published in the machine-readable OpenAPI documents in JSON and YAML.