# Bulk Address Geocoder – US Census Tract, FIPS & France BAN (`gazidev/address-geocoder`) Actor

Geocode addresses in bulk with official government sources: US Census Geocoder (latitude, longitude, matched address, state and county FIPS, tract, block) and France BAN. Reverse lookup for US coordinates. No Google, no API key, unmatched rows are free. $0.40 per 1,000.

- **URL**: https://apify.com/gazidev/address-geocoder.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.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.

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

## Bulk Address Geocoder – US Census Tract, FIPS & France BAN

Geocode a list of addresses with official government services and get latitude, longitude, the matched address and, for the US, the state FIPS, county FIPS, census tract and block. No Google, no API key, and rows that do not match are free.

**Coverage: only the United States and France.** Addresses from any other country will not match. One country per run.

> This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau.
>
> French data: Base Adresse Nationale (BAN), via the IGN Geoplateforme, Licence Ouverte / Etalab.

### What you can do with it

- **Add census geography to US addresses:** tract, block and FIPS codes for market analysis, reporting and joins with Census data.
- **Clean up French address lists:** the normalized BAN address, postcode, city, INSEE code and a confidence score.
- **Look up the census geography of US coordinates:** state, county, tract and block.
- **Use it in n8n, Make or the Apify API:** one flat row per address.

### Sources

| Country | Service | Returns | Precision |
|---|---|---|---|
| US | [US Census Geocoder](https://geocoding.geo.census.gov/geocoder/) | Coordinates, matched address, state and county FIPS, tract, block | **Often interpolated** along an address range: the position is approximate and a structure may not exist at that exact number |
| FR | [Base Adresse Nationale](https://adresse.data.gouv.fr/) via `data.geopf.fr/geocodage` | Coordinates, normalized address, postcode, city, INSEE code, score | Check `matchType`: `housenumber`, `street`, `locality` or `municipality` |

### Input example

```json
{
  "addresses": [
    "233 S Wacker Dr, Chicago, IL 60606",
    {"street": "350 5th Ave", "city": "New York", "state": "NY", "zip": "10118"}
  ],
  "country": "US",
  "coordinates": ["38.8977,-77.0365"]
}
```

| Field | Default | Notes |
|---|---|---|
| `addresses` | 3 sample addresses when both lists are empty | Free text or `{street, city, state, zip}`. Up to 200 characters each. Exact duplicates are skipped (ignoring case) |
| `country` | `US` | `US` or `FR` |
| `coordinates` | none | `"lat,lon"` or `{lat, lon}`. US only, whichever country is selected |
| `includeGeographies` | `true` | US: set `false` for coordinates only |
| `minScore` | `0.5` | France: lower-scoring results count as unmatched and are free |
| `maxItems` | no limit | Cap on addresses plus coordinates |

### Output example

```json
{
  "input": "233 S Wacker Dr, Chicago, IL 60606",
  "country": "US",
  "matched": true,
  "matchType": "Exact",
  "score": null,
  "matchedAddress": "233 S WACKER DR, CHICAGO, IL, 60606",
  "lat": 41.878919545908,
  "lon": -87.636602278191,
  "stateFips": "17",
  "countyFips": "031",
  "tract": "839100",
  "block": "2008",
  "postcode": "60606",
  "city": "CHICAGO",
  "inseeCode": null,
  "source": "us-census-geocoder",
  "attribution": "U.S. Census Bureau Geocoder. This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau.",
  "error": null
}
```

**`matchType`:** `Exact` or `Non_Exact` (US); `housenumber`, `street`, `locality` or `municipality` (France); `reverse` (coordinates). Unmatched rows show `No_Match`, `Tie` (US: several candidates, none returned) or `below_min_score` (France).

A run summary is saved as `OUTPUT` in the key-value store.

### Limits

- **Two countries only.** It does not fall back to another source.
- **Reverse lookup gives no street address.** The Census service returns geographies for a coordinate, not an address. Coordinates outside its coverage come back unmatched. There is no reverse lookup for France.
- **Not every valid address matches.** For example, the Census service returned `No_Match` for "1 Infinite Loop, Cupertino, CA 95014" in our test. Those rows are free, but they have no coordinates.
- **US rows have no score.** Use `matchType`.
- **Free text in France is scored by similarity.** A low `minScore` can accept a result in the wrong place, so check `score` and `matchType`.
- **The services can be unavailable.** Failed calls are retried, then the rows get a free `error` and the run still ends as succeeded. After three failed calls in a row the remaining rows are skipped, also as free errors.

### Rate limits

Requests run strictly one at a time, in batches of up to 1,000 addresses, from one IP address with no rotation.

- **France:** at most one call per second. The published limit is 50 calls per IP per second. Batches stay under the published file limit of 50 MB or 200,000 lines.
- **US:** the Census service documents a limit of 10,000 records per batch, and we found no published request rate. This Actor waits at least 0.5 s between batches and 0.25 s between coordinate lookups.
- **On HTTP 429 or 503:** it waits for `Retry-After` (at least 6 s) and retries at most twice.

So large lists take time: about 26 s per 1,000 US addresses in our local test, and far less for France.

### Pricing

Pay per event, and only for matched rows.

| Event | Price | When |
|---|---|---|
| `address-geocoded` | $0.0004 | One matched address ($0.40 per 1,000) |
| `reverse-geocoded` | $0.0004 | One coordinate with geographies found |
| `apify-actor-start` | $0.00005 | Once per run |

Free: unmatched addresses, invalid rows, errors and skipped duplicates. If the run's maximum total charge is reached, it stops cleanly with `stoppedAtMaxCharge: true` in `OUTPUT`.

### Your responsibilities

- **Census terms:** these bar using the data, alone or combined with other data, to identify any individual person, household, business or other entity. They also bar presenting modified content as coming from the Census Bureau. Read the [Census API terms](https://www.census.gov/data/developers/about/terms-of-service.html) before use.
- **Attribution:** keep the notices above, and the `attribution` field, when you republish results. French data is under the Licence Ouverte / Etalab, which requires naming the source.
- **Your input:** addresses you submit are sent to these public services. Do not submit data you are not allowed to share with them.

This Actor is not affiliated with the U.S. Census Bureau, IGN or the French government.

# Actor input Schema

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

JSON list. Each item is free text ("233 S Wacker Dr, Chicago, IL 60606") or an object {"street", "city", "state", "zip"}. Exact duplicates are skipped. If both this and Coordinates are empty, three sample addresses are geocoded.

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

Only the United States (US Census Geocoder) and France (BAN) are covered. One country per run. Addresses from any other country will not match.

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

Optional JSON list of "lat,lon" strings or {"lat", "lon"} objects, such as "41.8789,-87.6366". Returns state and county FIPS, tract and block, **not a street address**: the Census service does not give one. US only, also when Country is France.

## `includeGeographies` (type: `boolean`):

Return state FIPS, county FIPS, tract and block for US addresses. Turn off if you only need coordinates.

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

BAN results scoring below this value (0 to 1) count as unmatched and are free. Ignored for the US, where the Census service gives no score.

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

Process at most this many addresses plus coordinates. Leave empty for no limit.

## Actor input object example

```json
{
  "addresses": [
    "1600 Pennsylvania Ave NW, Washington, DC 20500",
    "350 5th Ave, New York, NY 10118",
    "233 S Wacker Dr, Chicago, IL 60606"
  ],
  "country": "US",
  "includeGeographies": true,
  "minScore": 0.5
}
```

# Actor output Schema

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

No description

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

No description

## `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 Pennsylvania Ave NW, Washington, DC 20500",
        "350 5th Ave, New York, NY 10118",
        "233 S Wacker Dr, Chicago, IL 60606"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/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 Pennsylvania Ave NW, Washington, DC 20500",
        "350 5th Ave, New York, NY 10118",
        "233 S Wacker Dr, Chicago, IL 60606",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("gazidev/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 Pennsylvania Ave NW, Washington, DC 20500",
    "350 5th Ave, New York, NY 10118",
    "233 S Wacker Dr, Chicago, IL 60606"
  ]
}' |
apify call gazidev/address-geocoder --silent --output-dataset

```

## MCP server setup

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