{"schema_version":"1.0","country":"es","country_name":"Spain","topic":"electricity-consumption-local","question":"Where can I get electricity consumption by municipality or postal code in Spain, by sector and year?","territory":"es","territory_level":"country","parent_url":null,"published_on":"2026-11-19","research_reviewed_on":"2026-11-16","access_checked_on":null,"answer":{"official_data":"partial","non_official_data":"none_found","summary":"Spain publishes no national file of electricity use by municipality or postal code. Best: Catalonia (ICAEN, 947 municipalities, 6 sectors, kWh, 2013-2024, API) and Canarias (ISTAC, monthly, 3 sectors, MWh). Postal codes: Barcelona city by sector, and E-REDES/Viesgo/Begasa areas as totals. Other regions give totals, residential only, or per-capita figures. National bodies (CNMC, REE, MITECO) stop at region or province.","main_caveats":["Units differ: Catalonia kWh, Canarias and Andalusia MWh, Basque kWh per inhabitant; Barcelona is labelled MWh but behaves as kWh.","Sector categories are not comparable across sources (6 in Catalonia, 3 in Canarias and Barcelona, industrial vs non-industrial in the Basque Country).","Andalusian figures cover only the Endesa network; municipalities served by others show 0 MWh.","Catalonia leaves cells empty under statistical secrecy (10,099 of 54,611 rows); sums by municipality can be incomplete.","No municipal data found for Galicia, Aragon, Valencia, Asturias, Cantabria, Castilla-La Mancha, Extremadura, Baleares; Murcia only a 2014 PDF."],"confidence":"medium","confidence_reason":"National negatives opened at CNMC, MITECO, REE and INE; sources tested by download or API. Several regions only checked through searches plus partial pages; i-DE site returned 503.","attributes":[{"attribute":"electricity_consumption","covered":"partial","source_ids":["s001","s002","s004","s005","s006","s007","s008","s003"],"note":"Coverage combines distinct components of the question; see the original detailed evidence and its geographic and technical limits.","gap":"not_checked","gap_note":"The original rows have different scopes. Their combination has not been established as complete; original rows are retained in internal curation."},{"attribute":"local_area","covered":"partial","source_ids":["s001","s002","s004","s005","s006","s007","s008","s003"],"note":"Coverage combines distinct components of the question; see the original detailed evidence and its geographic and technical limits.","gap":"not_checked","gap_note":"The original rows have different scopes. Their combination has not been established as complete; original rows are retained in internal curation."},{"attribute":"sector","covered":"partial","source_ids":["s001","s002","s003","s004","s005","s008"],"note":"Sectors exist for Catalonia (6), Canarias (3), Barcelona (3), Basque (industrial/non-industrial, per capita), Andalusia (residential only), signatory cities (one year).","gap":"not_published","gap_note":"Regional offices opened for Madrid, Navarra, Aragon, Galicia, Extremadura, Cantabria, Murcia: totals only or provincial; no municipal sector split."},{"attribute":"reference_year","covered":"yes","source_ids":["s001","s002","s004","s007","s003"],"note":"Annual or finer series wherever data exists: Catalonia 2013-2024, Canarias 2018-2025, Basque 2002-2024, Madrid 1985-2023, Barcelona 2019-2025 (daily).","gap":null,"gap_note":null},{"attribute":"latest_data","covered":"no","source_ids":[],"note":"This specific requirement was not separately established in the inherited research.","gap":"not_checked","gap_note":"Review the original answer and source evidence; no new research was performed during this adaptation."},{"attribute":"historical_series","covered":"yes","source_ids":["s001","s002","s004","s007","s003"],"note":"Annual or finer series wherever data exists: Catalonia 2013-2024, Canarias 2018-2025, Basque 2002-2024, Madrid 1985-2023, Barcelona 2019-2025 (daily).","gap":null,"gap_note":null},{"attribute":"update_frequency","covered":"no","source_ids":[],"note":"This specific requirement was not separately established in the inherited research.","gap":"not_checked","gap_note":"Review the original answer and source evidence; no new research was performed during this adaptation."}]},"sources":[{"source_id":"s001","name":"Consum d'energia elèctrica per municipis i sectors de Catalunya (Consumo municipal de energía eléctrica por municipios y sectores de Cataluña)","publisher":"Institut Català d'Energia (ICAEN), Generalitat de Catalunya; statistic described by Idescat","official":true,"landing_url":"https://idescat.cat/paae/2023/030207/es","data_url":"https://analisi.transparenciacatalunya.cat/resource/8idm-becu.json","access":"api","format":"Socrata SODA API (JSON, CSV)","license":"Generalitat de Catalunya open-data licence (metadata says 'See Terms of Use')","language":"Catalan","has_coordinates":false,"location_precision":"municipality","summary":"Consum d'energia elèctrica per municipis i sectors de Catalunya (Consumo municipal de energía eléctrica por municipios y sectores de Cataluña)","coverage_note":"Catalonia: 947 municipalities in 2024 (4 provinces), also comarca and province fields","data_date":"Calendar years 2013 to 2024 (counted with a SoQL group-by on 'any'); metadata last updated 2025-12-17","caveats":["Consult the main caveats and the complete reading traps and access evidence in the detail."],"test":{"tested_on":"2026-11-16","method":"api_query","http_status":200,"problems":[]},"example":{"example_request":"curl -sL 'https://analisi.transparenciacatalunya.cat/resource/8idm-becu.json?$where=cdmun=%2708019%27%20and%20any=2024'","example_result":"[{\"any\":\"2024\",\"cdmun\":\"08019\",\"municipi\":\"BARCELONA\",\"codi_sector\":\"7\",\"descripcio_sector\":\"USOS DOMESTICS\",\"consum_kwh\":\"1914308836\"},{\"any\":\"2024\",\"cdmun\":\"08019\",\"municipi\":\"BARCELONA\",\"codi_sector\":\"6\",\"descripcio_sector\":\"SERVEIS\",\"consum_kwh\":\"3558751784\"}] (6 rows returned; trimmed to 2)"},"members_summary":null},{"source_id":"s002","name":"Consumo final de energía eléctrica y número de clientes según grandes sectores. Municipios de Canarias por periodos (ISTAC C00022A_000006)","publisher":"Instituto Canario de Estadística (ISTAC), Gobierno de Canarias","official":true,"landing_url":"https://datos.gob.es/catalogo/a05003423-consumo-final-de-energia-electrica-y-numero-de-clientes-segun-grandes-sectores-municipios-de-canarias-por-periodos","data_url":"https://datos.canarias.es/api/estadisticas/statistical-resources/v1.0/datasets/ISTAC/C00022A_000006/1.12.csv","access":"api","format":"SDMX statistical resource API: CSV, TSV, JSON, JSON-stat, XML, XLSX","license":"Aviso Legal (ISTAC)","language":"Spanish","has_coordinates":false,"location_precision":"municipality","summary":"Consumo final de energía eléctrica y número de clientes según grandes sectores. Municipios de Canarias por periodos (ISTAC C00022A_000006)","coverage_note":"Canary Islands: 88 municipalities, 7 islands and the region (96 territory codes)","data_date":"Monthly from 2018-M01 to 2025-M06 plus annual totals 2018 onward (version 1.12 valid from 2025-09-04)","caveats":["Consult the main caveats and the complete reading traps and access evidence in the detail."],"test":{"tested_on":"2026-11-16","method":"download","http_status":200,"problems":[]},"example":{"example_request":"curl -sL 'https://datos.canarias.es/api/estadisticas/statistical-resources/v1.0/datasets/ISTAC/C00022A_000006/1.12.json?dim=MEDIDAS:ENERGIA_ELECTRICA,TERRITORIO:35004,TIME_PERIOD:2024,FLUJO_ENERGIA:_T&fields=%2Bdata'","example_result":"data.observations: \"272748.05\" (Arrecife, 2024, total, MWh). From the full CSV: Las Palmas de Gran Canaria 2023 = Total 1118776.63, Servicios 591477.63, Residencial 469053.12, Industria 58245.88; CUPS Total 211155"},"members_summary":null},{"source_id":"s003","name":"Consum d'electricitat (MWh) per codi postal, sector econòmic i tram horari a la ciutat de Barcelona","publisher":"Ajuntament de Barcelona (Open Data BCN), using data from the Datadis platform","official":true,"landing_url":"https://opendata-ajuntament.barcelona.cat/data/dataset/consum-electricitat-bcn","data_url":"https://opendata-ajuntament.barcelona.cat/resources/bcn/EstadisticaDatadis/2025_consum_electricitat_BCN.csv","access":"direct_download","format":"CSV, one file per year 2019-2025","license":"Creative Commons Attribution 4.0","language":"Catalan","has_coordinates":false,"location_precision":"none","summary":"Consum d'electricitat (MWh) per codi postal, sector econòmic i tram horari a la ciutat de Barcelona","coverage_note":"City of Barcelona only: 42 postal codes (08001 to 08042)","data_date":"2025 file covers 2025-01-01 to 2025-11-30 (checked 2026-11-16); older files are full years 2019-2024","caveats":["Consult the main caveats and the complete reading traps and access evidence in the detail."],"test":{"tested_on":"2026-11-16","method":"download","http_status":200,"problems":[]},"example":{"example_request":"curl -sL -o bcn2025.csv 'https://opendata-ajuntament.barcelona.cat/resources/bcn/EstadisticaDatadis/2025_consum_electricitat_BCN.csv'  (resolved from the CKAN resource /download link, which answers 302)","example_result":"2025,2025-01-01,08001,Indústria,De 00:00:00 a 05:59:59 h,287 ; sums over the file: Serveis 3,079,229,799; Residencial 1,905,395,948; Indústria 468,026,112; No especificat 15,955,805"},"members_summary":null}],"other_sources_count":5,"if_unstructured":{"summary":null},"local_terms":[{"term":"consumo eléctrico municipal / por municipios","language":"es","meaning":"electricity use by municipality"},{"term":"energía eléctrica facturada","language":"es","meaning":"billed electricity, the wording used by Madrid and IECA"},{"term":"consumo por código postal","language":"es","meaning":"postal-code level use, as in distributors' open data"},{"term":"consum d'energia elèctrica per municipis i sectors","language":"ca","meaning":"Catalan statistic title"},{"term":"usos domésticos / servicios / industria","language":"es/ca","meaning":"typical sector labels"},{"term":"secreto estadístico / secret estadístic","language":"es/ca","meaning":"cell suppressed to protect individual consumers"},{"term":"CUPS","language":"es","meaning":"supply-point code; customer counts in ISTAC are CUPS"},{"term":"concello / concejo / udalerri","language":"gl/ast/eu","meaning":"municipality in Galicia, Asturias, Basque Country"}],"provenance":{"pass_count":1,"models":["Claude Sonnet 5.5"],"minutes_estimate":36,"pages_opened":86,"passes":[{"pass":1,"date":"2026-11-16","model":"Claude Sonnet 5.5"}],"note":"Minutes are researcher estimates. Counts describe documented passes, not publication approval. Missing history or effort is not reconstructed."},"card_url":"https://georutter.org/v1/es/electricity-consumption-local.json","detail_url":"https://georutter.org/v1/es/electricity-consumption-local/detail.json","html_url":"https://georutter.org/es/electricity-consumption-local/","country_url":"https://georutter.org/v1/countries/es.json"}
