API Documentation

Complete reference for the GeoData API

Authentication

All API requests require an API key passed in the X-API-Key request header:

X-API-Key: YOUR_API_KEY

Single Lookup

Get data for a single GB postcode:

GET /v1/lookup?location=SW1A1AA&categories=demographics,housing

Parameters

  • location - GB postcode (required)
  • categories - Comma-separated list (optional)

Code Examples

curl -X GET "https://geodata.api.leadinglogic.ai/v1/lookup?location=SW1A1AA&categories=demographics" \
  -H "X-API-Key: YOUR_API_KEY"

Batch Lookup

Get data for multiple postcodes (max 100):

POST /v1/batch
Content-Type: application/json

{
  "locations": ["SW1A1AA", "M11AD"],
  "categories": ["demographics"]
}

Code Examples

curl -X POST "https://geodata.api.leadinglogic.ai/v1/batch" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "locations": ["SW1A1AA", "M11AD"],
    "categories": ["demographics"]
  }'

Data Categories

  • demographics - Population, age, ethnicity (Census 2021)
  • economic - Employment, economic activity (ONS / NRS)
  • housing - Property prices, tenure (Land Registry)
  • crime - Crime statistics (Police UK)
  • business - Enterprise counts (ONS)
  • deprivation - IMD scores (MHCLG)
  • education - Nearest schools (DfE / gov.scot)
  • connectivity - Broadband & mobile coverage (Ofcom)
  • energy - EPC energy efficiency ratings (MHCLG / Scottish Government)
  • flood - Rivers & sea flood-risk bands (Environment Agency)
  • health-conditions - Modelled GP long-term condition prevalence for England (21 NHS England QOF conditions), Wales (StatsWales GP disease registers) and Scotland (Public Health Scotland GP disease prevalence). Each location is compared with its own nation's rate (national, vsNational, nation). Wales and Scotland publish no practice-to-area patient split, so their estimates are modelled from practice locations (method: "modelled-distance"). Condition sets and age groups differ by nation; population gives each rate's age group.
  • climate - Observed climate on a 1 km grid (Met Office HadUK-Grid): temperature, rainfall, sunshine and frost for the latest year and each season, with the 1991–2020 average
  • council-tax - Council tax bands for the homes in an area (VOA for England and Wales, National Records of Scotland for Scotland): the share of homes in each band, the most common band and the yearly charge by band. Figures describe the homes in the area, not a single address
  • transport - Public transport near a location (DfT NaPTAN, with ORR station usage): the nearest bus stops, bus station, National Rail stations, heritage railway station, metro and tram stops, ferry terminal and airport, each with its straight-line distance in metres, and how many bus stops, rail stations and metro stops lie within set distances (method: "straight-line"; distances are not walking routes). Sector, district, area, LSOA, MSOA and Data Zone rows carry a summary instead: mean distances, mean counts and the share of postcodes near a bus stop or station
  • terrain - The lie of the land and the built form of the postcode area: height above sea level (mean, lowest, highest and at the postcode point), slope and the share of the area in each slope band, which way it faces, and how much lower or higher it sits than the surrounding 500 m and 2 km (OS Terrain 50); the share of the area under buildings (OS OpenMap Local); and, where airborne LiDAR covers the postcode (Environment Agency, Welsh Government, Scottish public-sector surveys), building heights and their mix, tree canopy cover and LiDAR ground height. lidar.available says whether LiDAR covers at least 80% of the area, with the survey dates; where it does not, the LiDAR figures are null. Heights are in metres; figures describe the area, never one property
  • planning - Planning and heritage designations around a location (planning.data.gov.uk, Historic England and Natural England for England; Cadw, Welsh Government and Natural Resources Wales; Historic Environment Scotland, NatureScot and the Scottish Government): for conservation areas, Article 4 directions, tree preservation orders, green belt, SSSIs, national parks, National Landscapes, National Scenic Areas and ancient woodland, the share of the postcode’s addresses inside and the distance to the nearest; listed buildings by grade within 100, 250 and 500 m and inside the postcode; brownfield register sites nearby (England). Every layer carries coverage (national, supplied, not-supplied, no-data, not-loaded or not-applicable); when it is not national or supplied the figures are null, meaning unknown rather than none. Figures describe the area, never a single building
  • air-quality - Air quality rules for a location: the Air Quality Management Areas its council has declared (Defra's register: name, pollutants, dates; aqma.basis: "council", since AQMA boundaries are not openly licensed), and whether it is inside a charging Clean Air Zone, the London ULEZ or a Scottish Low Emission Zone (cleanAirZone.status: inside, outside, or unknown where the zone's boundary is not published as open data), with the nearest zone within 50 km. Pollution levels are not included yet
  • noise - Modelled transport noise over the postcode's area from the Round 4 strategic noise maps (Defra for England, the Welsh Government, the Scottish Government; 2021 data, 10 m grid, 4 m above ground): for road, rail, aircraft (England's 16 largest airports only; coverage.aircraft is false in Wales and Scotland) and all sources together, the median, 90th-percentile and loudest Lden and Lnight in dB, the share of the area at or above set levels (shareAtLeast: Lden 55/65/75, Lnight 45/50/55) and the main source. null means below the mapping cutoff (40 dB Lden, 35 dB Lnight). Figures describe the area, never a single property, and are not suitable for property or insurance decisions
  • light-pollution - Artificial light at night measured from space (NASA Black Marble, VIIRS, about 1:30 am): the radiance of the postcode's cell and the area around it in nW/cm²/sr, a band from 1 (darkest) to 9 (brightest), the GB percentile, and the change since the previous year and five years earlier. It measures light shining upwards, not sky brightness. Sector, district and area rows carry an area-weighted summary with the share of the area in each band. NASA does not endorse this product
  • geology - The ground around a location, at regional scale (BGS Geology 625k, BGS GeoSure 5 km hex grid, the BGS/UKHSA Indicative Atlas of Radon and OS Terrain 50): bedrock and surface deposit, distance to the nearest mapped fault, whether the ground is shrinkable clay, peat or alluvium, chalk or limestone, the six GeoSure hazard ratings, the radon class of the 1 km square, elevation and slope, and a regional ground-stability indicator with the reasons behind it (scale: "regional"; not a site survey). Sector, district and area rows carry area-weighted shares instead
  • coastal-erosion - Whether a postcode is on an eroding coast, from each nation's official projections (Environment Agency NCERM 2024 for England, Natural Resources Wales NCERM and SMP2 policies for Wales, NatureScot Dynamic Coast 2 for Scotland): the share of the postcode's addresses inside, or within 50 m of, each published erosion scenario, the distance from the postcode centre to the coast and to each zone, the shoreline management plan policy for the nearest stretch of coast (England and Wales) and known unstable cliffs (England). Each nation keeps its own scenarios and years (headlineScenario, headlineYears); postcodes more than 2 km from the coast get coastal: false. An area guide, not a property survey: unit rows carry shares, never address counts. Sector, district, area, LSOA, MSOA and Data Zone rows carry address and postcode counts per scenario
  • landfill - Closed and permitted landfill near a location (Environment Agency Historic Landfill and Authorised Landfill for England, SEPA landfill permits for Scotland): whether the postcode's centre is inside a landfill boundary (insideAny), the distance to the nearest site, how many sites lie within 250 m, 500 m and 1 km, and the nearest three sites with their years of use, waste types or permit status (method: "postcode-centre"). coverage says what each nation has: England full, Scotland permitted sites as points only, Wales none (Natural Resources Wales's data cannot be published); a class with no data is null, never zero. Sector, district, area, LSOA, MSOA and Data Zone rows carry shares of postcodes inside or near landfill instead
  • energy-use - Metered domestic gas and electricity use (DESNZ subnational consumption statistics): the typical (median) use per meter in the postcode, compared with its LSOA or Data Zone, district, nation and Great Britain; an indicative annual bill at the current Ofgem price cap (GB average Direct Debit); estimated CO2e from DESNZ conversion factors; the share of homes without mains gas; the Economy 7 share; and a yearly history from 2017. DESNZ withholds postcodes with fewer than five meters, so their figures come from the LSOA or Data Zone (basis says which). Figures describe typical homes in the area, not one household
  • surroundings - What is physically around a location (Ordnance Survey OpenData and the ONS UPRN Directory): address points nearby, the nearest motorway junction, A and B roads and the share of addresses on minor and dead-end roads, the nearest park, play space, playing field, sports ground and allotment, the nearest watercourse and the coast, the built-up area and nearest town, the Westminster and devolved constituencies, electoral division and parish (with a split flag when the postcode's addresses fall in more than one), and three 0–100 scores compared with all GB postcodes: walkability, quietStreets and ruralRemoteness (method: "straight-line"). Sector, district, area, LSOA, MSOA and Data Zone rows carry an address-weighted summary instead
  • road-safety - Police-reported injury road collisions near a location over the last five years (DfT STATS19), within 250 m and 500 m of the postcode: fatal, serious and slight (serious and slight are DfT severity-adjusted, so severityBasis: "dft-adjusted"), collisions per year and per km of road (OS Open Roads), a GB percentile, and pedestrians, cyclists, motorcyclists and children hurt. Also the nearest DfT-counted major road with its daily traffic, HGV share and whether the flow was counted or estimated, and a traffic exposure index with its GB decile. Counts describe a circle round the postcode, not one street. Sector, district, area, LSOA, MSOA and Data Zone rows carry a summary instead: means per postcode and the collisions in the area (inArea), each counted once at its nearest postcode
  • local-links - Where to go to act on an area (GOV.UK Local Links, data.police.uk, ONS, UK Parliament): the postcode's council and, in two-tier areas, its county; links to about 28 council service pages (bins, council tax, planning, school admissions, housing, reporting problems and more); NHS, flood warning, energy certificate, council tax band, coverage checker and journey planner links for its nation; its police neighbourhood team (Scotland: Police Scotland division); its Westminster constituency and links to its MP, MS or MSP. Each link has linkType (deep opens with this postcode's results, landing is a search page), status from our weekly check, and fallback: true when the council homepage stands in for a missing page. Sector, district, area, LSOA, MSOA and Data Zone rows list the councils, police forces and constituencies covering them with shares, and the majority council's links
  • access-times - Time to reach everyday services along the road network (OS Open Roads): the nearest GP practice, pharmacy, primary school, secondary school, food shop and town or city, on foot (4.8 km/h), by bike (16 km/h) and by car, each with minutes, network distance in metres and which place it is (places gives each place's name, coordinates and straight-line distance). Walking and cycling go along roads only and are null over 2 hours; car times are modelled from road type, not traffic; noRoadRoute marks a service that cannot be reached by road (for example from an island). Sector, district, area, LSOA, MSOA and Data Zone rows carry mean and median minutes and the share of postcodes within 15, 30, 45 and 60 minutes

Error Codes

  • 400 - Invalid request
  • 401 - Missing or invalid API key
  • 403 - Category not available on your plan
  • 404 - Location not found
  • 429 - Rate limit exceeded