# French Address Geocoder (BAN / Géoplateforme) (`klyve1/france-address-geocoder`) Actor

Geocode and normalise French addresses in bulk with the official Base Adresse Nationale: clean address, GPS coordinates, postcode, INSEE city code, department, region and match score. Reverse geocoding too.

- **URL**: https://apify.com/klyve1/france-address-geocoder.md
- **Developed by:** [Nico Klyve](https://apify.com/klyve1) (community)
- **Categories:** Developer tools, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 address matcheds

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

## French Address Geocoder (BAN / Géoplateforme)

Geocode and normalise **French addresses in bulk** with the **Base Adresse Nationale**, the official address database of France, served by the IGN Géoplateforme. Typos, abbreviations and missing postcodes are fine: you get the clean official address, GPS coordinates, postcode, INSEE city code, department, region and a match score. Reverse geocoding (GPS point to nearest address) is included.

### Who uses it

- **CRM and data teams**: clean and deduplicate customer addresses, add the INSEE code and department.
- **Logistics and delivery**: get coordinates for route planning and check that an address exists.
- **Real estate, insurance, retail**: map clients, stores or properties by department and region.
- **Public sector and open data projects**: match datasets on the official BAN identifier.

### Example output

```json
{
  "query": "8 bd du port amiens",
  "mode": "geocode",
  "found": true,
  "rank": 1,
  "label": "8 Boulevard du Port 80000 Amiens",
  "score": 0.5966,
  "matchType": "housenumber",
  "housenumber": "8",
  "street": "Boulevard du Port",
  "postcode": "80000",
  "city": "Amiens",
  "citycode": "80021",
  "departmentCode": "80",
  "department": "Somme",
  "region": "Hauts-de-France",
  "latitude": 49.897442,
  "longitude": 2.290084,
  "lambert93X": 648952.58,
  "lambert93Y": 6977867.14,
  "banId": "f2633629-5541-4233-aa54-3c2eb58aa8b9",
  "banKey": "80021_6590_00008"
}
```

### Input

| Field | What it does | Default |
|---|---|---|
| `addresses` | Free-text French addresses, one per line | |
| `coordinates` | Optional `latitude,longitude` points for reverse geocoding | |
| `resultsPerAddress` | Candidates per query, best first (1 to 10) | 1 |
| `minScore` | Ignore matches below this score (0 to 1) | 0 |
| `type` | Restrict to house number, street, locality or municipality | any |
| `postcode` | Optional postcode filter for all queries | |
| `concurrency` | Queries in parallel | 5 |

### Pricing

Pay per result: **$0.0005 per address or point matched**, whatever the number of candidates returned. Queries with no match are free.

### Good to know

- Covers metropolitan France and the overseas departments. Addresses outside France are not supported.
- The score tells you how sure the match is: above 0.8 is usually exact, below 0.5 deserves a look.
- Data: Base Adresse Nationale (BAN), Licence Ouverte / Etalab 2.0, through the official geocoding service of the IGN Géoplateforme. Mention the source when you reuse the data.

# Actor input Schema

## `addresses` (type: `array`):

French addresses to geocode, one per line, written freely (typos and abbreviations are fine), for example "8 bd du port amiens".

## `coordinates` (type: `array`):

Optional GPS points as "latitude,longitude" (WGS84), one per line. Returns the nearest address.

## `resultsPerAddress` (type: `integer`):

How many candidate addresses to return per query, best first. One query is charged once whatever this number.

## `minScore` (type: `number`):

Ignore geocoding matches with a score below this value (0 to 1). Queries with no match left are free.

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

Restrict results to one level. Empty means any level.

## `postcode` (type: `string`):

Optional 5-digit postcode applied to all address queries.

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

Queries sent at the same time. Keep it low to respect the public service.

## Actor input object example

```json
{
  "addresses": [
    "8 bd du port amiens",
    "20 avenue de segur paris",
    "1 place de la comedie 34000"
  ],
  "coordinates": [
    "48.8584,2.2945"
  ],
  "resultsPerAddress": 1,
  "minScore": 0,
  "concurrency": 5
}
```

# Actor output Schema

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

All rows produced by the run.

# 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 = {
    "addresses": [
        "8 bd du port amiens",
        "20 avenue de segur paris",
        "1 place de la comedie 34000"
    ],
    "coordinates": [
        "48.8584,2.2945"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("klyve1/france-address-geocoder").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 = {
    "addresses": [
        "8 bd du port amiens",
        "20 avenue de segur paris",
        "1 place de la comedie 34000",
    ],
    "coordinates": ["48.8584,2.2945"],
}

# Run the Actor and wait for it to finish
run = client.actor("klyve1/france-address-geocoder").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 '{
  "addresses": [
    "8 bd du port amiens",
    "20 avenue de segur paris",
    "1 place de la comedie 34000"
  ],
  "coordinates": [
    "48.8584,2.2945"
  ]
}' |
apify call klyve1/france-address-geocoder --silent --output-dataset

```

## MCP server setup

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

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/D0dAZno94kgEcKpCD/builds/iRYYWUGhUhs4O80KW/openapi.json
