Introduction
API for accessing Swiss building registry (GWR) data, electricity tariffs from grid operators (VNB), and related infrastructure information.
This documentation aims to provide all the information you need to work with our API.
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_API_TOKEN}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your API token by logging into your account and navigating to Settings → API Tokens. Use Laravel Sanctum Bearer tokens for authentication.
Buildings
List buildings by municipality (BFS)
requires authentication
Returns a paginated list of GWR buildings for a given municipality (BFS number). Code label resolution is disabled by default for performance; enable with resolve_codes=1.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/buildings?municipality=261&per_page=200&lang=de&resolve_codes=1" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"municipality\": 4326.41688,
\"per_page\": 17,
\"lang\": \"de\",
\"resolve_codes\": true
}"
const url = new URL(
"https://gwr-datahub.test/api/buildings"
);
const params = {
"municipality": "261",
"per_page": "200",
"lang": "de",
"resolve_codes": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"municipality": 4326.41688,
"per_page": 17,
"lang": "de",
"resolve_codes": true
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get lightweight map data for buildings by municipality
requires authentication
Returns minimal building data optimized for map visualizations. Only includes buildings with valid coordinates (latitude/longitude).
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/buildings/map-data?municipality=261&per_page=200&page=1" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"municipality\": 4326.41688,
\"per_page\": 17,
\"page\": 35
}"
const url = new URL(
"https://gwr-datahub.test/api/buildings/map-data"
);
const params = {
"municipality": "261",
"per_page": "200",
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"municipality": 4326.41688,
"per_page": 17,
"page": 35
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get building information by EGID
requires authentication
Returns detailed information about a building from the GWR (Gebäude- und Wohnungsregister) database. All code fields are automatically resolved to their human-readable labels in the specified language.
If address or solar potential data is missing, it will be automatically synchronized before returning the response.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/buildings/1234567890?lang=de&sync=" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/buildings/1234567890"
);
const params = {
"lang": "de",
"sync": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"egid": "1234567890",
"gdekt": "ZH",
"ggdenr": "261",
"ggdename": "Zürich",
"egrid": "2680000.0,1240000.0",
"gbez": "Wohnhaus",
"gkode": "01",
"gkode_label": "Wohngebäude",
"gstat": "01",
"gstat_label": "Bestehend",
"gkat": "01",
"gkat_label": "Einfamilienhaus",
"gbauj": 1990,
"garea": 150.5,
"gvol": 450,
"address": {
"street": "Hauptstrasse 45",
"postal_code": "6260",
"city": "Reiden"
},
"solar_roofs": [
{
"attributes": {
"building_id": "229760",
"suitability": "high"
},
"geometry": {
"rings": [
[
[
2640325.75,
1232914.625
]
]
]
}
}
],
"solar_facades": [
{
"attributes": {
"building_id": "229760",
"suitability": "medium"
},
"geometry": {
"rings": [
[
[
2640325.75,
1232914.625
]
]
]
}
}
],
"created_at": "2025-01-01T00:00:00+00:00",
"updated_at": "2025-01-01T00:00:00+00:00"
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Building not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
EVU Tariffs
List all grid operators
requires authentication
Returns a paginated list of all active grid operators (Verteilnetzbetreiber) with their tariff URL status and information about the latest successful tariff submission.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/evu-tariffs/operators?per_page=50&status=found&search=EKZ" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/evu-tariffs/operators"
);
const params = {
"per_page": "50",
"status": "found",
"search": "EKZ",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
{
"ch_uid": "CHE-108.954.688",
"name": "Elektrizitätswerke des Kantons Zürich (EKZ)",
"website_url": "www.ekz.ch",
"tariff_url": "https://ekz.ch/api/tariffs.json",
"tariff_url_status": "found",
"tariff_url_verified_at": "2026-01-15T10:00:00+00:00",
"is_active": true,
"latest_submission": {
"fetched_at": "2026-01-15T10:00:00+00:00",
"tariff_year": 2026,
"tariff_count": 12
},
"elcom_synced_at": "2026-01-01T00:00:00+00:00"
}
],
"links": {
"first": "https://example.com/api/evu-tariffs/operators?page=1",
"last": "https://example.com/api/evu-tariffs/operators?page=10",
"prev": null,
"next": "https://example.com/api/evu-tariffs/operators?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 10,
"per_page": 50,
"to": 50,
"total": 500
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a single grid operator
requires authentication
Returns detailed information about a specific grid operator (Verteilnetzbetreiber) by its CH UID, including the latest submission status and tariff URL information.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/evu-tariffs/operators/CHE-108.954.688" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/evu-tariffs/operators/CHE-108.954.688"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"ch_uid": "CHE-108.954.688",
"name": "Elektrizitätswerke des Kantons Zürich (EKZ)",
"website_url": "www.ekz.ch",
"tariff_url": "https://ekz.ch/api/tariffs.json",
"tariff_url_status": "found",
"tariff_url_verified_at": "2026-01-15T10:00:00+00:00",
"is_active": true,
"latest_submission": {
"fetched_at": "2026-01-15T10:00:00+00:00",
"tariff_year": 2026,
"tariff_count": 12
},
"elcom_synced_at": "2026-01-01T00:00:00+00:00"
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"error": "Grid operator not found",
"code": "operator_not_found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get tariffs for a grid operator
requires authentication
Returns the cached tariffs for a specific grid operator in the standard format according to StromVV Art. 7b. The response includes all tariff types:
electricity: Elektrizitätstarif (energy costs)grid: Netznutzungstarif (grid usage fees)metering: Messtarif (metering costs)regional_fees: Abgaben an Gemeinwesen (taxes and levies)
Tariff forms can be:
constant: Single price (Einheitstarif)multilevel: Time-of-use pricing with HT/NT (Mehrstufentarif)dynamic: Real-time pricing (Dynamischer Tarif) - use the dynamic endpoint for current prices
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/evu-tariffs/operators/CHE-108.954.688/tariffs?year=2026" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/evu-tariffs/operators/CHE-108.954.688/tariffs"
);
const params = {
"year": "2026",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"dsoName": "Elektrizitätswerke des Kantons Zürich (EKZ)",
"dsoNumber": 10895468800,
"tariffs": [
{
"customerVoltageLevel": 7,
"tariffName": "Haushalt Standard",
"tariffType": "electricity",
"tariffForm": "multilevel",
"startDate": "2026-01-01",
"endDate": "2026-12-31",
"comment": null,
"customerType": "household",
"prices": {
"multilevel": {
"levels": [
{
"name": "HT",
"price": 0.22,
"unit": "CHF/kWh"
},
{
"name": "NT",
"price": 0.18,
"unit": "CHF/kWh"
}
]
}
}
},
{
"customerVoltageLevel": 7,
"tariffName": "Netznutzung Haushalt",
"tariffType": "grid",
"tariffForm": "constant",
"startDate": "2026-01-01",
"endDate": "2026-12-31",
"comment": null,
"customerType": "household",
"prices": {
"constant": {
"price": 0.08,
"unit": "CHF/kWh"
}
}
}
],
"_meta": {
"ch_uid": "CHE-108.954.688",
"fetched_at": "2026-01-15T10:00:00+00:00",
"tariff_year": 2026,
"source_url": "https://ekz.ch/api/tariffs.json"
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404, Operator not found):
{
"error": "Grid operator not found",
"code": "operator_not_found"
}
Example response (404, No tariffs available):
{
"error": "No tariffs found for this operator",
"code": "tariffs_not_found",
"operator": "CHE-108.954.688",
"year": 2026
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Proxy dynamic tariff data
requires authentication
Proxies requests to the dynamic tariff URL of a grid operator to retrieve real-time pricing data. This endpoint is only available for operators that offer dynamic tariffs (tariffForm: "dynamic").
The response format depends on the grid operator's implementation but typically includes current and/or upcoming electricity prices with timestamps.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/evu-tariffs/operators/CHE-108.954.688/dynamic" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/evu-tariffs/operators/CHE-108.954.688/dynamic"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"timestamp": "2026-01-15T14:00:00+01:00",
"prices": [
{
"start": "2026-01-15T14:00:00+01:00",
"end": "2026-01-15T15:00:00+01:00",
"price": 0.185,
"unit": "CHF/kWh"
},
{
"start": "2026-01-15T15:00:00+01:00",
"end": "2026-01-15T16:00:00+01:00",
"price": 0.215,
"unit": "CHF/kWh"
}
]
}
Example response (400, No dynamic tariff available):
{
"error": "Operator does not have a dynamic tariff URL configured",
"code": "proxy_error"
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"error": "Grid operator not found",
"code": "operator_not_found"
}
Example response (502, Upstream error):
{
"error": "Failed to fetch dynamic tariff data from operator",
"code": "proxy_error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
BDEW Profiles
List all BDEW profile codes
requires authentication
Returns a list of all available BDEW standard load profile codes (e.g., H0, G0-G6, L0-L2). Each profile code represents a category of electricity consumption patterns.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/bdew-profiles" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/bdew-profiles"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
{
"code": "H0",
"name": "Household",
"category": "household",
"description": "Standard household profile",
"metadata": {}
},
{
"code": "G25",
"name": "Commercial",
"category": "commercial",
"description": "Commercial profile",
"metadata": {}
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get all variations for a BDEW profile code
requires authentication
Returns all 9 variations (3 seasons × 3 day types) for a specific BDEW profile code. Each variation contains 96 normalized values representing 15-minute intervals for a day.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/bdew-profiles/H0" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/bdew-profiles/H0"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"code": "H0",
"name": "Household",
"category": "household",
"variations": [
{
"profile_code": "H0",
"season": "winter",
"day_type": "weekday",
"values": [0.0104, 0.0099, ...],
"is_dynamized": true,
"description": null,
"metadata": {}
},
{
"profile_code": "H0",
"season": "winter",
"day_type": "saturday",
"values": [0.0104, 0.0099, ...],
"is_dynamized": true,
"description": null,
"metadata": {}
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Profile code not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get daily template for a BDEW profile code by date
requires authentication
Returns the correct BDEW load profile template for a specific date. The season (winter/summer/transition) and day type (weekday/saturday/sunday) are automatically determined from the date.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/bdew-profiles/H0/daily?date=2025-01-15" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"date\": \"2026-07-14\"
}"
const url = new URL(
"https://gwr-datahub.test/api/bdew-profiles/H0/daily"
);
const params = {
"date": "2025-01-15",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"date": "2026-07-14"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"code": "H0",
"date": "2025-01-15",
"season": "winter",
"day_type": "wednesday",
"values": [0.0104, 0.0099, ...],
"is_dynamized": true,
"description": null,
"metadata": {}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Profile code not found"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"date": [
"The date field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get yearly profile for a BDEW profile code
requires authentication
Returns a complete year's worth of BDEW load profile data with all 365/366 days. Each day includes 96 quarter-hour values, with dynamization applied where applicable. Holidays are treated as Sundays, and Dec 24/31 use Saturday templates.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/bdew-profiles/H25/year?year=2025" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
const url = new URL(
"https://gwr-datahub.test/api/bdew-profiles/H25/year"
);
const params = {
"year": "2025",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"code": "H25",
"year": 2025,
"is_dynamized": true,
"total_kwh": 1000000.00,
"days": [
{
"date": "2025-01-01",
"day_of_year": 1,
"month": 1,
"day_type": "sunday",
"is_holiday": true,
"holiday_name": "Neujahr",
"dynamization_factor": 1.2421,
"values": [22.15, 20.81, 19.76, ...]
}
],
"meta": {
"total_days": 365,
"is_leap_year": false,
"generated_at": "2025-01-15T10:30:00Z"
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Profile code not found"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"year": [
"The year field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List available years for a profile code
requires authentication
Returns the years that have pre-generated yearly profiles available.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/bdew-profiles/H25/years" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/bdew-profiles/H25/years"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"code": "H25",
"available_years": [
2024,
2025,
2026
],
"supported_range": {
"min": 2020,
"max": 2035
}
}
Example response (404):
{
"message": "Profile code not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reference Market Prices
List reference market prices
requires authentication
Returns a paginated list of BFE reference market prices (Art. 15 EnFV). Prices are available for different technologies (photovoltaic, hydropower, biomass, wind, geothermal) and different period types (monthly, quarterly).
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/reference-market-prices?technology=photovoltaic&period_type=monthly&year=2025&per_page=100" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"technology\": \"photovoltaic\",
\"period_type\": \"monthly\",
\"year\": 1,
\"per_page\": 22
}"
const url = new URL(
"https://gwr-datahub.test/api/reference-market-prices"
);
const params = {
"technology": "photovoltaic",
"period_type": "monthly",
"year": "2025",
"per_page": "100",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"technology": "photovoltaic",
"period_type": "monthly",
"year": 1,
"per_page": 22
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": 1,
"technology": "photovoltaic",
"technology_label": "Photovoltaik",
"period_type": "monthly",
"period_type_label": "Monatlich",
"year": 2025,
"period": 1,
"period_label": "Januar 2025",
"price": 85.5,
"price_unit": "CHF/MWh",
"volume": 125000,
"volume_unit": "MWh",
"created_at": "2025-01-15T12:00:00+00:00",
"updated_at": "2025-01-15T12:00:00+00:00"
}
],
"links": {
"first": "...",
"last": "...",
"prev": null,
"next": "..."
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"per_page": 100,
"to": 100,
"total": 450
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get latest prices per technology
requires authentication
Returns the most recent reference market price for each technology, grouped by period type (monthly and quarterly).
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/reference-market-prices/latest" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/reference-market-prices/latest"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"monthly": {
"photovoltaic": {
"id": 1,
"technology": "photovoltaic",
"technology_label": "Photovoltaik",
"period_type": "monthly",
"period_type_label": "Monatlich",
"year": 2025,
"period": 12,
"period_label": "Dezember 2025",
"price": 85.5,
"price_unit": "CHF/MWh",
"volume": 125000,
"volume_unit": "MWh",
"created_at": "2025-01-15T12:00:00+00:00",
"updated_at": "2025-01-15T12:00:00+00:00"
}
},
"quarterly": {
"photovoltaic": {
"id": 2,
"technology": "photovoltaic",
"period_type": "quarterly",
"year": 2025,
"period": 4,
"period_label": "Q4 2025",
"price": 82.3
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List available technologies
requires authentication
Returns a list of all available technologies with their labels.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/reference-market-prices/technologies" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/reference-market-prices/technologies"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"technologies": [
{
"value": "photovoltaic",
"label": "Photovoltaik"
},
{
"value": "hydropower",
"label": "Wasserkraft"
},
{
"value": "biomass",
"label": "Biomasse"
},
{
"value": "wind",
"label": "Windenergie"
},
{
"value": "geothermal",
"label": "Geothermie"
}
],
"period_types": [
{
"value": "monthly",
"label": "Monatlich"
},
{
"value": "quarterly",
"label": "Quartal"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reference Market Price Predictions
List reference market price predictions
requires authentication
Returns a paginated list of predicted reference market prices based on EPEX spot prices and ENTSO-E generation profiles (BFE Art. 15 EnFV methodology).
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/reference-market-price-predictions?technology=photovoltaic&period_type=monthly&year=2026&per_page=100" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"technology\": \"geothermal\",
\"period_type\": \"monthly\",
\"year\": 1,
\"per_page\": 22
}"
const url = new URL(
"https://gwr-datahub.test/api/reference-market-price-predictions"
);
const params = {
"technology": "photovoltaic",
"period_type": "monthly",
"year": "2026",
"per_page": "100",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"technology": "geothermal",
"period_type": "monthly",
"year": 1,
"per_page": 22
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": 1,
"technology": "photovoltaic",
"technology_label": "Photovoltaik",
"period_type": "monthly",
"period_type_label": "Monatlich",
"year": 2026,
"period": 1,
"period_label": "Januar 2026",
"price": 72.35,
"price_unit": "CHF/MWh",
"volume": 125000,
"volume_unit": "MWh",
"calculated_at": "2026-02-10T07:30:00+00:00",
"data_completeness": 98.5,
"is_partial": false,
"created_at": "2026-01-15T12:00:00+00:00",
"updated_at": "2026-02-10T07:30:00+00:00"
}
],
"links": {},
"meta": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get latest predictions per technology
requires authentication
Returns the most recent prediction for each technology, grouped by period type (monthly and quarterly).
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/reference-market-price-predictions/latest" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/reference-market-price-predictions/latest"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"monthly": {
"photovoltaic": {}
},
"quarterly": {
"photovoltaic": {}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get current month prediction
requires authentication
Returns the prediction for the current (in-progress) month, including data completeness and partial status.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/reference-market-price-predictions/current-month" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/reference-market-price-predictions/current-month"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"year": 2026,
"month": 2,
"predictions": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Compare predictions with official BFE values
requires authentication
Returns a side-by-side comparison of predicted values against the official BFE reference market prices where both are available.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/reference-market-price-predictions/compare?technology=photovoltaic&year=2026" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/reference-market-price-predictions/compare"
);
const params = {
"technology": "photovoltaic",
"year": "2026",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"comparisons": [
{
"technology": "photovoltaic",
"period_type": "monthly",
"year": 2026,
"period": 1,
"period_label": "Januar 2026",
"predicted_price": 72.35,
"official_price": 73.1,
"deviation": -0.75,
"deviation_percent": -1.03,
"data_completeness": 98.5
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Transformer Stations
List transformer stations
requires authentication
Returns a list of transformer stations (Trafostationen) with various filtering options.
You can filter by municipality (BFS number), postal code, status, or search within a radius using coordinates.
Coordinates are taken directly from gwr_buildings.GKODE (Easting) and gwr_buildings.GKODN (Northing).
The egrid field contains the raw EGRID value from gwr_buildings.EGRID.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/transformer-stations?municipality=261&postal_code=8001&status=confirmed&lat=47.3769&lng=8.5417&radius=1000&east=2680000&north=1240000" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"municipality\": 4326.41688,
\"postal_code\": 4326.41688,
\"lat\": -90,
\"lng\": -180,
\"east\": 4326.41688,
\"north\": 4326.41688,
\"radius\": 17,
\"status\": \"confirmed\"
}"
const url = new URL(
"https://gwr-datahub.test/api/transformer-stations"
);
const params = {
"municipality": "261",
"postal_code": "8001",
"status": "confirmed",
"lat": "47.3769",
"lng": "8.5417",
"radius": "1000",
"east": "2680000",
"north": "1240000",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"municipality": 4326.41688,
"postal_code": 4326.41688,
"lat": -90,
"lng": -180,
"east": 4326.41688,
"north": 4326.41688,
"radius": 17,
"status": "confirmed"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": 1,
"egid": "1234567890",
"status": "confirmed",
"building": {
"egid": "1234567890",
"gbez": "Trafo Station 1",
"ggdenr": "261",
"ggdename": "Zürich",
"egrid": "2680000.0,1240000.0"
},
"address": {
"street": "Hauptstrasse 45",
"postal_code": "6260",
"city": "Reiden"
},
"solar_roofs": [
{
"attributes": {
"building_id": "229760",
"suitability": "high"
},
"geometry": {
"rings": [
[
[
2640325.75,
1232914.625
]
]
]
}
}
],
"solar_facades": [
{
"attributes": {
"building_id": "229760",
"suitability": "medium"
},
"geometry": {
"rings": [
[
[
2640325.75,
1232914.625
]
]
]
}
}
],
"coordinates": {
"east": 2680000,
"north": 1240000
},
"coordinates_wgs84": {
"lat": 47.3769,
"lng": 8.5417
},
"created_at": "2025-01-01T00:00:00+00:00",
"updated_at": "2025-01-01T00:00:00+00:00"
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"lat": [
"The lat field is required when lng is present."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Educational Institutions
List educational institutions
requires authentication
Returns a list of educational institutions (Schulhäuser, Kindergärten, etc.) with various filtering options.
You can filter by municipality (BFS number), postal code, status, or search within a radius using coordinates.
Coordinates are taken directly from gwr_buildings.GKODE (Easting) and gwr_buildings.GKODN (Northing).
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/educational-institutions?municipality=261&postal_code=8001&status=confirmed&lat=47.3769&lng=8.5417&radius=1000&east=2680000&north=1240000" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"municipality\": 4326.41688,
\"postal_code\": 4326.41688,
\"lat\": -90,
\"lng\": -180,
\"east\": 4326.41688,
\"north\": 4326.41688,
\"radius\": 17,
\"status\": \"confirmed\"
}"
const url = new URL(
"https://gwr-datahub.test/api/educational-institutions"
);
const params = {
"municipality": "261",
"postal_code": "8001",
"status": "confirmed",
"lat": "47.3769",
"lng": "8.5417",
"radius": "1000",
"east": "2680000",
"north": "1240000",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"municipality": 4326.41688,
"postal_code": 4326.41688,
"lat": -90,
"lng": -180,
"east": 4326.41688,
"north": 4326.41688,
"radius": 17,
"status": "confirmed"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": 1,
"egid": "1234567890",
"status": "confirmed",
"building": {
"egid": "1234567890",
"gbez": "Schulhaus Muster",
"ggdenr": "261",
"ggdename": "Zürich",
"egrid": "2680000.0,1240000.0"
},
"address": {
"street": "Hauptstrasse 45",
"postal_code": "6260",
"city": "Reiden"
},
"solar_roofs": [
{
"attributes": {
"building_id": "229760",
"suitability": "high"
},
"geometry": {
"rings": [
[
[
2640325.75,
1232914.625
]
]
]
}
}
],
"solar_facades": [
{
"attributes": {
"building_id": "229760",
"suitability": "medium"
},
"geometry": {
"rings": [
[
[
2640325.75,
1232914.625
]
]
]
}
}
],
"coordinates": {
"east": 2680000,
"north": 1240000
},
"coordinates_wgs84": {
"lat": 47.3769,
"lng": 8.5417
},
"created_at": "2025-01-01T00:00:00+00:00",
"updated_at": "2025-01-01T00:00:00+00:00"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Municipal Properties
List municipal properties
requires authentication
Returns a list of municipal properties (Werkhöfe, Gemeindeverwaltung, Gemeindehaus, Feuerwehrmagazin, etc.) with various filtering options.
You can filter by municipality (BFS number), postal code, status, or search within a radius using coordinates.
Coordinates are taken directly from gwr_buildings.GKODE (Easting) and gwr_buildings.GKODN (Northing).
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/municipal-properties?municipality=261&postal_code=8001&status=confirmed&lat=47.3769&lng=8.5417&radius=1000&east=2680000&north=1240000" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"municipality\": 4326.41688,
\"postal_code\": 4326.41688,
\"lat\": -90,
\"lng\": -180,
\"east\": 4326.41688,
\"north\": 4326.41688,
\"radius\": 17,
\"status\": \"candidate\"
}"
const url = new URL(
"https://gwr-datahub.test/api/municipal-properties"
);
const params = {
"municipality": "261",
"postal_code": "8001",
"status": "confirmed",
"lat": "47.3769",
"lng": "8.5417",
"radius": "1000",
"east": "2680000",
"north": "1240000",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"municipality": 4326.41688,
"postal_code": 4326.41688,
"lat": -90,
"lng": -180,
"east": 4326.41688,
"north": 4326.41688,
"radius": 17,
"status": "candidate"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": 1,
"egid": "1234567890",
"status": "confirmed",
"building": {
"egid": "1234567890",
"gbez": "Gemeindehaus",
"ggdenr": "261",
"ggdename": "Zürich",
"egrid": "2680000.0,1240000.0"
},
"address": {
"street": "Hauptstrasse 45",
"postal_code": "6260",
"city": "Reiden"
},
"solar_roofs": [
{
"attributes": {
"building_id": "229760",
"suitability": "high"
},
"geometry": {
"rings": [
[
[
2640325.75,
1232914.625
]
]
]
}
}
],
"solar_facades": [
{
"attributes": {
"building_id": "229760",
"suitability": "medium"
},
"geometry": {
"rings": [
[
[
2640325.75,
1232914.625
]
]
]
}
}
],
"coordinates": {
"east": 2680000,
"north": 1240000
},
"coordinates_wgs84": {
"lat": 47.3769,
"lng": 8.5417
},
"created_at": "2025-01-01T00:00:00+00:00",
"updated_at": "2025-01-01T00:00:00+00:00"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Water Supply Buildings
List water supply buildings
requires authentication
Returns a list of water supply buildings (Wasserversorgung) with various filtering options.
You can filter by municipality (BFS number), postal code, status, or search within a radius using coordinates.
Coordinates are taken directly from gwr_buildings.GKODE (Easting) and gwr_buildings.GKODN (Northing).
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/water-supply-buildings?municipality=261&postal_code=8001&status=confirmed&lat=47.3769&lng=8.5417&radius=1000&east=2680000&north=1240000" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"municipality\": 4326.41688,
\"postal_code\": 4326.41688,
\"lat\": -90,
\"lng\": -180,
\"east\": 4326.41688,
\"north\": 4326.41688,
\"radius\": 17,
\"status\": \"confirmed\"
}"
const url = new URL(
"https://gwr-datahub.test/api/water-supply-buildings"
);
const params = {
"municipality": "261",
"postal_code": "8001",
"status": "confirmed",
"lat": "47.3769",
"lng": "8.5417",
"radius": "1000",
"east": "2680000",
"north": "1240000",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"municipality": 4326.41688,
"postal_code": 4326.41688,
"lat": -90,
"lng": -180,
"east": 4326.41688,
"north": 4326.41688,
"radius": 17,
"status": "confirmed"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": 1,
"egid": "1234567890",
"status": "confirmed",
"building": {
"egid": "1234567890",
"gbez": "Wasserwerk",
"ggdenr": "261",
"ggdename": "Zürich",
"egrid": "2680000.0,1240000.0"
},
"address": {
"street": "Hauptstrasse 45",
"postal_code": "6260",
"city": "Reiden"
},
"solar_roofs": [
{
"attributes": {
"building_id": "229760",
"suitability": "high"
},
"geometry": {
"rings": [
[
[
2640325.75,
1232914.625
]
]
]
}
}
],
"solar_facades": [
{
"attributes": {
"building_id": "229760",
"suitability": "medium"
},
"geometry": {
"rings": [
[
[
2640325.75,
1232914.625
]
]
]
}
}
],
"coordinates": {
"east": 2680000,
"north": 1240000
},
"coordinates_wgs84": {
"lat": 47.3769,
"lng": 8.5417
},
"created_at": "2025-01-01T00:00:00+00:00",
"updated_at": "2025-01-01T00:00:00+00:00"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
EIC Codes
List EIC codes
requires authentication
Returns a paginated list of Energy Identification Codes (EIC) published by Swissgrid (Swiss EIC Issuing Office, code 12). Covers all code types: A (substation), T (tieline), V (location), W (resource object), X (party / energy community), Y (area), Z (metering point).
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/eic-codes?type=X&source_list=x-codes-energycommunity&function=LEG&search=Musterhausen&zip=3011&include_removed=&per_page=100" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type\": \"w\",
\"source_list\": \"z-codes\",
\"function\": \"b\",
\"search\": \"n\",
\"zip\": \"gzmiyvdljnikhway\",
\"include_removed\": false,
\"per_page\": 18
}"
const url = new URL(
"https://gwr-datahub.test/api/eic-codes"
);
const params = {
"type": "X",
"source_list": "x-codes-energycommunity",
"function": "LEG",
"search": "Musterhausen",
"zip": "3011",
"include_removed": "0",
"per_page": "100",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": "w",
"source_list": "z-codes",
"function": "b",
"search": "n",
"zip": "gzmiyvdljnikhway",
"include_removed": false,
"per_page": 18
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"eic": "12X-0000002029-F",
"code_type": "X",
"source_list": "x-codes-energycommunity",
"display_name": "ENERGO-CO",
"functions": [
"Consumer"
],
"company": "energo",
"zip": "6331",
"city": "Hünenberg",
"registered_at": "2019-06-27",
"media": null,
"comment": null,
"is_active": true,
"removed_at": null,
"first_seen_at": "2026-07-14T03:30:00+02:00",
"last_seen_at": "2026-07-14T03:30:00+02:00"
}
],
"links": {
"first": "...",
"last": "...",
"prev": null,
"next": "..."
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 4,
"per_page": 100,
"to": 100,
"total": 385
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get sync metadata
requires authentication
Returns the available code types with counts and the last successful synchronisation per Swissgrid source list.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/eic-codes/meta" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/eic-codes/meta"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"types": [
{
"code_type": "X",
"total": 2100,
"active": 2050
}
],
"lists": [
{
"source_list": "x-codes-energycommunity",
"code_type": "X",
"last_synced_at": "2026-07-14T03:30:12+02:00",
"rows_total": 384
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a single EIC code
requires authentication
Returns a single Energy Identification Code by its EIC identifier.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/eic-codes/12X-0000002029-F" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/eic-codes/12X-0000002029-F"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"eic": "12X-0000002029-F",
"code_type": "X",
"source_list": "x-codes-energycommunity",
"display_name": "ENERGO-CO",
"functions": [
"Consumer"
],
"company": "energo",
"zip": "6331",
"city": "Hünenberg",
"registered_at": "2019-06-27",
"media": null,
"comment": null,
"is_active": true,
"removed_at": null,
"first_seen_at": "2026-07-14T03:30:00+02:00",
"last_seen_at": "2026-07-14T03:30:00+02:00"
}
Example response (404):
{
"message": "EIC-Code nicht gefunden."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Endpoints
GET api/user
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/user" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/user"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/health
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/health" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/health"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 600
x-ratelimit-remaining: 599
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"status": "ok",
"time": "2026-07-14T02:24:19+00:00"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/buildings/{egid}/consumption
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/buildings/architecto/consumption" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/buildings/architecto/consumption"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/buildings/{egid}/consumption
requires authentication
Example request:
curl --request POST \
"https://gwr-datahub.test/api/buildings/architecto/consumption" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"heating_system\": \"non_electric\",
\"hot_water_system\": \"from_heating\",
\"age_tier\": \"mid\",
\"effective_area\": 1
}"
const url = new URL(
"https://gwr-datahub.test/api/buildings/architecto/consumption"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"heating_system": "non_electric",
"hot_water_system": "from_heating",
"age_tier": "mid",
"effective_area": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/network-topology/coverage-data
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/coverage-data" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"view_mode\": \"ne6\",
\"vk_id\": 16,
\"ne6_id\": 16,
\"bfs_number\": 4326.41688,
\"show_ne4\": false,
\"show_ne6\": false,
\"show_vk\": false,
\"show_buildings\": true,
\"building_limit\": 17,
\"include_epa\": true
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/coverage-data"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"view_mode": "ne6",
"vk_id": 16,
"ne6_id": 16,
"bfs_number": 4326.41688,
"show_ne4": false,
"show_ne6": false,
"show_vk": false,
"show_buildings": true,
"building_limit": 17,
"include_epa": true
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/network-topology/data-version
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/data-version" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/network-topology/data-version"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new node (NE4, NE6 or VK).
requires authentication
Example request:
curl --request POST \
"https://gwr-datahub.test/api/network-topology/nodes" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"node_type\": \"vk\",
\"identifier\": \"b\",
\"parent_node_id\": 16,
\"grid_operator_id\": 16,
\"latitude\": -89,
\"longitude\": -180,
\"address\": \"z\",
\"trafo_egid\": \"m\",
\"is_active\": false,
\"metadata\": {
\"custom_label\": \"i\",
\"bfs_number\": 8,
\"network_level\": \"v\",
\"capacity_kva\": 42,
\"egrid\": \"l\"
}
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/nodes"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"node_type": "vk",
"identifier": "b",
"parent_node_id": 16,
"grid_operator_id": 16,
"latitude": -89,
"longitude": -180,
"address": "z",
"trafo_egid": "m",
"is_active": false,
"metadata": {
"custom_label": "i",
"bfs_number": 8,
"network_level": "v",
"capacity_kva": 42,
"egrid": "l"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show a single node.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/nodes/564" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/network-topology/nodes/564"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing node (e.g. rename, change parent, edit label).
requires authentication
Example request:
curl --request PUT \
"https://gwr-datahub.test/api/network-topology/nodes/564" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"node_type\": \"ne6\",
\"identifier\": \"b\",
\"parent_node_id\": 16,
\"grid_operator_id\": 16,
\"latitude\": -89,
\"longitude\": -180,
\"address\": \"z\",
\"trafo_egid\": \"m\",
\"is_active\": true,
\"metadata\": {
\"custom_label\": \"i\",
\"bfs_number\": 8,
\"network_level\": \"v\",
\"capacity_kva\": 42,
\"egrid\": \"l\"
}
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/nodes/564"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"node_type": "ne6",
"identifier": "b",
"parent_node_id": 16,
"grid_operator_id": 16,
"latitude": -89,
"longitude": -180,
"address": "z",
"trafo_egid": "m",
"is_active": true,
"metadata": {
"custom_label": "i",
"bfs_number": 8,
"network_level": "v",
"capacity_kva": 42,
"egrid": "l"
}
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a node. Refuses if the node still has children or topology references.
requires authentication
Example request:
curl --request DELETE \
"https://gwr-datahub.test/api/network-topology/nodes/564" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/network-topology/nodes/564"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create an EGID -> node assignment. Fails if a row for the EGID already exists; use PUT in that case.
requires authentication
Example request:
curl --request POST \
"https://gwr-datahub.test/api/network-topology/assignments" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"egid\": \"b\",
\"ne4_node_id\": 16,
\"ne6_node_id\": 16,
\"vk_node_id\": 16,
\"grid_operator_id\": 16,
\"is_muffennetz\": false,
\"autopopulate_parents\": false
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/assignments"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"egid": "b",
"ne4_node_id": 16,
"ne6_node_id": 16,
"vk_node_id": 16,
"grid_operator_id": 16,
"is_muffennetz": false,
"autopopulate_parents": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/network-topology/assignments/{id}
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/assignments/564" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/network-topology/assignments/564"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing assignment (move a building to another transformer, etc.).
requires authentication
Example request:
curl --request PUT \
"https://gwr-datahub.test/api/network-topology/assignments/564" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ne4_node_id\": 16,
\"ne6_node_id\": 16,
\"vk_node_id\": 16,
\"grid_operator_id\": 16,
\"is_muffennetz\": false,
\"autopopulate_parents\": false
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/assignments/564"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ne4_node_id": 16,
"ne6_node_id": 16,
"vk_node_id": 16,
"grid_operator_id": 16,
"is_muffennetz": false,
"autopopulate_parents": false
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DELETE api/network-topology/assignments/{id}
requires authentication
Example request:
curl --request DELETE \
"https://gwr-datahub.test/api/network-topology/assignments/564" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/network-topology/assignments/564"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Proxy all requests to OSB API.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/osb/|{+-0p" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/osb/|{+-0p"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Proxy all requests to OSB API.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/osb-v2/|{+-0p" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/osb-v2/|{+-0p"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
BFE Stromkennzeichnung
Endpoints for the Swiss Lieferantenmix (electricity-label) data published yearly by Pronovo / BFE.
List operators with their latest electricity label.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/electricity-labels/operators" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/electricity-labels/operators"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show all years of labels for a single operator (resolved via ch_uid).
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/electricity-labels/operators/architecto" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/electricity-labels/operators/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
One label (Lieferantenmix) for an operator + delivery year.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/electricity-labels/operators/architecto/564" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/electricity-labels/operators/architecto/564"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Single product mix for an operator/year/product (phase 2 placeholder).
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/electricity-labels/operators/architecto/564/products/architecto" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/electricity-labels/operators/architecto/564/products/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Look up the label for the building's default supplier (= VNB).
requires authentication
Resolves EGID -> NetworkTopology -> grid_operator_id -> latest label. Returns a disclaimer that this is the default supplier; customers with free choice (> 100 MWh/year) may use a different supplier.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/electricity-labels/by-egid/architecto" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/electricity-labels/by-egid/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Aggregate by municipality (BFS number) - returns labels for all suppliers whose service area touches this municipality (resolved via network_topology).
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/electricity-labels/by-municipality/564" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/electricity-labels/by-municipality/564"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Weighted CH-wide or filtered aggregate.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/electricity-labels/aggregate" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/electricity-labels/aggregate"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Economic Catalog
List catalog products.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/economic-catalog/products?supplier=solarmarkt&kind=battery_module&manufacturer=BYD&search=HVS&min_kwh=5&max_kwh=20&include_discontinued=&per_page=200&page=1&lang=de" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"supplier\": \"bng-zmi_y\",
\"kind\": \"dummy\",
\"manufacturer\": \"v\",
\"search\": \"d\",
\"min_kwh\": 37,
\"max_kwh\": 9,
\"include_discontinued\": true,
\"per_page\": 17,
\"lang\": \"de\"
}"
const url = new URL(
"https://gwr-datahub.test/api/economic-catalog/products"
);
const params = {
"supplier": "solarmarkt",
"kind": "battery_module",
"manufacturer": "BYD",
"search": "HVS",
"min_kwh": "5",
"max_kwh": "20",
"include_discontinued": "0",
"per_page": "200",
"page": "1",
"lang": "de",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"supplier": "bng-zmi_y",
"kind": "dummy",
"manufacturer": "v",
"search": "d",
"min_kwh": 37,
"max_kwh": 9,
"include_discontinued": true,
"per_page": 17,
"lang": "de"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show a single catalog product with its full snapshot history.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/economic-catalog/products/16?lang=de" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"lang\": \"fr\"
}"
const url = new URL(
"https://gwr-datahub.test/api/economic-catalog/products/16"
);
const params = {
"lang": "de",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"lang": "fr"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List distinct manufacturers, optionally scoped by supplier.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/economic-catalog/manufacturers?supplier=solarmarkt&lang=de" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/economic-catalog/manufacturers"
);
const params = {
"supplier": "solarmarkt",
"lang": "de",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List catalog suppliers.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/economic-catalog/suppliers?lang=de" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/economic-catalog/suppliers"
);
const params = {
"lang": "de",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Electricity Production Plants
Get combined building and electricity production plants data
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/buildings/123456/electricity-plants?plant_type=photovoltaic" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/buildings/123456/electricity-plants"
);
const params = {
"plant_type": "photovoltaic",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get electricity production plants for a building by EGID
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/electricity-plants?egid=123456&plant_type=photovoltaic" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/electricity-plants"
);
const params = {
"egid": "123456",
"plant_type": "photovoltaic",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Search electricity production plants by location
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/electricity-plants/search?municipality=Z%C3%BCrich&post_code=8001&bfs_number=261&plant_type=photovoltaic" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/electricity-plants/search"
);
const params = {
"municipality": "Zürich",
"post_code": "8001",
"bfs_number": "261",
"plant_type": "photovoltaic",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List all electricity production plants of a municipality with coordinates.
requires authentication
Designed for map rendering: returns every plant of a municipality together with CH1903+ and WGS84 coordinates (reconstructed from gwr_buildings via EGID when the BFE source is incomplete).
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/electricity-plants/by-municipality?bfs_number=2827&plant_type=photovoltaic&only_with_coordinates=1&min_power_kw=0" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/electricity-plants/by-municipality"
);
const params = {
"bfs_number": "2827",
"plant_type": "photovoltaic",
"only_with_coordinates": "1",
"min_power_kw": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get specific electricity production plant by XTF-ID
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/electricity-plants/ch.bfe.epa.123456" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/electricity-plants/ch.bfe.epa.123456"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get electricity production plant statistics for a municipality
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/municipalities/261/electricity-plant-statistics?plant_type=photovoltaic" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/municipalities/261/electricity-plant-statistics"
);
const params = {
"plant_type": "photovoltaic",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
HKN Compensation Rates
List HKN compensation rates for a grid operator
requires authentication
Returns the manually maintained HKN compensation rates for a single grid operator,
filtered by validity period (default: rates valid today). Use include_history=true
to retrieve all historical entries.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/hkn-rates/operators/CHE-108.954.688?valid_at=2026-01-01&energy_source=photovoltaik&plant_size=up_to_30_kva&include_history=" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"valid_at\": \"2026-07-14T02:24:19\",
\"energy_source\": \"wind\",
\"plant_size\": \"alle\",
\"include_history\": true
}"
const url = new URL(
"https://gwr-datahub.test/api/hkn-rates/operators/CHE-108.954.688"
);
const params = {
"valid_at": "2026-01-01",
"energy_source": "photovoltaik",
"plant_size": "up_to_30_kva",
"include_history": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"valid_at": "2026-07-14T02:24:19",
"energy_source": "wind",
"plant_size": "alle",
"include_history": true
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create an HKN compensation rate for a grid operator
requires authentication
Example request:
curl --request POST \
"https://gwr-datahub.test/api/hkn-rates/operators/CHE-108.954.688" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"energy_source\": \"photovoltaik\",
\"plant_size\": \"up_to_30_kva\",
\"rate_rappen_per_kwh\": 4.5,
\"valid_from\": \"2026-01-01\",
\"valid_to\": \"2026-12-31\"
}"
const url = new URL(
"https://gwr-datahub.test/api/hkn-rates/operators/CHE-108.954.688"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"energy_source": "photovoltaik",
"plant_size": "up_to_30_kva",
"rate_rappen_per_kwh": 4.5,
"valid_from": "2026-01-01",
"valid_to": "2026-12-31"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an HKN compensation rate
requires authentication
Example request:
curl --request PUT \
"https://gwr-datahub.test/api/hkn-rates/operators/CHE-108.954.688/rates/1" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"energy_source\": \"biomasse\",
\"plant_size\": \"up_to_30_kva\",
\"rate_rappen_per_kwh\": 1,
\"valid_from\": \"2026-07-14T02:24:19\",
\"valid_to\": \"2026-07-14T02:24:19\"
}"
const url = new URL(
"https://gwr-datahub.test/api/hkn-rates/operators/CHE-108.954.688/rates/1"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"energy_source": "biomasse",
"plant_size": "up_to_30_kva",
"rate_rappen_per_kwh": 1,
"valid_from": "2026-07-14T02:24:19",
"valid_to": "2026-07-14T02:24:19"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete an HKN compensation rate
requires authentication
Example request:
curl --request DELETE \
"https://gwr-datahub.test/api/hkn-rates/operators/CHE-108.954.688/rates/1" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/hkn-rates/operators/CHE-108.954.688/rates/1"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Municipality Enrichment
Enrich all buildings in a municipality.
requires authentication
Triggers a background job that enriches building data including:
- WGS84 coordinates (converted from CH1903+)
- BDEW consumption profiles
- Municipality names
- Address data (via OSB API)
Example request:
curl --request POST \
"https://gwr-datahub.test/api/municipalities/261/enrich" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"force\": false
}"
const url = new URL(
"https://gwr-datahub.test/api/municipalities/261/enrich"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"force": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get the status of a municipality enrichment batch.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/municipalities/261/enrichment-status/9d4f8a3c-1b2e-4f5a-8c3d-9a7b6e4f2c1d" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/municipalities/261/enrichment-status/9d4f8a3c-1b2e-4f5a-8c3d-9a7b6e4f2c1d"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Network Topology
Get network topology hierarchy for a municipality.
requires authentication
Returns the full NE4 → NE6 → VK hierarchy with optional building data. Designed for simulation seeder and external API consumers.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/hierarchy/4241?include=buildings&ne4_id=1&ne6_id=5&cursor=eyJlZ2lkIjoiMTIzNDU2In0%3D&limit=100" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"include\": \"buildings\",
\"node_type\": \"ne6\",
\"ne4_id\": 16,
\"ne6_id\": 16,
\"cursor\": \"architecto\",
\"limit\": 22
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/hierarchy/4241"
);
const params = {
"include": "buildings",
"ne4_id": "1",
"ne6_id": "5",
"cursor": "eyJlZ2lkIjoiMTIzNDU2In0=",
"limit": "100",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"include": "buildings",
"node_type": "ne6",
"ne4_id": 16,
"ne6_id": 16,
"cursor": "architecto",
"limit": 22
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Generate a coverage map image (SVG).
requires authentication
Returns an SVG image of the network topology coverage map. Supports three view modes: VK-centered (vZEV), NE6-centered (LEG 40%), or municipality.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/coverage-map?view_mode=vk&vk_id=25&ne6_id=5&bfs_number=4241&width=1200&height=800&show_ne4=1&show_ne6=1&show_vk=1&show_buildings=1" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"view_mode\": \"municipality\",
\"vk_id\": 16,
\"ne6_id\": 16,
\"bfs_number\": 4326.41688,
\"width\": 17,
\"height\": 15,
\"show_ne4\": true,
\"show_ne6\": true,
\"show_vk\": false,
\"show_buildings\": false
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/coverage-map"
);
const params = {
"view_mode": "vk",
"vk_id": "25",
"ne6_id": "5",
"bfs_number": "4241",
"width": "1200",
"height": "800",
"show_ne4": "1",
"show_ne6": "1",
"show_vk": "1",
"show_buildings": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"view_mode": "municipality",
"vk_id": 16,
"ne6_id": 16,
"bfs_number": 4326.41688,
"width": 17,
"height": 15,
"show_ne4": true,
"show_ne6": true,
"show_vk": false,
"show_buildings": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
SVG image data
Example response (404):
{
"message": "Node not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Look up topology data for a building by EGID.
requires authentication
Returns grid level, transformer info, power data, and LEG eligibility. Supports hybrid caching: checks local DB first, fetches from external API on miss.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/lookup?egid=421158&vnb=ebl" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"egid\": \"bngzmiyvdljnikhw\",
\"vnb\": \"a\"
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/lookup"
);
const params = {
"egid": "421158",
"vnb": "ebl",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"egid": "bngzmiyvdljnikhw",
"vnb": "a"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get all buildings connected to the same transformer as the given EGID.
requires authentication
Returns buildings eligible for LEG 40% (same Trafokreis, no transformation needed). Results are filtered to the same municipality and limited for performance.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/transformer-peers/421158?vnb=ebl&limit=16" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"vnb\": \"b\",
\"limit\": 22
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/transformer-peers/421158"
);
const params = {
"vnb": "ebl",
"limit": "16",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"vnb": "b",
"limit": 22
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get all buildings in the same LEG area as the given EGID.
requires authentication
Returns buildings eligible for LEG 20% (same substation area, with transformation). Results are filtered to the same municipality (Gemeinde-LEG scope) and limited.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/leg-area-peers/421158?vnb=ebl&limit=16" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"vnb\": \"b\",
\"limit\": 22
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/leg-area-peers/421158"
);
const params = {
"vnb": "ebl",
"limit": "16",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"vnb": "b",
"limit": 22
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Combined LEG-20 / LEG-40 / vZEV peer lookup for a single building.
requires authentication
Returns all three peer blocks in a single response so a client can
scan a building with one HTTP roundtrip instead of three. The shape
mirrors the individual endpoints; each block carries an explicit
leg_type discriminator (leg_20 / leg_40 / vzev).
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/leg-peers/421158?vnb=ebl&limit=16" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"vnb\": \"b\",
\"limit\": 22
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/leg-peers/421158"
);
const params = {
"vnb": "ebl",
"limit": "16",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"vnb": "b",
"limit": 22
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Look up vZEV peers for a building by EGID.
requires authentication
Returns buildings sharing the same distribution cabinet (Verteilkasten), eligible for a virtual ZEV. Uses Cubera API (mode=vzev) for Cubera-based VNBs or DB-cached VK node data for Stromgemeinschaft VNBs.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/vzev-lookup/421158?vnb=primeo&limit=16" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"vnb\": \"b\",
\"limit\": 22
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/vzev-lookup/421158"
);
const params = {
"vnb": "primeo",
"limit": "16",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"vnb": "b",
"limit": 22
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get aggregated Quartier-LEG groups (NE6) for a municipality.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/quarter-legs/by-municipality/2822?limit=100" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"limit\": 1
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/quarter-legs/by-municipality/2822"
);
const params = {
"limit": "100",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"limit": 1
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Search address candidates for topology fallback flows.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/address-lookup?query=Hauptstrasse+12&bfs_number=2822&limit=10" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"query\": \"b\",
\"bfs_number\": 22,
\"limit\": 7
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/address-lookup"
);
const params = {
"query": "Hauptstrasse 12",
"bfs_number": "2822",
"limit": "10",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"query": "b",
"bfs_number": 22,
"limit": 7
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Import legacy vZEV check records from the LEG App.
requires authentication
Bulk imports historical vzev_site_checks data into the GWR DataHub network_topology table. Used for one-time migration from LEG App.
Example request:
curl --request POST \
"https://gwr-datahub.test/api/network-topology/import-legacy-checks" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"records\": [
{
\"egid\": \"bngzmiyvdljnikhw\",
\"status\": \"unknown\",
\"provider\": \"a\",
\"vk_identifier\": \"y\",
\"trafo_identifier\": \"k\"
}
]
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/import-legacy-checks"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"records": [
{
"egid": "bngzmiyvdljnikhw",
"status": "unknown",
"provider": "a",
"vk_identifier": "y",
"trafo_identifier": "k"
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List nodes, optionally filtered by grid operator, type and free-text search.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/nodes?grid_operator_id=12&node_type=ne6&bfs_number=4241&q=TS-Hauptstrasse&per_page=50" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"grid_operator_id\": 16,
\"node_type\": \"vk\",
\"bfs_number\": 22,
\"q\": \"g\",
\"per_page\": 16
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/nodes"
);
const params = {
"grid_operator_id": "12",
"node_type": "ne6",
"bfs_number": "4241",
"q": "TS-Hauptstrasse",
"per_page": "50",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"grid_operator_id": 16,
"node_type": "vk",
"bfs_number": 22,
"q": "g",
"per_page": 16
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List assignments scoped to one or more grid operators.
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/network-topology/assignments?grid_operator_id=12&egid=421158&ne6_node_id=87&per_page=16" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"grid_operator_id\": 16,
\"egid\": \"n\",
\"ne6_node_id\": 16,
\"bfs_number\": 22,
\"per_page\": 7
}"
const url = new URL(
"https://gwr-datahub.test/api/network-topology/assignments"
);
const params = {
"grid_operator_id": "12",
"egid": "421158",
"ne6_node_id": "87",
"per_page": "16",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"grid_operator_id": 16,
"egid": "n",
"ne6_node_id": 16,
"bfs_number": 22,
"per_page": 7
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
PV Multi-Roof Configuration
List available PV roof and facade surfaces for a building
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/buildings/123456/pv-roofs" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/buildings/123456/pv-roofs"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List all PV multi-roof configurations for a building
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/buildings/123456/pv-multi-roof-configurations?status=architecto&per_page=20" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/buildings/123456/pv-multi-roof-configurations"
);
const params = {
"status": "architecto",
"per_page": "20",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create or update a PV multi-roof configuration
requires authentication
Example request:
curl --request POST \
"https://gwr-datahub.test/api/buildings/123456/pv-multi-roof-configurations" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 1,
\"name\": \"Main PV System\",
\"description\": \"Eius et animi quos velit et.\",
\"status\": \"draft\",
\"surfaces\": [
\"architecto\"
]
}"
const url = new URL(
"https://gwr-datahub.test/api/buildings/123456/pv-multi-roof-configurations"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 1,
"name": "Main PV System",
"description": "Eius et animi quos velit et.",
"status": "draft",
"surfaces": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a specific PV multi-roof configuration
requires authentication
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/buildings/123456/pv-multi-roof-configurations/1?lang=de" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/buildings/123456/pv-multi-roof-configurations/1"
);
const params = {
"lang": "de",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get production profile for a specific configuration and year
requires authentication
Supports both TMY (Typical Meteorological Year) profiles and year-specific profiles. For TMY profiles, the data is mapped to the requested year's calendar.
Example request:
curl --request GET \
--get "https://gwr-datahub.test/api/buildings/123456/pv-multi-roof-configurations/1/profiles/2025" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://gwr-datahub.test/api/buildings/123456/pv-multi-roof-configurations/1/profiles/2025"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
referrer-policy: strict-origin-when-cross-origin
permissions-policy: camera=(), microphone=(), geolocation=(self)
strict-transport-security: max-age=31536000; includeSubDomains
access-control-allow-origin: https://gwr-datahub.ecolabor.ch
access-control-expose-headers: X-Datahub-Proxy, X-Datahub-Proxy-Version
{
"message": "Unauthenticated.",
"code": "unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.