# US Address Geocoder & Census Tract Lookup (`clever_firebox/us-census-geocoder`) Actor

Batch geocode US addresses to latitude/longitude with the official US Census Bureau Geocoder, plus county, FIPS, census tract, block group, block, ZCTA, metro area, congressional and state legislative districts. Reverse geocoding too. No API key; unmatched addresses are free.

- **URL**: https://apify.com/clever_firebox/us-census-geocoder.md
- **Developed by:** [Agentic Hobby](https://apify.com/clever_firebox) (community)
- **Categories:** Developer tools, Real estate
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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

## US Address Geocoder & Census Tract Lookup

**Batch geocode US addresses** to **latitude and longitude** and get the **census geographies** for each one in the same row: **state and county FIPS, county name, city/place, census tract, block group, census block, ZIP Code Tabulation Area (ZCTA), metro area (CBSA), combined statistical area, congressional district, state senate and house districts, school district, urban area**. Works in reverse too: give **lat, lon** points and get the same geographies. Use it as a **free-data geocoding API**, a **census tract lookup**, a **FIPS code lookup**, or an **address to congressional district** tool.

Data comes from the official **US Census Bureau Geocoder** (geocoding.geo.census.gov, public domain, no API key). Results join directly to Census/ACS tables, HMDA and CRA files, opportunity-zone and LIHTC lists, FEMA and HUD datasets, because they use the same GEOIDs.

### Why this one

- **Unmatched addresses are free.** You pay only for addresses (or points) that match. Unmatched rows are still saved so you can fix them.
- **Every geography in one pass:** no second lookup for tracts, FIPS or districts.
- **No Google Maps key, no quota, no ToS limits on storing results** (Census data is public domain).

### Who uses it

Real-estate, mortgage and insurance analysts (tract-level risk and fair-lending files), CRM and lead-list cleanup (lat/lon + county for routing), political and advocacy groups (address → congressional and legislative district), public-health and academic researchers (address → tract → ACS demographics), retail site selection.

### Input examples

Batch of addresses:

```json
{"addresses": ["233 S Wacker Dr, Chicago, IL 60606", "350 5th Ave, New York, NY 10118"]}
```

Structured records from a spreadsheet:

```json
{"addressRecords": [{"street": "400 Broad St", "city": "Seattle", "state": "WA", "zip": "98109"}]}
```

Reverse geocode points to tract and district:

```json
{"coordinates": ["41.8789, -87.6359", "34.0522, -118.2437"]}
```

2020 Census geographies (for decennial-census joins):

```json
{"addresses": ["1600 Pennsylvania Ave NW, Washington, DC 20500"], "benchmark": "Public_AR_Census2020", "vintage": "Census2020_Census2020"}
```

### Output fields

`inputIndex, input, inputType (address|coordinates), matched, matchedAddress, latitude, longitude, streetNumberRange, matchedCity, matchedState, matchedZip, tigerLineId, side, stateFips, stateCode, stateName, countyFips, countyName, placeName, placeGeoid, countySubdivision, censusTract, censusTractName, blockGroup, censusBlock, zcta, congressionalDistrict, congressionalDistrictGeoid, stateSenateDistrict, stateHouseDistrict, metroArea, cbsaCode, combinedStatisticalArea, schoolDistrict, urbanArea, alternativeMatches, note, benchmark, retrievedAt`

Real samples are in `samples/`.

### Accuracy notes

The Census Geocoder interpolates along TIGER street address ranges, so the point sits on the street segment, not the rooftop. It covers the 50 states, DC and Puerto Rico. PO boxes, rural routes and brand-new streets may not match. Adding the ZIP code helps. Throughput is roughly 10-25 addresses per second.

### Pricing

Pay per matched address or point (`address-geocoded` event). Unmatched inputs are free. Cap spend with **Max results**.

### Notes

Not affiliated with the US Census Bureau. This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau.

# Actor input Schema

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

US street addresses as one line, e.g. '233 S Wacker Dr, Chicago, IL 60606'. Including the ZIP or city + state improves matches.

## `addressRecords` (type: `array`):

Alternative input: \[{"street": "233 S Wacker Dr", "city": "Chicago", "state": "IL", "zip": "60606"}]

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

Points to look up, e.g. '41.8789, -87.6359'. Returns county, tract, block, districts for each point.

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

County, place, census tract, block group, block, ZCTA, metro area, congressional and state legislative districts, school district. Untick for coordinates only (slightly faster).

## `matchedOnly` (type: `boolean`):

By default unmatched inputs are also saved (free) so you can fix them.

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

Which Census address-range release to match against.

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

Must fit the benchmark. Current benchmark: Current_Current (default), Census2020_Current, ACS2025_Current, ACS2026_Current. Census 2020 benchmark: Census2020_Census2020.

## `maxConcurrency` (type: `integer`):

Parallel requests to the Census Geocoder.

## `maxResults` (type: `integer`):

You are charged per matched address or point.

## Actor input object example

```json
{
  "addresses": [
    "1600 Pennsylvania Ave NW, Washington, DC 20500",
    "233 S Wacker Dr, Chicago, IL 60606",
    "350 5th Ave, New York, NY 10118",
    "400 Broad St, Seattle, WA 98109",
    "this is not an address"
  ],
  "includeGeographies": true,
  "matchedOnly": false,
  "benchmark": "Public_AR_Current",
  "vintage": "Current_Current",
  "maxConcurrency": 8,
  "maxResults": 10000
}
```

# Actor output Schema

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

One item per input address or coordinate pair. Opens the Overview view by default; the dataset contains all fields.

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

JSON record with counts for this run (RUN_SUMMARY in the default key-value store).

# 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",
        "233 S Wacker Dr, Chicago, IL 60606",
        "350 5th Ave, New York, NY 10118",
        "400 Broad St, Seattle, WA 98109",
        "this is not an address"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("clever_firebox/us-census-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",
        "233 S Wacker Dr, Chicago, IL 60606",
        "350 5th Ave, New York, NY 10118",
        "400 Broad St, Seattle, WA 98109",
        "this is not an address",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("clever_firebox/us-census-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",
    "233 S Wacker Dr, Chicago, IL 60606",
    "350 5th Ave, New York, NY 10118",
    "400 Broad St, Seattle, WA 98109",
    "this is not an address"
  ]
}' |
apify call clever_firebox/us-census-geocoder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,clever_firebox/us-census-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/0bARo4fdAg3l0Xn6g/builds/25amjR3x1pKKptIEt/openapi.json
