# France Building Energy Use by Address: Electricity & Gas (`datacraft-studio/france-building-energy-consumption`) Actor

Official SDES open data: annual electricity and gas consumption (MWh) and meter counts of French buildings by address. Find big energy users by sector or NAF code, apartment blocks with collective gas heating, and year-on-year changes. Pay per building.

- **URL**: https://apify.com/datacraft-studio/france-building-energy-consumption.md
- **Developed by:** [Yahya Nouali](https://apify.com/datacraft-studio) (community)
- **Categories:** Business, Real estate
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 building delivereds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## France Building Energy Use by Address: Electricity & Gas

Get the **official annual electricity and natural gas consumption (MWh) of French buildings, address by address**, with the number of meters, the activity sector (residential, tertiary, industry, agriculture), the 2-digit NAF code of professional sites and the change versus the previous year.

Data comes from the French Ministry of Ecological Transition statistics office (**SDES**), which publishes every year the consumption reported by the grid operators (Enedis, RTE, GRDF, local utilities) for about **1 million electricity addresses and 240,000 gas addresses**. No login, no API key.

### What you can do with it

- **Energy brokers and suppliers**: list the biggest electricity and gas users of a town, department or NAF sector (retail parks, hospitals, hotels, warehouses, factories).
- **Energy-efficiency, solar and heat-pump companies**: find apartment blocks (10+ dwellings) with **collective gas boilers** or high consumption per dwelling, and commercial sites with high MWh per meter.
- **Property managers, investors and consultants**: benchmark a building against its neighbours, follow year-on-year changes, prepare decree "tertiaire" studies.
- **Local authorities and researchers**: map consumption by street, neighbourhood (IRIS) or sector.

### Input examples

Biggest residential and tertiary consumers in Lyon 3e, with last year's comparison:

```json
{ "postalCodes": ["69003"], "sectors": ["residential", "tertiary"], "minTotalMwh": 500, "includePreviousYear": true, "maxItems": 10 }
```

Apartment blocks with gas in Paris (all arrondissements):

```json
{ "townNames": ["Paris"], "sectors": ["residential"], "onlyWithGas": true, "sortBy": "points_desc", "maxItems": 200 }
```

Industrial sites above 5 GWh in Bouches-du-Rhône whose consumption rose the most:

```json
{ "departments": ["13"], "sectors": ["industry"], "minTotalMwh": 5000, "sortBy": "change_desc" }
```

Retail (NAF 47) sites in Bordeaux, electricity only, 2023 data:

```json
{ "townNames": ["Bordeaux"], "naf2Codes": ["47"], "energies": ["electricity"], "year": 2023 }
```

Leave all area fields empty to scan the whole of France (about 5 to 10 minutes; use filters such as `minTotalMwh` and `sectors`).

### Output (one row per address, sector and NAF code)

| Field | Meaning |
|---|---|
| `address`, `townName`, `postalCode`, `inseeCode`, `departmentCode`, `irisCode`, `latitude`, `longitude` | Normalised address (Base Adresse Nationale) and location |
| `geocodeLevel`, `geocodeScore` | Precision of the address (house number, street, locality) |
| `sector`, `naf2Code`, `naf2Label` | Residential / tertiary / industry / agriculture / unassigned, NAF code for professional sites |
| `electricityMwh`, `electricityDeliveryPoints`, `electricityOperators` | Annual electricity use and number of meters |
| `gasMwh`, `gasDeliveryPoints`, `gasOperators` | Annual gas use and number of meters |
| `totalMwh`, `mwhPerPoint` | Electricity + gas |
| `estimatedDwellings`, `mwhPerDwelling`, `gasSupplyHint` | Residential: about one electricity meter per dwelling; `collective` = 1-2 gas meters with a big volume (shared boiler), `individual` = 10+ gas meters |
| `previousYearTotalMwh`, `changePct`, `changeBasis` | Optional comparison with the previous year (only energies present in both years) |
| `source`, `sourceLicence`, `sourceUrl`, `sourceDataDate` | Source and publication date of the file |

A final `run_summary` row gives the year, counts, unknown towns or postal codes, withheld small sites and errors (it is free).

### Privacy rule

The source contains no names. To avoid exposing sole traders, **professional addresses with 1 or 2 meters are only returned above 250 MWh per year, and agriculture addresses with 1 or 2 meters are never returned** (count in `smallProfessionalSitesExcluded`). Residential rows are always buildings of at least 10 dwellings (or a collective gas boiler above 200 MWh), as published by SDES.

### Pricing

Pay per event: **$0.002 per building row delivered**. Filtered-out addresses and the summary row are free. Use `maxItems` to cap the cost.

### Source and licence

- Source: SDES (Service des données et études statistiques, Ministère de la Transition écologique), "Données locales de consommation d'électricité et de gaz naturel et de chaleur et de froid – adresse (à partir de 2018)", https://www.statistiques.developpement-durable.gouv.fr/catalogue?page=dataset\&datasetId=6102466697d9291fc5ce2d70 (also on data.gouv.fr). Data from the grid operators.
- Years 2018 to 2025 (2025 file published on 12/10/2026). Each run downloads the current file from the official API, and returns its publication date in `sourceDataDate`.
- Licence: **Licence Ouverte / Open Licence (Etalab)**. The SDES legal notice states that its data "peuvent être réutilisées à des fins commerciales", provided the data are not altered and the source and date are cited.
- This actor is not affiliated with or endorsed by SDES, the Ministry or the grid operators.

### Notes

- Addresses were re-normalised by the operators in 2021: comparisons with earlier years match fewer buildings.
- Changes at "street" or "locality" geocode level can mix several sites: check `geocodeLevel` before drawing conclusions.
- Heat and cooling networks are not included (the source hides many values for confidentiality).

# Changelog

This Actor's version history is a separate document: https://apify.com/datacraft-studio/france-building-energy-consumption/changelog.md

# Actor input Schema

## `postalCodes` (type: `array`):

French postal codes, e.g. 69003 or 75015.

## `townNames` (type: `array`):

Exact town names, e.g. Bordeaux, Lyon, Saint-Denis (all towns with that name).

## `inseeCodes` (type: `array`):

5-character INSEE codes, e.g. 69123 (Lyon, all arrondissements) or 69383 (Lyon 3e).

## `departments` (type: `array`):

Department codes, e.g. 69, 2A, 974. Leave all area fields empty for the whole of France (slower, a few minutes).

## `energies` (type: `array`):

Electricity, gas or both (default both). Rows of the same address and sector are merged.

## `sectors` (type: `array`):

Residential = buildings of 10+ dwellings (or collective gas boilers above 200 MWh). Leave empty for all.

## `naf2Codes` (type: `array`):

Professional sites only, e.g. 47 (retail), 86 (health), 10 (food industry), 55 (hotels).

## `addressContains` (type: `string`):

Keep addresses containing this text, e.g. 'centre commercial' or a street name.

## `minTotalMwh` (type: `integer`):

Electricity + gas of the address. 1 MWh = 1,000 kWh.

## `maxTotalMwh` (type: `integer`):

Upper bound on electricity + gas.

## `minDeliveryPoints` (type: `integer`):

Total electricity + gas meters at the address (for residential: about the number of dwellings).

## `minMwhPerPoint` (type: `integer`):

Find energy-intensive sites.

## `onlyWithGas` (type: `boolean`):

Keep only addresses supplied with natural gas (e.g. boiler replacement or heat-pump leads).

## `year` (type: `integer`):

Consumption year, 2018 to latest (default: latest published, currently 2025). Addresses were re-normalised in 2021.

## `includePreviousYear` (type: `boolean`):

Adds previous-year MWh and change in % (doubles download time).

## `minChangePct` (type: `integer`):

e.g. 20 for addresses whose consumption rose by 20% or more. Turns on the comparison.

## `maxChangePct` (type: `integer`):

e.g. -20 for addresses whose consumption fell by 20% or more. Turns on the comparison.

## `sortBy` (type: `string`):

Order of the results.

## `maxItems` (type: `integer`):

Maximum number of buildings to return (each one is charged).

## Actor input object example

```json
{
  "postalCodes": [
    "69003"
  ],
  "energies": [
    "electricity",
    "gas"
  ],
  "sectors": [
    "residential",
    "tertiary"
  ],
  "minTotalMwh": 500,
  "onlyWithGas": false,
  "includePreviousYear": true,
  "sortBy": "total_desc",
  "maxItems": 10
}
```

# Actor output Schema

## `buildings` (type: `string`):

One row per address and activity sector with annual electricity and gas consumption.

## `summary` (type: `string`):

Year, counts, withheld small sites, unknown towns and source date.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "postalCodes": [
        "69003"
    ],
    "sectors": [
        "residential",
        "tertiary"
    ],
    "minTotalMwh": 500,
    "includePreviousYear": true,
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("datacraft-studio/france-building-energy-consumption").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "postalCodes": ["69003"],
    "sectors": [
        "residential",
        "tertiary",
    ],
    "minTotalMwh": 500,
    "includePreviousYear": True,
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("datacraft-studio/france-building-energy-consumption").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "postalCodes": [
    "69003"
  ],
  "sectors": [
    "residential",
    "tertiary"
  ],
  "minTotalMwh": 500,
  "includePreviousYear": true,
  "maxItems": 10
}' |
apify call datacraft-studio/france-building-energy-consumption --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datacraft-studio/france-building-energy-consumption"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/c6OknS2Yxkw01xy1h/builds/WR7YOgLAJPBmcZqvu/openapi.json
