# France Public Administration Scraper - Contacts (`dltik/annuaire-administration-fr-scraper`) Actor

Search the official French public-administration directory. 94K+ bodies: mairies, prefectures, CAF, CPAM, tribunaux, ministries. Filter by type, department, region or commune. Get address, phone, email, website, opening hours, SIRET, GPS. For B2G sales, lobbying, prospecting. $3/1K.

- **URL**: https://apify.com/dltik/annuaire-administration-fr-scraper.md
- **Developed by:** [dltik](https://apify.com/dltik) (community)
- **Categories:** Business, Lead generation, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 administration scrapeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## France Public Administration Directory Scraper — Contacts (Mairies, Préfectures) API

> Query the **official French public-administration directory** ([lannuaire.service-public.fr](https://lannuaire.service-public.fr/), DILA). **94,000+ public bodies** — mairies, préfectures, sous-préfectures, CAF, CPAM, tribunaux, ministries, services déconcentrés and more — each with **full contact details**. Filter by type, department, region or commune and get a clean, exportable dataset of **address, phone, email, website, opening hours, SIRET and GPS**. **HTTP-only, $0.003 per administration**.

⭐ **Bookmark this Public Administration Directory Scraper** — Apify ranks actors by bookmarks, so it directly helps the visibility of this scraper on the Apify Store.

### What is the Public Administration Directory Scraper?

The **France Public Administration Directory Scraper** is an Apify actor that turns the [official annuaire de l'administration](https://lannuaire.service-public.fr/) into a filterable, exportable contact database. The directory is maintained by the DILA (Direction de l'information légale et administrative) and is the authoritative source for how to reach any French public body — from the smallest village mairie to a national ministry.

It runs on the free official open-data API (no authentication, no API key, no rate limits to fight). Pass a type, a territory and/or a name, and receive one structured row per administration with its full postal address, phone, email, website, opening hours, SIRET and geographic codes.

### Why it matters: B2G sales, lobbying and prospecting

Selling to the public sector (B2G) means reaching tens of thousands of decentralised buyers — every commune, every CAF branch, every court runs its own procurement. The contact data exists in the official directory but is locked behind a search UI. This scraper unifies it so you can pull, for example, *every mairie in Île-de-France with a phone and email* or *every CPAM in France* as a ready-to-use prospecting list.

### Use cases

- **B2G prospecting** — build targeted contact lists of mairies, préfectures or CAF/CPAM branches by territory.
- **Lobbying / public affairs** — map the administrative bodies relevant to a policy area.
- **Mailing & outreach** — export postal addresses, phones and emails for direct campaigns to the public sector.
- **GovTech & CRM enrichment** — match administrations to communes and INSEE codes for geographic segmentation.
- **Research & journalism** — analyse the distribution and contactability of public services across France.

### Input

```json
{
  "org_type": "mairie",
  "department": "33",
  "maxResults": 600
}
````

- `query` — name keyword (e.g. `urssaf`, `prefecture de police`).
- `org_type` — official type slug: `mairie`, `prefecture`, `sous_prefecture`, `caf`, `cpam`, `tribunal`, `conseil_departemental`, `conseil_regional`, `epci`...
- `department` — code (`33`, `75`, `2A`, `971`).
- `region` — code (`11`) or name (`Bretagne`); expanded to its departments. Ignored if `department` is set.
- `commune` — name (`Bordeaux`) or INSEE code (`33063`).
- `maxResults` — cap on rows (aliases `limit`, `max`).

### Output

```json
{
  "type": "administration",
  "name": "Mairie - Bordeaux",
  "org_type": "mairie",
  "address": "Place Pey-Berland 33000 Bordeaux",
  "postal_code": "33000",
  "city": "Bordeaux",
  "code_insee_commune": "33063",
  "phone": "05 56 10 20 30",
  "email": "contact@bordeaux.fr",
  "website": "https://www.bordeaux.fr",
  "opening_hours": ["Lundi-Vendredi 09:00-17:00"],
  "siret": "21330063500017",
  "latitude": 44.83802,
  "longitude": -0.579635,
  "url_service_public": "https://lannuaire.service-public.gouv.fr/..."
}
```

### Pricing

**PAY\_PER\_EVENT — $0.003 per administration** (= $3 per 1,000). Free actor starts. No charge when nothing matches.

### FAQ — French public administration directory data

**Where does the data come from?** The official annuaire de l'administration (lannuaire.service-public.fr), published as open data by the DILA. No key required.

**Which administrations are covered?** All of them: 94K+ bodies including mairies, préfectures, sous-préfectures, CAF, CPAM, URSSAF, tribunaux, ministries and decentralised state services.

**Do all records have a phone and email?** Most mairies and branches do; some smaller services list only a postal address or a contact form (`contact_form_url`). Fields are null when the directory has no value.

**How many can I pull at once?** The source API caps a single query at 10,000 rows; narrow by department or type to export larger populations slice by slice.

***

⭐ **Found this useful? Bookmark this Public Administration Directory Scraper** — it's the strongest signal for Apify Store ranking.

#### Related actors

- [RNE Elected Officials Scraper](https://apify.com/dltik/rne-elus-fr-scraper) — French mayors, councillors, MPs and senators
- [Pappers Sirène Scraper](https://apify.com/dltik/pappers-sirene-scraper) — 26M French companies (SIREN/SIRET)
- [Google Maps Email Extractor](https://apify.com/dltik/google-maps-email-extractor) — emails + contacts from Google Maps

License: MIT · Author: [dltik](https://apify.com/dltik)

# Actor input Schema

## `query` (type: `string`):

Search the organisation name (case/accent-insensitive). Example: 'urssaf', 'prefecture de police', 'Bordeaux'. Combine with org\_type or a territory filter.

## `org_type` (type: `string`):

Filter by administration type (matches the official 'pivot' slug). Examples: 'mairie', 'prefecture', 'sous\_prefecture', 'caf', 'cpam', 'tribunal', 'conseil\_departemental', 'conseil\_regional', 'epci'. Leave empty for all types.

## `department` (type: `string`):

Department code: '33', '75', '2A', '971'. Filters administrations whose commune INSEE code starts with it. Takes priority over region when both are set.

## `region` (type: `string`):

Region code (e.g. '11', '84') or name (e.g. 'Bretagne', 'Ile-de-France'). Expanded to its departments. Ignored if 'department' is set.

## `commune` (type: `string`):

Commune name (e.g. 'Bordeaux') or 5-char INSEE code (e.g. '33063'). INSEE code is exact; a name does a fuzzy address match.

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

Max administrations to return. Aliases accepted: 'limit', 'max'. Each one is charged at the per-event price - start small. Capped at 10000 per run by the source API; narrow by department/type for larger sets.

## `proxyConfig` (type: `object`):

Optional. The lannuaire open API has no anti-bot, so proxy is rarely needed.

## Actor input object example

```json
{
  "maxResults": 50,
  "proxyConfig": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Administration records with contacts.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("dltik/annuaire-administration-fr-scraper").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("dltik/annuaire-administration-fr-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call dltik/annuaire-administration-fr-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dltik/annuaire-administration-fr-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "France Public Administration Scraper - Contacts",
        "description": "Search the official French public-administration directory. 94K+ bodies: mairies, prefectures, CAF, CPAM, tribunaux, ministries. Filter by type, department, region or commune. Get address, phone, email, website, opening hours, SIRET, GPS. For B2G sales, lobbying, prospecting. $3/1K.",
        "version": "1.0",
        "x-build-id": "G044iDo8BDmXazQKe"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dltik~annuaire-administration-fr-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dltik-annuaire-administration-fr-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/dltik~annuaire-administration-fr-scraper/runs": {
            "post": {
                "operationId": "runs-sync-dltik-annuaire-administration-fr-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/dltik~annuaire-administration-fr-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-dltik-annuaire-administration-fr-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "title": "Name keyword",
                        "type": "string",
                        "description": "Search the organisation name (case/accent-insensitive). Example: 'urssaf', 'prefecture de police', 'Bordeaux'. Combine with org_type or a territory filter."
                    },
                    "org_type": {
                        "title": "Organisation type",
                        "type": "string",
                        "description": "Filter by administration type (matches the official 'pivot' slug). Examples: 'mairie', 'prefecture', 'sous_prefecture', 'caf', 'cpam', 'tribunal', 'conseil_departemental', 'conseil_regional', 'epci'. Leave empty for all types."
                    },
                    "department": {
                        "title": "Department",
                        "type": "string",
                        "description": "Department code: '33', '75', '2A', '971'. Filters administrations whose commune INSEE code starts with it. Takes priority over region when both are set."
                    },
                    "region": {
                        "title": "Region",
                        "type": "string",
                        "description": "Region code (e.g. '11', '84') or name (e.g. 'Bretagne', 'Ile-de-France'). Expanded to its departments. Ignored if 'department' is set."
                    },
                    "commune": {
                        "title": "Commune",
                        "type": "string",
                        "description": "Commune name (e.g. 'Bordeaux') or 5-char INSEE code (e.g. '33063'). INSEE code is exact; a name does a fuzzy address match."
                    },
                    "maxResults": {
                        "title": "Max administrations",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Max administrations to return. Aliases accepted: 'limit', 'max'. Each one is charged at the per-event price - start small. Capped at 10000 per run by the source API; narrow by department/type for larger sets.",
                        "default": 50
                    },
                    "proxyConfig": {
                        "title": "Proxy (rarely needed)",
                        "type": "object",
                        "description": "Optional. The lannuaire open API has no anti-bot, so proxy is rarely needed.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
