English
Base Adresse Nationale
Normalises a French address and returns its coordinates, INSEE code and land parcel.
The Base Adresse Nationale node normalises a French address, even one typed by hand in an email, and returns its coordinates, the INSEE code of its municipality and its BAN identifier. It can also find the closest address to a point, and the land parcel that holds an address.
It is an open public API, served by IGN’s Géoplateforme: nothing to connect, no key. The EPC (ADEME), Géorisques and Land registry nodes call it themselves when you give them an address.
At a glance
- Type:
ban.api· version 1 - Category: Data
- Kind: Step — one stage of a run
- Effect: No external effect (
none) — nothing is written outside Loop & Roll; safe to replay - Needs a carrier email: No
- Connection: None
- Inputs:
main - Outputs:
main
Parameters
action
Action
- Type: One choice (
options) - Required: Yes
- Default:
geocode - Options:
geocode— Geocode an address: The normalised address, its coordinates, INSEE code and BAN identifier.reverse— Address of a point: The closest address to a latitude and longitude.parcel— Land parcel of an address: The land registry reference of the parcel holding the address or point.
address
Address — A postal address, even an approximate one. Accepts {{ }} expressions. For the parcel: leave empty to use the latitude and longitude.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 300 characters at most
- Example:
8 bd du Port, Amiens - Shown when:
actionis one ofgeocode,parcel - Expressions:
{{ }}accepted
postcode
Postcode — Optional: restricts the search to this postcode.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 5 characters at most
- Shown when:
actionisgeocode - Expressions:
{{ }}accepted
citycode
Municipality INSEE code — Optional: restricts the search to this municipality.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 5 characters at most
- Shown when:
actionisgeocode - Expressions:
{{ }}accepted
addressType
Result type
- Type: One choice (
options) - Required: No
- Default:
any - Options:
any— Anyhousenumber— House numberstreet— Streetlocality— Localitymunicipality— Municipality
- Shown when:
actionisgeocode
minScore
Minimum score — Between 0 and 1. A less certain candidate is discarded and found is false: finding nothing beats finding the wrong address.
- Type: Number (
number) - Required: No
- Default:
0.5 - From 0 to 1
- Shown when:
actionis one ofgeocode,parcel
lat
Latitude
- Type: Text (
string) - Required: No
- Default:
""(empty) - 30 characters at most
- Example:
49.8974 - Shown when:
actionis one ofreverse,parcel - Expressions:
{{ }}accepted
lon
Longitude
- Type: Text (
string) - Required: No
- Default:
""(empty) - 30 characters at most
- Example:
2.2901 - Shown when:
actionis one ofreverse,parcel - Expressions:
{{ }}accepted
limit
Number of candidates
- Type: Number (
number) - Required: No
- Default:
1 - Whole number, from 1 to 20
- Shown when:
actionis one ofgeocode,reverse
Outputs
main— Taken once the call to the Base Adresse Nationale has completed, whether or not an address was found: readfoundto know.
Data produced
What this node adds to the run data, and how to read it in an expression. <step> stands for the step key: the node name turned into an identifier (see Data and expressions).
{{ data.<step>.found }}—boolean. true when a sufficiently certain address (or parcel) was found.{{ data.<step>.label }}—string. Geocode and Address of a point: the normalised address of the best candidate, for example “8 Boulevard du Port 80000 Amiens”.{{ data.<step>.lat }}—number. Latitude of the best candidate (or of the point used for the parcel).{{ data.<step>.lon }}—number. Longitude of the best candidate (or of the point used for the parcel).{{ data.<step>.citycode }}—string. Geocode and Address of a point: the INSEE code of the municipality (not its postcode), the one the EPC and Géorisques nodes expect.{{ data.<step>.postcode }}—string. Geocode and Address of a point: the postcode.{{ data.<step>.city }}—string. Geocode and Address of a point: the municipality name.{{ data.<step>.banId }}—string. Geocode and Address of a point: the address identifier in the BAN, for example80021_6590_00008.{{ data.<step>.score }}—number. Geocode and Address of a point: the confidence of the best candidate, between 0 and 1.{{ data.<step>.results }}—array of { label, score, lat, lon, banId, housenumber, street, postcode, citycode, city, context, type }. Geocode and Address of a point: every candidate kept, best first.{{ data.<step>.count }}—number. Geocode and Address of a point: the number of candidates kept.{{ data.<step>.parcelId }}—string. Land parcel only: the fourteen-character reference, for example80021000VA0065.{{ data.<step>.parcel }}—{ id, departmentCode, municipalityCode, inseeCode, section, number, sheet, city, distanceMeters }. Land parcel only: the parcel split into its parts, and its distance to the point in metres.{{ data.<step>.address }}—string. Land parcel only: the normalised address when an address was given, empty otherwise.{{ data.<step>.summary }}—string. The one-line summary in the member’s language, for example “Address found: 8 Boulevard du Port 80000 Amiens.” (withsummaryKeyandsummaryParams).
Operations
- Geocode an address (
geocode, the default). Searches Address (address) and keeps the candidates whose score reaches the Minimum score (minScore, 0.5 by default), up to the Number of candidates (limit, 1 to 20, 1 by default). Postcode (postcode), Municipality INSEE code (citycode) and Result type (addressType: house number, street, locality, municipality) narrow the search. - Address of a point (
reverse). The closest address to Latitude (lat) and Longitude (lon). A decimal comma is accepted. - Land parcel of an address (
parcel). Geocodes Address, then asks for the parcel holding that point. Leave Address empty to use Latitude and Longitude.
Example
An owner writes “I am selling my house at 8 bd du port in Amiens”. An Extract step named read pulls the address out; the node is called “Address”:
text
action geocode
address {{ data.read.address }}
minScore 0.5The step data:
json
{
"found": true,
"label": "8 Boulevard du Port 80000 Amiens",
"lat": 49.897442,
"lon": 2.290084,
"banId": "80021_6590_00008",
"postcode": "80000",
"citycode": "80021",
"city": "Amiens",
"count": 1
}A following EPC (ADEME) node can list the certificates of the municipality with {{ data.address.citycode }}.
Tips
- Test runs. The three actions are reads: they really run in a test run.
- Doubtful address. Below the minimum score,
foundis false: branch an If on it rather than use the wrong address. - INSEE code and postcode. They often differ (Amiens: 80021 and 80000). The other public data nodes expect the INSEE code.
- Rate. The service accepts 50 requests per second from a single IP address; beyond that, the request is retried automatically.
- Errors. An empty address or empty coordinates fail the step with
node_invalid_param. See Error handling.