# French Address Geocoder & Validator (BAN) (`fit_melon/french-address-geocoder-ban`) Actor

Geocode, normalize and validate French addresses in bulk with the official Base Adresse Nationale (BAN). Coordinates, INSEE code, postcode, city and match score for each address. Géocodage d'adresses françaises en masse. Free — you only pay Apify usage.

- **URL**: https://apify.com/fit\_melon/french-address-geocoder-ban.md
- **Developed by:** [D N](https://apify.com/fit_melon) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## French Address Geocoder & Validator (BAN) — Free

**Geocode, normalize and validate French addresses** using the official **Base Adresse Nationale (BAN)** operated by the French government (`api-adresse.data.gouv.fr`). Turn messy address strings into clean, structured records with GPS coordinates, INSEE municipality code (code commune), postcode and a reliability score. Idéal pour géocoder des adresses françaises en masse (géocodage adresse France, validation d'adresse, code INSEE).

This Actor is **free** — you only pay for your own Apify platform usage.

### What it does

For each address you provide, the Actor queries the official BAN geocoder and returns the best match with latitude/longitude, normalized label, street, postcode, city, INSEE `citycode`, address type (housenumber / street / municipality) and a 0–1 match score you can use to accept or reject results.

### Input

| Field | Type | Description |
|---|---|---|
| `queries` | array of strings | French addresses / place names to geocode (one result item each). |
| `postcodeFilter` | string (optional) | Restrict matches to a single 5-digit postcode. |

### Output (one item per address)

```json
{
  "query": "8 boulevard du Port 95000 Cergy",
  "status": "found",
  "label": "8 Boulevard du Port 95000 Cergy",
  "score": 0.9709,
  "type": "housenumber",
  "housenumber": "8",
  "street": "8 Boulevard du Port",
  "postcode": "95000",
  "citycode": "95127",
  "city": "Cergy",
  "longitude": 2.062821,
  "latitude": 49.031624,
  "banId": "95127_1448_00008"
}
```

Addresses with no match return `{"status": "not_found"}`; transient failures return `{"status": "error", "error": "..."}` — the Actor never crashes on a bad row.

### Use cases

- Clean and geocode a CRM / prospect list of French addresses in bulk.
- Attach INSEE municipality codes for joining with other French open-data sets.
- Validate addresses collected from web forms before storing them.
- Compute map coordinates for logistics, territory planning or data viz.

### Limitations & fair use

Coverage is metropolitan France + DOM as published in the BAN. The public BAN API is rate-limited; this Actor adds polite delays and retries. Data is provided under the French open licence (Licence Ouverte / Etalab). This Actor is not affiliated with the French government.

### More actors by this developer

See other French open-data tools on the **fit\_melon** profile: https://apify.com/fit\_melon

# Actor input Schema

## `queries` (type: `array`):

List of French addresses (or partial addresses / place names) to geocode. One result item per address.

## `postcodeFilter` (type: `string`):

Restrict matches to this 5-digit postcode (BAN 'postcode' filter). Leave empty to search all of France.

## `concurrency` (type: `integer`):

How many addresses to geocode in parallel. Higher = faster on large lists. Default 10.

## Actor input object example

```json
{
  "queries": [
    "8 boulevard du Port 95000 Cergy",
    "20 avenue de Ségur Paris",
    "Place de la Comédie Montpellier"
  ],
  "concurrency": 10
}
```

# 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 = {
    "queries": [
        "8 boulevard du Port 95000 Cergy",
        "20 avenue de Ségur Paris",
        "Place de la Comédie Montpellier"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fit_melon/french-address-geocoder-ban").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 = { "queries": [
        "8 boulevard du Port 95000 Cergy",
        "20 avenue de Ségur Paris",
        "Place de la Comédie Montpellier",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("fit_melon/french-address-geocoder-ban").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 '{
  "queries": [
    "8 boulevard du Port 95000 Cergy",
    "20 avenue de Ségur Paris",
    "Place de la Comédie Montpellier"
  ]
}' |
apify call fit_melon/french-address-geocoder-ban --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fit_melon/french-address-geocoder-ban"
        }
    }
}

```

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/i8QeFlVw1I4K5U9Th/builds/9V06cNKcJAkJbaDAu/openapi.json
