# France Social Housing (HLM) by Address: Energy Labels & Age (`datacraft-studio/france-social-housing-buildings`) Actor

Official SDES RPLS open data: every French social housing (HLM) address with 5+ dwellings, or a town summary. Dwellings, rooms, surface, DPE energy and GHG labels, share of F/G 'passoires', build year, priority neighbourhoods, financing, APL conventions. Pay per row.

- **URL**: https://apify.com/datacraft-studio/france-social-housing-buildings.md
- **Developed by:** [Yahya Nouali](https://apify.com/datacraft-studio) (community)
- **Categories:** Real estate, Business
- **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 address or town 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 Social Housing (HLM) by Address: Energy Labels & Age

Get the **official stock of French social rental housing (HLM), address by address or town by town**: number of social dwellings, apartment blocks vs houses, rooms, surface, **DPE energy and greenhouse-gas labels** (share of F/G "passoires thermiques"), construction year, priority neighbourhoods (QPV), initial financing (PLAI, PLUS, PLS...), APL conventions and their expiry years.

Data comes from the French Ministry of Ecological Transition statistics office (**SDES**), which publishes every year the **RPLS** register (Répertoire des logements locatifs des bailleurs sociaux): about **5.4 million social dwellings** declared by all social landlords on 1 January. No login, no API key.

### What you can do with it

- **Energy-renovation, insulation, heat-pump and solar companies**: find social housing buildings with many F/G dwellings, built before 1975, in a town or department, ready for "rénovation énergétique" projects.
- **Construction, maintenance and facility-management companies**: size the social housing market of a town (number of buildings, dwellings, ages, surfaces).
- **Real estate investors, developers and consultants**: see where social housing is concentrated, its age and energy quality, and which APL conventions expire soon.
- **Local authorities, researchers and journalists**: town profiles of the social housing stock, comparisons between towns and years.

### Input examples

Social housing addresses with 20+ dwellings in Lyon 3e:

```json
{ "postalCodes": ["69003"], "minDwellings": 20, "maxItems": 10 }
```

Buildings in the Nord department, built before 1975, with at least 50% F/G labels, worst first:

```json
{ "departments": ["59"], "builtBefore": 1975, "minPoorDpeSharePct": 50, "sortBy": "poor_dpe_share_desc" }
```

Town summaries of the whole Seine-Saint-Denis department:

```json
{ "departments": ["93"], "outputMode": "towns", "sortBy": "dwellings_desc" }
```

Apartment blocks in Marseille whose APL convention expires by 2030:

```json
{ "townNames": ["Marseille"], "constructionTypes": ["collective"], "conventionExpiringBy": 2030 }
```

Leave all area fields empty to scan the whole of France (slow: 10 to 20 minutes; use filters and `maxItems`).

### Output

`outputMode: "buildings"` (default): one row per address with **at least 5 social dwellings**. `outputMode: "towns"`: one row per town (all social dwellings of the town).

| Field | Meaning |
|---|---|
| `address`, `addressPrecision`, `postalCode`, `townName`, `inseeCode`, `departmentCode`, `epciName`, `irisCode`, `latitude`, `longitude` | Location (`street` precision when the source gives no house number) |
| `programmeNames` | Programme / residence names given by the landlord |
| `socialDwellings`, `collectiveDwellings`, `individualDwellings`, `studentDwellings`, `rooms1`…`rooms5plus` | Dwellings by type and number of rooms |
| `averageSurfaceM2`, `totalSurfaceM2` | Living surface |
| `constructionYearMedian`, `constructionYearMin`, `constructionYearMax`, `firstRentalYearMedian` | Age |
| `energyLabels`, `ghgLabels`, `dominantEnergyLabel`, `poorEnergyDwellings`, `poorEnergySharePct`, `latestEnergyAuditMonth` | DPE energy and greenhouse-gas labels (A to G, F+G share among labelled dwellings) |
| `priorityNeighbourhoodDwellings`, `priorityNeighbourhoodCodes` | Dwellings in a priority neighbourhood (QPV 2024) |
| `aplConventionedDwellings`, `conventionExpiryYears`, `nextConventionExpiryYear`, `conventionsExpiringWithin5Years` | APL conventions and expiry years (SRU) |
| `financingTypes`, `veryLowRentDwellings`, `intermediateRentDwellings` | Initial financing (PLAI/PLUS/PLS/PLI...) |
| `wheelchairAdaptedDwellings`, `wheelchairDataDwellings` | Accessibility, when known |
| `stockDate`, `source`, `sourceLicence`, `sourceUrl`, `sourceDataDate` | Source, stock date (1 January) and publication date of the file |

Town rows also have `socialHousingAddresses`, `priorityNeighbourhoodSharePct` and `aplConventionedSharePct`. A final `run_summary` row gives counts, withheld small addresses, unknown towns and errors (it is free).

### Privacy rule

The source has **no tenant data and no landlord identity**. To avoid pointing at a single household, **addresses with fewer than 5 social dwellings are never returned** (count in `smallAddressesWithheld`), and dwelling-level details (floor, individual dwelling) are never output: every row is an aggregate of at least 5 dwellings (or a whole town).

### Pricing

Pay per event: **$0.002 per address or town row delivered**. Filtered-out rows 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 détaillées au logement du répertoire des logements locatifs des bailleurs sociaux (RPLS)", https://www.statistiques.developpement-durable.gouv.fr/catalogue?page=dataset\&datasetId=6390f7cb84f0679b04942fc2 (also on data.gouv.fr). Data declared by social landlords.
- Stocks on 1 January 2022, 2023, 2024 and 2025 (2025 file published on 20/01/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 only groups the published dwellings by address or town; it does not change their values.
- This actor is not affiliated with or endorsed by SDES, the Ministry or any social landlord.

### Notes

- Non-conventioned dwellings of semi-public companies (SEM) are not in the published file (they are not part of the social stock).
- Mayotte has no coordinates in the source. Some individual houses have no house number: they are grouped by street (`addressPrecision: "street"`).
- DPE labels are those declared by the landlords; some dwellings have no DPE yet (`unknown`).

# Changelog

This Actor's version history is a separate document: https://apify.com/datacraft-studio/france-social-housing-buildings/changelog.md

# Actor input Schema

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

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

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

Exact town names, e.g. Lille, Marseille, 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. 59, 2A, 974. Leave all area fields empty for the whole of France (slow: 10-20 minutes, use filters).

## `outputMode` (type: `string`):

One row per address (5+ social dwellings) or one summary row per town.

## `minDwellings` (type: `integer`):

Per address (never below 5) or per town in town mode.

## `minPoorDpeSharePct` (type: `integer`):

Share of dwellings labelled F or G ('passoires thermiques') among those with a DPE.

## `dominantDpeLabels` (type: `array`):

Keep rows whose most frequent energy label is one of these.

## `constructionTypes` (type: `array`):

Collective (apartment blocks), individual (houses) or student housing.

## `builtBefore` (type: `integer`):

e.g. 1975 for buildings before the first thermal regulation.

## `builtAfter` (type: `integer`):

e.g. 2012 for recent buildings.

## `onlyPriorityNeighbourhoods` (type: `boolean`):

Keep rows with at least one dwelling in a 'quartier prioritaire de la ville'.

## `conventionExpiringBy` (type: `integer`):

Keep rows whose next convention expiry year (from this year on) is on or before this year.

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

Text to find in the address, the programme name or the town.

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

Stock on 1 January of this year: 2022 to latest (default: latest published, currently 2025).

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

Order of the delivered rows (applied before maxItems).

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

Maximum rows delivered (and charged).

## Actor input object example

```json
{
  "postalCodes": [
    "69003"
  ],
  "outputMode": "buildings",
  "minDwellings": 20,
  "onlyPriorityNeighbourhoods": false,
  "sortBy": "dwellings_desc",
  "maxItems": 10
}
```

# Actor output Schema

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

One row per social housing address (5+ dwellings) or per town.

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

Stock date, counts, withheld small addresses, 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"
    ],
    "minDwellings": 20,
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("datacraft-studio/france-social-housing-buildings").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"],
    "minDwellings": 20,
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("datacraft-studio/france-social-housing-buildings").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"
  ],
  "minDwellings": 20,
  "maxItems": 10
}' |
apify call datacraft-studio/france-social-housing-buildings --silent --output-dataset

```

## MCP server setup

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

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/govnR4FNABAHiil74/builds/LwXhQhqI815qSUzX6/openapi.json
