# France Town Demographics: Age, Jobs & Housing (INSEE Census) (`datacraft-studio/france-town-demographics`) Actor

Official INSEE census 2023 key figures for any French town, EPCI, department or region: population growth, age structure, households, owners vs renters, social housing, vacant and second homes, unemployment, diplomas and occupations. Pay per area.

- **URL**: https://apify.com/datacraft-studio/france-town-demographics.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 area 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 Town Demographics: Age, Jobs & Housing (INSEE Census)

Get the **official INSEE census 2023 key figures** for any French town (commune), Paris/Lyon/Marseille district, intercommunality (EPCI), department or region, in one clean row per area. No API key, no account.

Use it for **real-estate investment and site selection, retail and franchise location studies, local market sizing, public-policy dashboards, energy and renovation lead scoring**, or to enrich a CRM with local context.

### What you get for each area

- **Population**: 2023 census population, 2017 and 2012 values, change since 2017 (%) and annual growth rate.
- **Age structure**: shares under 15, under 20, 15-24, 25-39, 40-54, 55-64, 65-79, 80+, 65+, women, ageing index.
- **Households**: number of households, average household size, share of one-person households.
- **Housing**: dwellings, main residences, **second homes**, **vacant dwellings** (count and %), houses vs apartments, **owner-occupiers, private renters, social housing (HLM) tenants, furnished rentals**, rooms per home, small homes (1-2 rooms), construction period, main heating energy (electricity, mains gas, bottled gas, oil), households without a car / with 2+ cars, parking.
- **Jobs**: population 15-64, active, employed, unemployed, activity rate, employment rate, **census unemployment rate**, youth unemployment, retirees, students.
- **Education**: no diploma, CAP/BEP, baccalauréat, higher education, master's degree or more.
- **Occupations (15+)**: farmers, craftsmen/shopkeepers/business owners, executives & professionals, intermediate professions, employees, manual workers, retirees, other inactive.
- **Comparison with France** (`vsFrance`): difference in points for unemployment, 65+, under 20, owners, social housing, vacancy, second homes, higher education, executives, growth.

### How to use

- Give **INSEE codes** (`69123` = Lyon, `75056` = Paris, `200046977` = Métropole de Lyon, `69` = Rhône), **names** (add the department to avoid homonyms: `Saint-Denis (93)`), **postal codes**, or **departments** (all their towns or EPCIs).
- Or scan all of France at town level with a **minimum population** (e.g. 10,000 = about 1,000 towns). Up to 3,000 areas are analysed per run.
- Filter on population, growth, unemployment, share of 65+, vacancy, second homes, owners, social housing or higher education, then **sort** (fastest growing, highest unemployment, most second homes...).

Example: towns of Haute-Savoie with more than 5,000 inhabitants, sorted by population growth:

```json
{ "geoLevel": "COM", "departments": ["74"], "minPopulation": 5000, "sortBy": "growth_desc", "maxItems": 20 }
```

### Pricing

Pay per event: **$0.002 per area delivered**. Unknown codes, areas without data, filtered-out areas and the summary row are free.

### Source and licence

- **Source : Insee, Recensement de la population 2023** (main and complementary exploitation), datasets `DS_RP_POPULATION_PRINC`, `DS_RP_LOGEMENT_PRINC`, `DS_RP_EMPLOI_LR_PRINC`, `DS_RP_MENAGES_PRINC`, `DS_RP_DIPLOMES_PRINC`, `DS_RP_POPULATION_COMP`, read live from the public INSEE Melodi API (files published June-July 2026, geography of 1 January 2026). Area names and postal codes: geo.api.gouv.fr.
- Licence: **Licence Ouverte / Open Licence 2.0 (Etalab)**; the insee.fr legal notice allows free reuse, including for commercial purposes, with the mention "Source : Insee" and the date. This Actor is not endorsed by INSEE.
- Data are statistical aggregates (no personal data). Census figures are weighted estimates: very small towns can have rounded or unstable values.

### Notes and limits

- The census unemployment rate is self-declared and higher than the ILO rate published quarterly by INSEE.
- Construction periods cover homes finished before 2021; heating energy and cars refer to main residences.
- Towns created or merged after the census geography may be missing, as well as Mayotte and the overseas collectivities (Saint-Martin, Saint-Barthélemy, Polynesia, New Caledonia...); they are listed in the summary row and not charged.
- Each run reads the INSEE API live; INSEE limits the request rate, so large selections take about 1 minute per 300 towns.

# Changelog

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

# Actor input Schema

## `geoLevel` (type: `string`):

Level of the areas returned.

## `codes` (type: `array`):

Official INSEE codes at the chosen level, e.g. 69123 (Lyon) for towns, 75056 (Paris), 200046977 for an EPCI, 69 for a department, 84 for a region.

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

Exact names at the chosen level, e.g. Villeurbanne. Add the department in brackets to avoid homonyms: Saint-Denis (93).

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

5-digit postal codes (towns or districts only), resolved with geo.api.gouv.fr.

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

All towns (or districts, EPCIs) of these departments, e.g. 69, 2A, 974.

## `minPopulation` (type: `integer`):

Keep only areas with at least this census population. With geoLevel COM and no other selection, scans all of France (e.g. 10000 = about 1,000 towns).

## `maxPopulation` (type: `integer`):

Keep only areas with at most this census population.

## `minPopulationGrowthPct` (type: `number`):

Population change between the previous census (2017) and 2023, in %.

## `maxPopulationGrowthPct` (type: `number`):

Upper bound for the same indicator.

## `minUnemploymentRate` (type: `number`):

Census unemployment rate of 15-64 year olds (self-declared, higher than the ILO rate). France: about 11.4%.

## `maxUnemploymentRate` (type: `number`):

Upper bound for the same indicator.

## `minSeniorsPct` (type: `number`):

Share of residents aged 65 or more. France: about 21%.

## `maxSeniorsPct` (type: `number`):

Upper bound for the same indicator.

## `minVacancyRate` (type: `number`):

Share of vacant dwellings in all dwellings. France: about 7.8%.

## `maxVacancyRate` (type: `number`):

Upper bound for the same indicator.

## `minSecondaryHomesPct` (type: `number`):

Share of second homes and occasional dwellings in all dwellings.

## `maxSecondaryHomesPct` (type: `number`):

Upper bound for the same indicator.

## `minOwnersPct` (type: `number`):

Share of main residences occupied by their owner.

## `maxOwnersPct` (type: `number`):

Upper bound for the same indicator.

## `minSocialHousingPct` (type: `number`):

Share of main residences rented in the social (HLM) sector.

## `maxSocialHousingPct` (type: `number`):

Upper bound for the same indicator.

## `minHigherEducationPct` (type: `number`):

Share of non-students aged 15+ with a higher-education diploma.

## `maxHigherEducationPct` (type: `number`):

Upper bound for the same indicator.

## `includeNoData` (type: `boolean`):

Areas missing from the census release (e.g. towns created after 2023) are skipped and not charged by default; tick to receive them with empty values (charged).

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

Order of the rows before the maxItems limit.

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

Maximum number of areas returned (each one is charged). Up to 3,000 areas are analysed per run.

## Actor input object example

```json
{
  "geoLevel": "COM",
  "codes": [
    "69123",
    "69266"
  ],
  "includeNoData": false,
  "sortBy": "population_desc",
  "maxItems": 10
}
```

# Actor output Schema

## `areas` (type: `string`):

One row per town or area with its INSEE census 2023 key figures.

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

Counts, unknown inputs, France reference and source.

# 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 = {
    "codes": [
        "69123",
        "69266"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("datacraft-studio/france-town-demographics").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 = {
    "codes": [
        "69123",
        "69266",
    ],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("datacraft-studio/france-town-demographics").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 '{
  "codes": [
    "69123",
    "69266"
  ],
  "maxItems": 10
}' |
apify call datacraft-studio/france-town-demographics --silent --output-dataset

```

## MCP server setup

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

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/gLP6kyuMEhgm891Vc/builds/KToTlTtTIppdBNM9T/openapi.json
