API Documentation

Complete reference for the GeoData API

Authentication

All API requests require an API key passed in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Single Lookup

Get data for a single UK postcode:

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

Parameters

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

Code Examples

curl -X GET "https://geodata.api.leadinglogic.ai/v1/lookup?location=SW1A1AA&categories=demographics" \
  -H "Authorization: Bearer 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 "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "locations": ["SW1A1AA", "M11AD"],
    "categories": ["demographics"]
  }'

Data Categories

  • demographics - Population, age, ethnicity (Census 2021)
  • housing - Property prices, tenure (Land Registry)
  • crime - Crime statistics (Police UK)
  • business - Enterprise counts (ONS)
  • deprivation - IMD scores (MHCLG)

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