A comprehensive API for Swiss zoning information, building regulations, and cadastral data. Get detailed information about parcels, zoning codes, building parameters, and public-law restrictions (ÖREB) across Switzerland.
- Address Geocoding - Convert Swiss addresses to coordinates and parcel information
- Parcel Data - Retrieve EGRID, parcel numbers, and area from multiple authoritative sources
- Zoning Information - Get zone codes, categories, and descriptions
- Building Parameters - Access max height, floors, FAR, coverage limits, and setbacks
- ÖREB Integration - Fetch public-law restrictions from official cadastre
- Building Potential - Calculate development potential based on zoning rules
- Multi-Source Aggregation - Combines data from federal, cantonal, and municipal sources
- Zurich Optimization - Enhanced accuracy for Zurich addresses with WFS data
- Next.js 16 - React framework with App Router
- TypeScript - Full type safety
- Tailwind CSS - Styling
- Leaflet - Interactive maps
- Swiss APIs - geo.admin.ch, ÖREB, cantonal WFS services
# Clone repository
git clone <repository-url>
cd swiss-zoning-api
# Install dependencies
npm install
# or
pnpm install
# Run development server
npm run devOpen http://localhost:3000 to view the application.
Search for Swiss locations, addresses, and parcels.
Parameters:
q(required) - Search query (address, place name)limit(optional) - Maximum results (default: 10)lat,lng(optional) - Reverse geocode coordinates
Response:
{
"success": true,
"query": "Bahnhofstrasse 1, Zürich",
"results": [
{
"id": "123",
"label": "Bahnhofstrasse 1, 8001 Zürich",
"type": "address",
"coordinates": {
"lat": 47.3769,
"lng": 8.5417,
"swissEasting": 2683141,
"swissNorthing": 1247825
},
"egrid": "CH139977917088",
"municipality": "Zürich"
}
]
}Get comprehensive zoning information for a Swiss address or parcel.
Parameters:
address(required*) - Full Swiss addressegrid(required*) - Swiss parcel identifier (EGRID)
*One of address or egrid is required.
Response:
{
"success": true,
"address": "Bahnhofstrasse 1, 8001 Zürich",
"parcel": {
"egrid": "CH139977917088",
"number": "AA5662",
"area": 513,
"municipality": "Zürich",
"canton": "ZH",
"coordinates": {...},
"areaSources": [
{
"value": 513,
"source": "Zurich Map Viewer",
"confidence": "high"
}
]
},
"zone": {
"code": "K",
"name": "Kernzone",
"category": "mixed",
"description": "Central zone with mixed uses"
},
"buildingParameters": {
"maxHeight": 25,
"maxFloors": 6,
"maxFloorAreaRatio": 4.0,
"maxBuildingCoverage": 0.8
},
"buildingPotential": {
"maxGrossFloorArea": 2052,
"maxBuildingFootprint": 410,
"estimatedUnits": 25,
"developmentAssessment": "high"
},
"restrictions": [...],
"allowedUses": ["Residential", "Commercial", "Office"],
"prohibitedUses": ["Heavy Industry"],
"legalReferences": [...],
"sources": [...],
"orebExtractPdfUrl": "https://...",
"dataSourcesUsed": {
"parcel": ["Zurich Map Viewer"],
"zone": ["Zurich WFS"],
"buildingParams": ["Zurich ÖREB WFS"],
"restrictions": ["ÖREB"]
}
}# Run comprehensive test suite
npm test
# Test API endpoints
npm run test:apis
# Test Zurich addresses
npm run test:zurich
# Test building potential calculations
npm run test:potentialWhen multiple parcels overlap at a location (common in dense urban areas), the API uses a sophisticated selection algorithm:
- Identifies all parcels whose bounding boxes contain the query point
- Calculates the distance from the query point to each parcel's center
- Selects the parcel with the closest center to the query point
This ensures accurate parcel identification even in complex cadastral scenarios.
Example: Loorenstrasse 62, Zürich
- Correct parcel: WI3988 (11,156 m², center 12.8m from query point)
- Rejected: WI1743 (2,072 m², center 92.6m from query point)
The API aggregates data from multiple authoritative sources:
Federal:
- Swiss Cadastral Survey (geo.admin.ch)
- ÖREB Cadastre (cadastre.ch)
- Swiss Coordinate Systems (LV95/WGS84)
Cantonal (Zurich):
- Zurich ÖREB WFS (maps.zh.ch)
- Zurich Cadastral WFS (maps.zh.ch/wfs/OGDZHWFS)
- City of Zurich Zoning Maps (GIS-ZH)
Municipal:
- Building regulations (BZO)
- Zoning ordinances
- Local restrictions
Parcel area is fetched from multiple sources for accuracy:
- EGRID-based lookup (highest priority)
- Zurich Map Viewer API (for Zurich)
- Zurich WFS services
- geo.admin.ch identify service
- Building registry (GWR)
The API returns all sources with confidence levels for transparency.
swiss-zoning-api/
├── app/
│ ├── api/
│ │ ├── geocode/route.ts # Geocoding endpoint
│ │ ├── zoning/route.ts # Main zoning endpoint
│ │ └── oereb-pdf/route.ts # ÖREB PDF proxy
│ ├── components/ # React components
│ ├── page.tsx # Homepage
│ └── layout.tsx # Root layout
├── lib/
│ ├── services/ # API services
│ │ ├── geo-admin.ts # Swiss federal APIs
│ │ ├── oereb.tsx # ÖREB services
│ │ ├── zurich-zoning.tsx # Zurich-specific
│ │ ├── zurich-oereb-map.ts # Zurich cadastre
│ │ ├── parcel-data.ts # Multi-source parcel
│ │ └── building-potential.ts # Calculations
│ ├── types/
│ │ └── zoning.ts # TypeScript types
│ └── utils/ # Utilities
├── test-*.ts # Test scripts
└── package.json
No environment variables required - all APIs are public.
The project uses strict TypeScript configuration with full type safety across all API integrations.
- Add canton configuration to
lib/constants/cantons.ts - Implement WFS parser in
lib/services/[canton]-zoning.ts - Add canton detection to
lib/services/geo-admin.ts - Update zoning route to handle new canton
- Create service in
lib/services/ - Add type definitions to
lib/types/zoning.ts - Integrate in
lib/services/parcel-data.tsfor aggregation - Update
dataSourcesUsedtracking inapi/zoning/route.ts
- Rate Limits: Respects geo.admin.ch rate limits (no authentication required)
- ÖREB Availability: Some cantons may have limited ÖREB data
- Accuracy: Parcel areas are approximate; consult official documents for legal matters
- Coverage: Best coverage for Zurich; other cantons use federal data
This API provides informational data from public Swiss government sources. For official building permits and legal decisions, always consult:
- Your local building authority (Bauamt)
- Official ÖREB extracts
- Licensed surveyors and architects
Data sources:
- Swiss Federal Office of Topography (swisstopo)
- Swiss ÖREB Cadastre
- Cantonal and municipal authorities
Private - Not yet open source
For questions or issues, please contact the project maintainer.
Built with Next.js • TypeScript • Swiss Data