API Documentation
Perú -- Open Data API
Access building codes, compliance rules, reference cities, and cost indices for Perú via our free REST API. No authentication required.
Base URL
https://api.gabarito.ioAvailable Endpoints
All endpoints return JSON. Replace {CC} with the country code PE.
/api/v1/open/PE/compliance-rulesList 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/PE/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"
}
]/api/v1/open/PE/citiesList 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/PE/cities" | python3 -m json.tool
Example Response
[
{
"code": "london",
"name": "London",
"population": 8982000,
"seismic_zone": "Zone 0",
"wind_speed_ms": 25,
"climate_zone": "Cfb"
}
]/api/v1/open/PE/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/PE/cities/{city}" | python3 -m json.toolExample Response
{
"code": "london",
"name": "London",
"population": 8982000,
"seismic_zone": "Zone 0",
"wind_speed_ms": 25,
"building_params": { ... },
"zones": [ ... ]
}/api/v1/open/PE/cities/{city}/building-codesGet 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/PE/cities/{city}/building-codes" | python3 -m json.toolExample Response
{
"code": "london",
"building_codes": [
{
"parameter": "max_building_height",
"value": "Varies by zone",
"reference": "London Plan Policy D9"
}
]
}/api/v1/open/PE/cities/{city}/zoningGet 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/PE/cities/{city}/zoning" | python3 -m json.toolExample Response
{
"code": "london",
"zones": [
{
"zone_id": "C1",
"name": "Central Activity Zone",
"max_far": 8.0,
"max_height_m": null
}
]
}/api/v1/open/PE/cost-indexGet 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/PE/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 }
]
}/api/v1/open/PE/completenessGet 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/PE/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 Perú API in your language of choice.
cURL
# Get compliance rules curl -s "https://api.gabarito.io/api/v1/open/PE/compliance-rules" \ | python3 -m json.tool # Get reference cities curl -s "https://api.gabarito.io/api/v1/open/PE/cities" \ | python3 -m json.tool # Get cost index curl -s "https://api.gabarito.io/api/v1/open/PE/cost-index" \ | python3 -m json.tool
Python
import requests
BASE = "https://api.gabarito.io"
CC = "PE"
# 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 = "PE";
// 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.
curl -s "https://api.gabarito.io/api/v1/open/pe/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.