# France Public Services Directory (Mairies & more) (`bstandco/france-public-services-directory`) Actor

Get official contacts of French public offices: town halls (mairies), CAF, CPAM, France Travail, prefectures, gendarmerie… Email, phone, website, address and opening hours from Service-Public.fr.

- **URL**: https://apify.com/bstandco/france-public-services-directory.md
- **Developed by:** [BSTAndCo](https://apify.com/bstandco) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 1,000 public offices

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Public Services Directory (Mairies & more)

Get the **official contact details of French public offices** from **Service-Public.fr**: **town halls (mairies)**, CCAS, CAF, CPAM, France Travail, France Services, prefectures, tax offices, gendarmerie, courts, chambers of commerce and 200+ other types.

For each office: **email, phone, website, contact form, address, GPS position and opening hours** — ready for a spreadsheet or a CRM.

### Who is it for?

- **Companies selling to local authorities** (software, equipment, events, training, public works) – build a list of every town hall in your area with its official email and phone.
- **Associations & citizens' services** – find the right office (CAF, CPAM, France Services…) near any address.
- **Apps & chatbots** – give users up-to-date opening hours and contacts.
- **Researchers & journalists** – map public services across a territory.

### What data do you get?

| Field | Example |
|---|---|
| `name`, `serviceTypes` | Mairie - Aurillac, `mairie` |
| `email` | administration@aurillac.fr |
| `phones`, `websites`, `contactFormUrl` | 04 71 45 46 46, https://www.aurillac.fr/ |
| `street`, `postalCode`, `city`, `postalAddress` | Place de l'Hôtel-de-Ville, 15000 Aurillac |
| `latitude`, `longitude`, `inseeCode` | map-ready |
| `openingHours` | Lundi 09:00-17:00, Mardi-Vendredi 09:00-12:00, 13:30-17:00 |
| `siret`, `siren`, `officialPageUrl`, `lastModified` | official identifiers and page |

### Common service types

`mairie` (town hall, 35,000+), `ccas`, `police_municipale`, `france_services`, `gendarmerie`, `commissariat_police`, `caf`, `cpam`, `france_travail`, `mission_locale`, `sip` (tax office), `tresorerie`, `prefecture`, `sous_pref`, `epci` (intercommunality), `cci`, `chambre_metier`, `sdis`, `urssaf`, `tribunal_commerce`, `pmi`, `cio`… Any official type code works.

### How to use

Example – every town hall in the Cantal (15) with an email address:

```json
{
  "serviceTypes": ["mairie"],
  "departments": ["15"],
  "onlyWithEmail": true,
  "maxResults": 500
}
```

### Pricing

You pay a small fee per office returned.

### Data source, license & privacy

Data comes from the official **Annuaire de l'administration** published by the DILA on [Service-Public.fr](https://api-lannuaire.service-public.fr/explore/dataset/api-lannuaire-administration/), under the **Licence Ouverte v2.0 (Etalab)**, which allows commercial reuse with attribution. Every result includes a `source` field with this attribution.

Only **institutional** contact details are returned. Names of individual civil servants are never collected. If you use these contacts for prospecting, follow the applicable rules (e.g. GDPR and French rules on B2B emailing: relevant offer and an easy way to opt out).

This Actor is not affiliated with the French government.

# Actor input Schema

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

Types of public offices to list. Empty = all types. You can also type any other official type code (e.g. sdis, cci, chambre\_metier).

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

Department numbers, e.g. 15, 69, 2A, 974.

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

French postal codes, e.g. 75013.

## `cities` (type: `array`):

City names, e.g. Aurillac, Lyon.

## `nameKeywords` (type: `array`):

Words searched in the office name, e.g. préfecture, tribunal.

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

Skip offices without a published email.

## `maxResults` (type: `integer`):

Maximum number of offices to return.

## Actor input object example

```json
{
  "serviceTypes": [
    "mairie"
  ],
  "departments": [
    "15"
  ],
  "onlyWithEmail": false,
  "maxResults": 50
}
```

# Actor output Schema

## `overview` (type: `string`):

Public offices with email, phone, website, address and opening hours. Main fields in a table.

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

Public offices with email, phone, website, address and opening hours. Every field (JSON).

# 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": [
        "15"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bstandco/france-public-services-directory").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": ["15"],
}

# Run the Actor and wait for it to finish
run = client.actor("bstandco/france-public-services-directory").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": [
    "15"
  ]
}' |
apify call bstandco/france-public-services-directory --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bstandco/france-public-services-directory"
        }
    }
}
```

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/UKrxLaqxzaN441rbX/builds/TBpRHxjFz6Llyyfzw/openapi.json
