API Documentation

Complete reference for the UKDataAPI. 14 endpoints, proprietary scoring, 400+ UK government sources.

Base URL: https://www.ukdatapi.com

Quick Start

  1. Get an API key at ukdatapi.com/#pricing
  2. Make your first call:
    curl -H "Authorization: Bearer YOUR_API_KEY" \
      "https://www.ukdatapi.com/api/v1/entity/00000006"
  3. Get enriched data with proprietary scoring — distress scores, risk ratings, investment signals, and more.

Authentication

Pass your API key using either header:

Authorization: Bearer ukd_live_...
# or
X-API-Key: ukd_live_...

ukd_live_ — Production keys. Deducts credits from your plan.

ukd_test_ — Sandbox keys. Returns mock data, no credits deducted.

Rate Limits & Credits

TierPriceCredits/moRate Limit
Free€020010/min
Starter€39/mo8,00060/min
Growth€129/mo30,000200/min
Scale€349/mo150,000500/min

Depth Parameter

Most endpoints accept a depth query parameter that controls how much data is returned — and how many credits are consumed.

summary — Cheapest. Key fields only. Ideal for list views and quick checks.

standard — Default. Balanced detail. Includes proprietary scores.

full — Most data. All available fields, historical data, and deep analysis.

Endpoints

4.1 Entity Intelligence

GET /api/v1/entity/{identifier}

Parameters

NameTypeRequiredDescription
identifierstringYesCompany number (e.g. 00000006) or company name
depthstringNosummary | standard | full (default: standard)
includestringNoComma-separated list of sections to include

Credit Cost

DepthCredits
summary2
standard8
full16

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/entity/00000006?depth=standard"

Example Response

{
  "entity": {
    "company_number": "00000006",
    "company_name": "MARINE AND GENERAL MUTUAL...",
    "company_status": "active",
    "incorporation_date": "1852-07-01",
    "sic_codes": ["65120"]
  },
  "officers": [
    { "name": "John Smith", "role": "director", "appointed": "2019-03-15" }
  ],
  "distress_score": {
    "score": 22,
    "rating": "LOW_RISK",
    "recommendation": "PROCEED"
  }
}

4.2 Location Intelligence

GET /api/v1/location/{postcode}

Parameters

NameTypeRequiredDescription
postcodestringYesUK postcode (URL-encoded, e.g. SW1A%201AA)
depthstringNosummary | standard | full (default: standard)
radius_mnumberNoSearch radius in metres

Credit Cost

DepthCredits
summary2
standard10
full20

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/location/SW1A%201AA?depth=standard"

Example Response

{
  "location": {
    "postcode": "SW1A 1AA",
    "latitude": 51.501009,
    "longitude": -0.141588,
    "admin_district": "Westminster"
  },
  "crime": {
    "total_last_month": 847,
    "top_category": "theft-from-the-person"
  },
  "environment": {
    "flood": { "risk_level": "very_low" }
  },
  "services": {
    "nearest_gp": "The Practice Soho",
    "nearest_school": "St Matthew's Westminster"
  }
}

4.3 Property Intelligence

GET /api/v1/property/{postcode}

Parameters

NameTypeRequiredDescription
postcodestringYesUK postcode (URL-encoded)
depthstringNosummary | standard | full (default: standard)

Credit Cost

DepthCredits
summary5
standard15
full30

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/property/SW1A%201AA"

Example Response

{
  "price_history": {
    "avg_price": 1250000,
    "transactions_12m": 12,
    "trend": "rising"
  },
  "energy": {
    "avg_epc_rating": "C",
    "avg_efficiency": 68
  },
  "planning": {
    "applications_12m": 34,
    "approved_rate": 0.82
  },
  "environmental_risk": {
    "score": 31,
    "rating": "LOW"
  }
}

4.4 Due Diligence Report

GET /api/v1/report/entity/{identifier}

Parameters

NameTypeRequiredDescription
identifierstringYesCompany number or company name

Credit Cost

25 credits per request (flat rate)

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/report/entity/00000006"

Example Response

{
  "verdict": "PROCEED",
  "distress_score": {
    "score": 22,
    "rating": "LOW_RISK"
  },
  "red_flags": [],
  "green_flags": [
    "Accounts filed on time for 5+ years",
    "No adverse Gazette notices",
    "Stable director tenure"
  ],
  "recommendation": "Low-risk entity suitable for engagement."
}

4.5 Environmental Risk

GET /api/v1/environment/{postcode}

Parameters

NameTypeRequiredDescription
postcodestringYesUK postcode (URL-encoded)
depthstringNosummary | standard | full (default: standard)

Credit Cost

DepthCredits
summary4
standard12
full24

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/environment/SW1A%201AA"

Example Response

{
  "risk_score": {
    "score": 28,
    "rating": "LOW",
    "factors": ["flood_low", "geology_stable", "air_moderate"]
  },
  "flood": {
    "river_sea": "very_low",
    "surface_water": "low"
  },
  "geology": {
    "radon": "low",
    "shrink_swell": "negligible"
  }
}

4.6 Market Sizing

GET /api/v1/market/{postcode}

Parameters

NameTypeRequiredDescription
postcodestringYesUK postcode (URL-encoded)
sectorstringNoIndustry or business type (e.g. restaurant)
depthstringNosummary | standard | full (default: standard)

Credit Cost

DepthCredits
summary5
standard15
full30

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/market/M1%201AA?sector=restaurant"

Example Response

{
  "labour_market": {
    "unemployment_rate": 4.2,
    "median_wage": 31500
  },
  "property_market": {
    "avg_commercial_rent_sqft": 28.50,
    "vacancy_rate": 0.07
  },
  "competition": {
    "businesses_in_sector": 142,
    "density_per_1000": 3.8
  },
  "market_opportunity": {
    "score": 72,
    "rating": "HIGH"
  }
}

4.7 Trade & Customs

GET /api/v1/trade/{commodity}

Parameters

NameTypeRequiredDescription
commoditystringYesCommodity code or description (e.g. beef, 0201)

Credit Cost

10 credits per request (flat rate)

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/trade/beef"

Example Response

{
  "commodity": {
    "code": "0201",
    "description": "Meat of bovine animals, fresh or chilled"
  },
  "duties": {
    "third_country": "12.8% + 303.4 EUR/100 kg"
  },
  "preferential_rates": [
    { "country": "Australia", "rate": "0%", "agreement": "UK-Australia FTA" },
    { "country": "New Zealand", "rate": "0%", "agreement": "UK-NZ FTA" }
  ]
}

4.8 Education

GET /api/v1/education/{postcode}

Parameters

NameTypeRequiredDescription
postcodestringYesUK postcode (URL-encoded)
depthstringNosummary | standard | full (default: standard)
phasestringNoFilter by phase (primary, secondary, etc.)

Credit Cost

DepthCredits
summary3
standard8
full16

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/education/SW1A%201AA?phase=primary"

Example Response

{
  "schools": [
    {
      "name": "St Matthew's Westminster CE Primary",
      "phase": "primary",
      "ofsted_rating": "Outstanding",
      "distance_m": 320,
      "pupils": 210
    }
  ],
  "summary": {
    "outstanding": 3,
    "good": 8,
    "requires_improvement": 1,
    "inadequate": 0
  }
}

4.9 Transport

GET /api/v1/transport/{postcode}

Parameters

NameTypeRequiredDescription
postcodestringYesUK postcode (URL-encoded)
depthstringNosummary | standard | full (default: standard)

Credit Cost

DepthCredits
summary3
standard8
full16

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/transport/SW1A%201AA"

Example Response

{
  "nearest_stations": [
    { "name": "Westminster", "type": "tube", "distance_m": 210 },
    { "name": "St James's Park", "type": "tube", "distance_m": 350 },
    { "name": "London Waterloo", "type": "rail", "distance_m": 890 }
  ],
  "connectivity_score": 94,
  "connectivity_rating": "EXCELLENT"
}

4.10 Vehicle

GET /api/v1/vehicle/{registration}

Parameters

NameTypeRequiredDescription
registrationstringYesVehicle registration number (e.g. AB12CDE)

Credit Cost

6 credits per request (flat rate)

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/vehicle/AB12CDE"

Example Response

{
  "vehicle": {
    "make": "BMW",
    "model": "320D",
    "colour": "Black",
    "fuel_type": "Diesel",
    "first_registered": "2019-03-15"
  },
  "mot_history": [
    { "test_date": "2024-03-10", "result": "PASS", "mileage": 45230 },
    { "test_date": "2023-03-08", "result": "PASS", "mileage": 33100 }
  ],
  "health_score": 82,
  "mileage_trend": [
    { "year": 2023, "mileage": 33100 },
    { "year": 2024, "mileage": 45230 }
  ]
}

4.11 Health

GET /api/v1/health/{postcode}

Parameters

NameTypeRequiredDescription
postcodestringYesUK postcode (URL-encoded)
depthstringNosummary | standard | full (default: standard)

Credit Cost

DepthCredits
summary4
standard12
full24

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/health/SW1A%201AA"

Example Response

{
  "indicators": {
    "life_expectancy_male": 83.1,
    "life_expectancy_female": 86.4,
    "obesity_prevalence": 0.18
  },
  "care_providers": [
    { "name": "The Practice Soho", "type": "GP", "cqc_rating": "Good", "distance_m": 640 }
  ],
  "prescribing": {
    "total_items_per_1000": 8420,
    "antibiotics_per_1000": 312
  }
}

4.12 Energy & ESG

GET /api/v1/energy/{postcode}

Parameters

NameTypeRequiredDescription
postcodestringYesUK postcode (URL-encoded)
depthstringNosummary | standard | full (default: standard)

Credit Cost

DepthCredits
summary4
standard12
full24

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/energy/SW1A%201AA"

Example Response

{
  "carbon": {
    "grid_intensity_gco2_kwh": 182,
    "renewable_percentage": 42.5
  },
  "grid": {
    "generation_mix": {
      "wind": 35.2,
      "gas": 28.1,
      "nuclear": 15.8,
      "solar": 8.4
    }
  },
  "local_efficiency": {
    "avg_epc_rating": "D",
    "avg_co2_tonnes": 3.2
  },
  "esg_score": 64,
  "esg_rating": "MODERATE"
}

4.14 Tender Intelligence

GET /api/v1/tenders

Parameters

NameTypeRequiredDescription
sectorstringNoIndustry sector (e.g. construction)
regionstringNoUK region (e.g. London, North West)

Credit Cost

10 credits per request (flat rate)

Example Request

curl -H "Authorization: Bearer ukd_live_..." \
  "https://www.ukdatapi.com/api/v1/tenders?sector=construction"

Example Response

{
  "tenders": [
    {
      "title": "School Refurbishment Programme",
      "buyer": "Department for Education",
      "value": 2400000,
      "deadline": "2025-03-15",
      "status": "open"
    }
  ],
  "summary": {
    "open": 47,
    "awarded": 312,
    "avg_value": 850000
  }
}

Scoring Algorithms

UKDataAPI enriches raw government data with proprietary scores. Each score is a normalised 0-100 value with a human-readable rating.

Corporate Distress Score

Used in: Entity Intelligence

0 = healthy, 100 = critical

LOW_RISK → MODERATE_RISK → ELEVATED_RISK → HIGH_RISK → CRITICAL_RISK

Environmental Risk Score

Used in: Environmental Risk, Property Intelligence

0 = minimal risk, 100 = severe risk

LOW → MODERATE → ELEVATED → HIGH → SEVERE

Area Investment Score

Used in: Location Intelligence

0 = poor prospect, 100 = strong prospect

POOR → BELOW_AVERAGE → AVERAGE → GOOD → STRONG

ESG Score

Used in: Energy & ESG

0 = poor, 100 = excellent

POOR → BELOW_AVERAGE → MODERATE → GOOD → STRONG

Vehicle Health Score

Used in: Vehicle

0 = poor condition, 100 = excellent condition

POOR → FAIR → GOOD → VERY_GOOD → EXCELLENT

Market Opportunity Score

Used in: Market Sizing

0 = saturated/weak, 100 = high opportunity

LOW → MODERATE → GOOD → HIGH

Connectivity Score

Used in: Transport

0 = isolated, 100 = highly connected

LIMITED → MODERATE → GOOD → VERY_GOOD → EXCELLENT

Error Codes

StatusCodeMeaning
401INVALID_API_KEYMissing or invalid API key
402PAYMENT_REQUIREDInsufficient credits
429RATE_LIMITEDRate limit exceeded
500INTERNAL_ERRORServer error

Example Error Response

{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded. Retry after 12 seconds.",
    "retry_after": 12
  }
}

AI Agents (x402 / MCP)

MCP (Model Context Protocol)

Connect any MCP-compatible AI agent to all 14 UKDataAPI tools with a single endpoint.

https://www.ukdatapi.com/api/mcp
  • 14 tools available for Claude Desktop, Cursor, LangChain, and any MCP client
  • Listed on the Official MCP Registry
  • Uses your existing API key for authentication

x402 — Pay-per-Call with USDC

No signup needed. AI agents pay per request with USDC on Base network using the x402 protocol.

  • Endpoints available at /api/x402/ (same structure as v1)
  • Payment via USDC on Base (Coinbase L2)
  • Ideal for autonomous agents — no API key management
  • Compatible with any x402-enabled HTTP client