# Bulk Address Geocoder — Global Address Geocoding (`memo23/bulk-address-geocoder`) Actor

High-speed offline bulk forward & reverse geocoder for 13 countries (AU, BR, CA, FR, DE, IT, MX, NL, NZ, PL, RS, ES, US) powered by GridPin, with direct Apify dataset enrichment (SeLoger, Zillow, Immobiliare) and optional Nominatim fallback. From $0.50/1k.

- **URL**: https://apify.com/memo23/bulk-address-geocoder.md
- **Developed by:** [Muhamed Didovic](https://apify.com/memo23) (community)
- **Categories:** Developer tools, Real estate, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 address geocodeds

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/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

## Bulk Address Geocoder — Global Open-Data & Offline Geocoding

Geocode thousands of street addresses into WGS84 coordinates (`lat`/`lng`) — or reverse-geocode coordinates back into structured addresses — at **$0.50 per 1,000 rows** with **zero third-party API keys required**.

Powered out of the box by **Photon (Komoot OpenStreetMap ODbL)** + **Etalab French BAN (Licence Ouverte 2.0)** + **OpenStreetMap Nominatim fallback**, with optional **GridPin offline Cloudflare R2 acceleration** and **direct Apify Dataset enrichment** (SeLoger, Zillow, Immobiliare, Idealista, Realtor, etc.).

***

### Geocoding Engines (Zero-Key Out of the Box)

| Lane | Coverage | Trigger Condition | Attribution |
| :--- | :--- | :--- | :--- |
| **GridPin R2 / Microservice** *(optional)* | `AU`, `BR`, `CA`, `FR`, `DE`, `IT`, `MX`, `NL`, `NZ`, `PL`, `RS`, `ES`, `US` | When private `GRIDPIN_R2_*` or `GRIDPIN_API_URL` env vars are configured | Contains OpenStreetMap (ODbL) and Overture Maps data via GridPin |
| **Etalab BAN FR** *(default)* | France (`FR`) | Auto-selected for French rows when `openGeocoder` is `auto` or `photon` | © IGN / Etalab BAN (Licence Ouverte 2.0) |
| **Photon (Komoot OSM)** *(default)* | Worldwide (all countries) | Zero-key global engine (`PHOTON_BASE_URL` env overrides public `photon.komoot.io`) | © OpenStreetMap contributors (ODbL) via Photon |
| **OSM Nominatim** *(fallback)* | Worldwide (all countries) | Fallback for unmatched rows or when `openGeocoder: "nominatim"` (`<= 1 req/sec`) | © OpenStreetMap contributors (ODbL) via Nominatim |

***

### Geocoder Modes

Select the mode from the top-level **`geocoderMode`** dropdown:

1. **`Forward Geocode — Address to Lat/Lng ($0.50 per 1k)`** *(default)* — Converts street addresses into `lat`, `lng`, `normalizedAddress`, `confidence`, `matchLevel` (`house`, `interpolated`, `street`, `postcode`, `city`), and `addressComponents`.
2. **`Reverse Geocode — Lat/Lng to Address ($0.50 per 1k)`** — Converts `{ lat, lng }` pairs (or scraper rows containing `latitude`/`longitude`) into the nearest structured address plus `distanceMeters`.
3. **`Normalize + Forward Geocode ($0.75 per 1k)`** — Cleans messy scraped addresses first (whitespace/newline collapse, street/unit abbreviation expansion like `Pkwy.` → `Parkway`, Canadian/Dutch postal standardization, component parsing) before forward geocoding, recording every edit in `normalizationChanges`.

***

### Enrich Any Apify Scraper Dataset Directly

Already scraped property listings with **[SeLoger Scraper](https://apify.com/memo23/seloger-scraper)**, **Zillow**, or **Immobiliare**? Pass that run's `datasetId` directly — no export/re-import needed. Every original listing field is preserved and enriched with `lat`, `lng`, `normalizedAddress`, `confidence`, and `matchLevel`.

```json
{
    "geocoderMode": "Normalize + Forward Geocode ($0.75 per 1k)",
    "datasetId": "YOUR_SELOGER_OR_ZILLOW_DATASET_ID",
    "addressField": "address",
    "defaultCountry": "FR",
    "maxItems": 5000
}
```

#### Direct Forward Geocoding Example

```json
{
    "geocoderMode": "Forward Geocode — Address to Lat/Lng ($0.50 per 1k)",
    "addresses": [
        "1600 Amphitheatre Parkway, Mountain View, CA 94043, US",
        "57 Rue de Varenne, 75007 Paris, France",
        "Alexanderplatz 1, 10178 Berlin, Germany"
    ],
    "fallbackToNominatim": false,
    "maxItems": 1000
}
```

#### Reverse Geocoding Example

```json
{
    "geocoderMode": "Reverse Geocode — Lat/Lng to Address ($0.50 per 1k)",
    "coordinates": [
        { "lat": 48.8566, "lng": 2.3522, "countryCode": "FR", "id": "paris-center" },
        { "lat": 40.7484, "lng": -73.9857, "countryCode": "US", "id": "empire-state" }
    ]
}
```

***

### Output Schema

```json
{
    "id": "addr-1",
    "mode": "normalize_forward",
    "matched": true,
    "inputAddress": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, US",
    "normalizedAddress": "1600 Amphitheatre Parkway, Mountain View, CA 94043, US",
    "normalizationChanges": ["expanded Pkwy -> Parkway"],
    "lat": 37.4220656,
    "lng": -122.0840897,
    "confidence": 0.98,
    "matchLevel": "house",
    "countryCode": "US",
    "addressComponents": {
        "houseNumber": "1600",
        "street": "Amphitheatre Parkway",
        "city": "Mountain View",
        "state": "CA",
        "postalCode": "94043",
        "countryCode": "US"
    },
    "distanceMeters": null,
    "engine": "gridpin",
    "attribution": "Contains OpenStreetMap (ODbL) and Overture Maps data via GridPin",
    "error": null,
    "processedAt": "2026-11-27T08:15:00.000Z"
}
```

***

### Pricing (Pay-Per-Event)

Pay only for addresses geocoded — strictly bounded by your run's **`maxTotalChargeUsd`** (budget slicing caps the batch before execution starts).

| Apify Plan | Forward / Reverse (`address-geocoded`) | Per 1,000 Rows | Normalize + Forward (`+ address-normalized`) | Per 1,000 Rows |
| :--- | :---: | :---: | :---: | :---: |
| **Free** | $0.0005 | $0.50 | $0.00075 | $0.75 |
| **Bronze** | $0.0005 | **$0.50** | $0.00075 | **$0.75** |
| **Silver** | $0.00045 | $0.45 | $0.000675 | $0.68 |
| **Gold** | $0.00040 | $0.40 | $0.00060 | $0.60 |
| **Platinum** | $0.00040 | $0.40 | $0.00060 | $0.60 |
| **Diamond** | $0.00040 | $0.40 | $0.00060 | $0.60 |

- **Free Apify plan cap:** Up to **100 items** per run to validate accuracy on your own dataset. Paid Apify plans lift this limit.
- **Zero wasted spend:** Pre-execution budget slicing honors `maxTotalChargeUsd` automatically.

***

### Architecture & Data Attribution

- **Zero-Key Global Coverage:** Runs out of the box worldwide via Photon (OpenStreetMap ODbL) and Etalab BAN (French official address registry, Licence Ouverte 2.0), with compliant `<= 1 req/sec` Nominatim fallback. Point `PHOTON_BASE_URL` at any self-hosted Photon instance for unlimited throughput.
- **Optional Private GridPin R2 Snapshots:** When `GRIDPIN_R2_*` or `GRIDPIN_API_URL` env vars are set, `.gridpin` snapshots are lazily downloaded into ephemeral `/tmp/gridpin/` storage via SigV4-authenticated R2 requests (never bundled into public images).
- **Attribution:** Every output row records exact `engine` (`photon`, `ban-fr`, `nominatim`, or `gridpin`) and license `attribution`.

***

### 🤖 For AI Agents & LLM Apps

Compact reference for AI agents calling `memo23/bulk-address-geocoder` via the Apify MCP server or API:

- **Minimal forward input:** `{ "addresses": ["57 Rue de Varenne, 75007 Paris, France"] }`
- **Minimal dataset enrichment:** `{ "datasetId": "<DATASET_ID>", "addressField": "address", "defaultCountry": "FR" }`
- **Minimal reverse input:** `{ "geocoderMode": "Reverse Geocode — Lat/Lng to Address ($0.50 per 1k)", "coordinates": [{ "lat": 48.8566, "lng": 2.3522, "countryCode": "FR" }] }`
- **Key output fields:** `matched`, `lat`, `lng`, `normalizedAddress`, `confidence`, `matchLevel`, `countryCode`, `addressComponents`, `engine`, `attribution`.

***

### Support

- **Issues tab:** Report bugs or request additional countries directly on the Actor's Issues tab.
- **Catalog:** Explore more real estate & data enrichment Actors at [apify.com/memo23](https://apify.com/memo23).

# Actor input Schema

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

Choose forward geocoding (address → lat/lng), reverse geocoding (lat/lng → address), or address normalization + forward geocoding.

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

Addresses to forward geocode — one string per line (e.g. `1600 Amphitheatre Parkway, Mountain View, CA 94043, US`), or objects `{ "address": "...", "countryCode": "FR", "id": "row-1" }` via API.

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

Coordinate objects to reverse geocode: `[{ "lat": 48.8566, "lng": 2.3522, "countryCode": "FR", "id": "paris-1" }]`.

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

Optional Apify Dataset ID from another scraper (e.g. SeLoger, Zillow, Immobiliare, Idealista). Reads items from that dataset, geocodes each row, and merges the geocoded fields into your output.

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

Field name (or dot-path like `location.address`) in the input dataset holding the address string. Defaults to `address` (also auto-falls back to combining street/city/postalCode if missing).

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

Two-letter ISO 3166-1 alpha-2 country code used when an address or coordinate has no explicit country (helps bias Photon results and activates the fast French BAN lane for FR). Leave blank to auto-detect from address text.

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

Zero-key open geocoder used whenever private GridPin R2 snapshots are not attached. `auto` uses Etalab BAN for FR + Photon (OSM ODbL) globally; `nominatim` skips Photon.

## `fallbackToNominatim` (type: `boolean`):

When enabled (default), retries unmatched or rate-limited rows through OpenStreetMap Nominatim (strictly paced <= 1 req/sec with ODbL attribution).

## `maxItems` (type: `integer`):

Hard cap on the number of addresses or coordinates to geocode in this run. Free Apify plan is capped at 100 items per run.

## Actor input object example

```json
{
  "geocoderMode": "Forward Geocode — Address to Lat/Lng ($0.50 per 1k)",
  "addresses": [
    "1600 Amphitheatre Parkway, Mountain View, CA 94043, US"
  ],
  "coordinates": [],
  "addressField": "address",
  "openGeocoder": "auto",
  "fallbackToNominatim": true,
  "maxItems": 10000
}
```

# Actor output Schema

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

No description

# 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": [
        "1600 Amphitheatre Parkway, Mountain View, CA 94043, US"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("memo23/bulk-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": ["1600 Amphitheatre Parkway, Mountain View, CA 94043, US"] }

# Run the Actor and wait for it to finish
run = client.actor("memo23/bulk-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": [
    "1600 Amphitheatre Parkway, Mountain View, CA 94043, US"
  ]
}' |
apify call memo23/bulk-address-geocoder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,memo23/bulk-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/QUScUShsiy6eefUvG/builds/tJrArB4QjRzMpvz8X/openapi.json
