๐Ÿ‡ฌ๐Ÿ‡ง

API Documentation

United Kingdom -- Open Data API

Access building codes, compliance rules, reference cities, and cost indices for United Kingdom via our free REST API. No authentication required.

Base URL

https://api.gabarito.io

Available Endpoints

All endpoints return JSON. Replace {CC} with the country code GB.

GET/api/v1/open/GB/compliance-rules

List all compliance rules for this country. Includes rule IDs, descriptions, fields, operators, values, severity, and code references.

Example Request

curl -s "https://api.gabarito.io/api/v1/open/GB/compliance-rules" | python3 -m json.tool

Example Response

[
  {
    "rule_id": "structural_min_concrete_strength",
    "description": "Minimum concrete strength class",
    "field": "fck_mpa",
    "operator": ">=",
    "value": 20,
    "severity": "critical",
    "code_reference": "Section 8.2.1"
  }
]
GET/api/v1/open/GB/cities

List all reference cities with building parameters like population, seismic zone, wind speed, climate zone, and reference cost per square meter.

Example Request

curl -s "https://api.gabarito.io/api/v1/open/GB/cities" | python3 -m json.tool

Example Response

[
  {
    "code": "london",
    "name": "London",
    "population": 8982000,
    "seismic_zone": "Zone 0",
    "wind_speed_ms": 25,
    "climate_zone": "Cfb"
  }
]
GET/api/v1/open/GB/cities/{city}

Get detailed data for a specific reference city, including all building parameters and zone information.

Example Request

curl -s "https://api.gabarito.io/api/v1/open/GB/cities/{city}" | python3 -m json.tool

Example Response

{
  "code": "london",
  "name": "London",
  "population": 8982000,
  "seismic_zone": "Zone 0",
  "wind_speed_ms": 25,
  "building_params": { ... },
  "zones": [ ... ]
}
GET/api/v1/open/GB/cities/{city}/building-codes

Get building code parameters for a specific city. Includes structural, fire, accessibility, and energy requirements.

Example Request

curl -s "https://api.gabarito.io/api/v1/open/GB/cities/{city}/building-codes" | python3 -m json.tool

Example Response

{
  "code": "london",
  "building_codes": [
    {
      "parameter": "max_building_height",
      "value": "Varies by zone",
      "reference": "London Plan Policy D9"
    }
  ]
}
GET/api/v1/open/GB/cities/{city}/zoning

Get zoning rules and zone definitions for a specific city. Includes permitted uses, setbacks, floor area ratios, and height limits.

Example Request

curl -s "https://api.gabarito.io/api/v1/open/GB/cities/{city}/zoning" | python3 -m json.tool

Example Response

{
  "code": "london",
  "zones": [
    {
      "zone_id": "C1",
      "name": "Central Activity Zone",
      "max_far": 8.0,
      "max_height_m": null
    }
  ]
}
GET/api/v1/open/GB/cost-index

Get the construction cost index for this country. Includes source, currency, current value, and historical data when available.

Example Request

curl -s "https://api.gabarito.io/api/v1/open/GB/cost-index" | python3 -m json.tool

Example Response

{
  "country": "GB",
  "source": "BCIS",
  "currency": "GBP",
  "current_index": 398.2,
  "history": [
    { "period": "2024-Q4", "value": 398.2 }
  ]
}
GET/api/v1/open/GB/completeness

Get data completeness statistics: number of compliance rules, cities, building parameters, zoning zones, and an overall completeness percentage.

Example Request

curl -s "https://api.gabarito.io/api/v1/open/GB/completeness" | python3 -m json.tool

Example Response

{
  "country": "GB",
  "rules": 35,
  "cities": 3,
  "building_params": 42,
  "zoning_zones": 18,
  "completeness": 78
}

Quick Start

Get started with the United Kingdom API in your language of choice.

cURL

# Get compliance rules
curl -s "https://api.gabarito.io/api/v1/open/GB/compliance-rules" \
  | python3 -m json.tool

# Get reference cities
curl -s "https://api.gabarito.io/api/v1/open/GB/cities" \
  | python3 -m json.tool

# Get cost index
curl -s "https://api.gabarito.io/api/v1/open/GB/cost-index" \
  | python3 -m json.tool

Python

import requests

BASE = "https://api.gabarito.io"
CC = "GB"

# Compliance rules
rules = requests.get(
    f"{BASE}/api/v1/open/{CC}/compliance-rules"
).json()
print(f"{len(rules)} rules")

# Reference cities
cities = requests.get(
    f"{BASE}/api/v1/open/{CC}/cities"
).json()
for city in cities:
    print(city["name"])

JavaScript

const BASE = "https://api.gabarito.io";
const CC = "GB";

// Compliance rules
const rules = await fetch(
  `${BASE}/api/v1/open/${CC}/compliance-rules`
).then(r => r.json());
console.log(`${rules.length} rules`);

// Reference cities
const cities = await fetch(
  `${BASE}/api/v1/open/${CC}/cities`
).then(r => r.json());
cities.forEach(c => console.log(c.name));

API Playground

Test the GABARITO Open Data API endpoints directly in your browser.

GET https://api.gabarito.io/api/v1/open/gb/compliance-rules
curl -s "https://api.gabarito.io/api/v1/open/gb/compliance-rules" | python3 -m json.tool

Click "Send Request" to see the response.

API Guidelines

Rate Limits

No authentication required for open endpoints. 100 requests per minute per IP.

Response Format

All endpoints return JSON with Content-Type: application/json. Arrays for list endpoints, objects for detail endpoints.

Data License

Open data is licensed under CC BY 4.0. Building codes are public law -- compliance data should be open and accessible.