# France Town Halls & Public Services Contacts (`zkrobotics/annuaire-services-publics`) Actor

Official contacts of French town halls and public services (email, phone, website, address, opening hours) with INSEE population and intercommunality. Filter by service type, department, population range, email only. Ideal for B2G prospecting.

- **URL**: https://apify.com/zkrobotics/annuaire-services-publics.md
- **Developed by:** [ZK Robotics](https://apify.com/zkrobotics) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 results

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

### What does France Town Halls Contacts do?

**It exports the official contact details of French town halls and public services, with the population of each municipality, so you can target the right size of local authority.**

The official directory (Annuaire de l'administration, Service-Public.fr) lists e-mail, phone, website, contact form, address, GPS coordinates and opening hours. This Actor adds the **INSEE population** of the municipality and its **intercommunality (EPCI)**, so you can ask for "town halls of more than 5,000 inhabitants in the Rhône, with an e-mail" or "every town hall of a given metropolis".

**FR :** coordonnées officielles des mairies, CCAS, polices municipales, France Services, CAF, CPAM, intercommunalités... avec la population de la commune et l'intercommunalité. Idéal pour la prospection des collectivités.

### What you get for each office

| | Field | Example (real record) |
|---|---|---|
| 🏛️ | `name`, `serviceTypes` | Mairie - Albigny-sur-Saône, \["mairie"] |
| ✉️ | `email`, `phones` | accueil@mairie-albignysursaone.fr, 04 78 91 31 38 |
| 🌐 | `website`, `contactForm` | https://www.mairie-albignysursaone.fr/ |
| 📍 | `street`, `postalCode`, `city`, `latitude`, `longitude` | 25 avenue Gabriel-Péri, 69250 Albigny-sur-Saône |
| 👥 | `population` | 3057 (INSEE) |
| 🤝 | `epciName`, `epciCode` | Métropole de Lyon, 200046977 |
| 🕘 | `openingHours` | \["Lundi 08:30-12:30 / 13:30-17:00", "Mardi-Mercredi 08:30-12:30"] |
| 🆔 | `siret`, `inseeCode`, `url`, `updatedAt` | 21690003500017, 69003 |

### Filters

- **Service types**: `mairie`, `ccas`, `police_municipale`, `france_services`, `caf`, `cpam`, `epci`, `gendarmerie`, `mission_locale` and more. Empty = all.
- **Departments** and **INSEE municipality codes**.
- **Population** min / max: from small rural villages to large cities. Paris, Lyon and Marseille arrondissements are included with their own population.
- **Only offices with an e-mail address**.

### How to use

1. Choose service types and an area, optionally a population range, then click **Start**.
2. Export to Excel or CSV, or push to your CRM.

### How much does it cost?

**$4 per 1,000 offices** returned (about $0.40 for 100), platform usage included.

### FAQ

**Personal data?** No. Only institutional contact details are returned, never the names of public servants.

**Is it legal?** Yes: official open data under Licence Ouverte Etalab 2.0 (DILA directory, INSEE population via geo.api.gouv.fr). Each row cites its sources.

**Can I e-mail these addresses?** They are public institutional addresses. Commercial e-mails to public bodies must still follow the rules on unsolicited messages; keep your messages relevant and easy to opt out of.

**Other Actors by ZK Robotics:** *France Public Tenders* (what these buyers are purchasing now), *France Contract Renewal Radar* (their contracts ending soon), *France Contract Awards*, *France Tender Matcher*, *France Companies Leads*.

### Source and licence

Annuaire de l'administration - DILA, and INSEE population via geo.api.gouv.fr, Licence Ouverte Etalab 2.0. Not affiliated with the French administration.

# Actor input Schema

## `serviceTypes` (type: `array`):

Ex. mairie, ccas, police_municipale, france_services, caf, cpam, epci, gendarmerie.

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

Codes de départements, ex. 59, 62, 75, 2A.

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

Ex. 59350 pour Lille, 69123 pour Lyon (différent du code postal). Combinable avec les départements.

## `onlyWithEmail` (type: `boolean`):

Pratique pour constituer une liste de contacts.

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

Ex. 5000 : seulement les communes de plus de 5 000 habitants (population INSEE).

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

Ex. 2000 pour cibler les petites communes rurales.

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

Plafond pour maîtriser le coût.

## Actor input object example

```json
{
  "serviceTypes": [
    "mairie"
  ],
  "departments": [
    "59"
  ],
  "onlyWithEmail": false,
  "maxItems": 1000
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "serviceTypes": [
        "mairie"
    ],
    "departments": [
        "59"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("zkrobotics/annuaire-services-publics").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 = {
    "serviceTypes": ["mairie"],
    "departments": ["59"],
}

# Run the Actor and wait for it to finish
run = client.actor("zkrobotics/annuaire-services-publics").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 '{
  "serviceTypes": [
    "mairie"
  ],
  "departments": [
    "59"
  ]
}' |
apify call zkrobotics/annuaire-services-publics --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zkrobotics/annuaire-services-publics"
        }
    }
}
```

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/ph3CS29Uz0TC7uwLX/builds/qg8HdpMfI08YKi8ki/openapi.json
