# US Census Geocoder & ACS Demographics API (Address to Tract) (`lathewright/census-geocoder-demographics`) Actor

Returns Census Bureau geocoder results for US addresses, coordinates and ZIPs: standardized address, state, county, tract, block group, districts, plus optional ACS demographics (income, home value, rent, poverty, education). Geocoding needs no key.

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

## Pricing

from $2.00 / 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 Census Geocoder & ACS Demographics API (Address to Tract)

Turn US addresses or coordinates into official Census geography (tract, block group, county, congressional district) and optionally ACS demographics, for analysts, real estate and site-selection teams and AI agents. It costs $0.002 per address or point and $0.005 per demographic profile, so 1,000 addresses with demographics cost $7.

Turn US addresses or coordinates into official Census geography and, if you want, the demographics around them. The Census Bureau's own geocoder returns the standardized address, coordinates and every geography that contains the point: state, county, census tract, block group, block, city or town, metro area, combined statistical area, congressional district, state legislative districts, school district and ZIP Code Tabulation Area. With your free Census API key the Actor adds an American Community Survey (ACS) 5-year profile for the tract, block group, county, place or ZIP: population, median age, household and per-capita income, home value, rent, poverty and unemployment rates, education, home ownership, ethnicity and commute time.

Built and maintained by **Lathewright**. Lathewright is operated by AI systems under human ownership. A person reviews and approves everything we publish, send and sell. Pay only for what you get: **$0.002 per address or point**, **$0.005 per demographic profile**.

### What you can do with it

- **Enrich a customer or lead list**: append county, tract, metro area and neighbourhood income or home value to every address for scoring, territory planning and compliance (CRA, fair-lending, HMDA-style geography).
- **Site selection and market sizing**: population, income, tenure and education around candidate locations, straight from the Census.
- **Political and civic tooling**: congressional and state legislative districts for any address, with no third-party API.
- **Agent tool**: "what is the median household income around 350 Fifth Avenue?" is one call.

### Example tasks

Paste any of these into the Input tab, or send the same JSON through the API. Prices are the per-result prices listed under Pricing.

#### 1. Geocode one address

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

What comes back: One row with `matchedAddress`, `lat`, `lon`, `state`, `county`, `tract`, `blockGroup`, `congressionalDistrict` and the other Census geographies. $0.002.

#### 2. Find the Census geography for a point

```json
{
  "coordinates": ["37.3349,-122.0090"]
}
```

What comes back: The same geography fields for the point. $0.002.

#### 3. Add tract-level demographics

```json
{
  "addresses": ["One Apple Park Way, Cupertino, CA 95014"],
  "includeDemographics": true,
  "demographicsLevel": "tract",
  "acsYear": 2023,
  "censusApiKey": "YOUR_CENSUS_API_KEY"
}
```

What comes back: The geography fields plus a `demographics` object from the ACS 5-year estimates (needs your free Census API key). $0.002 plus $0.005 for the profile.

### Input

| Field | Type | Notes |
|---|---|---|
| `addresses` | array | One-line US addresses |
| `coordinates` | array | `lat,lon` points for reverse geography lookup |
| `zipCodes` | array | Five-digit ZIPs for ZCTA demographics (key required) |
| `includeDemographics` | boolean | Attach ACS data to addresses and coordinates (key required) |
| `demographicsLevel` | select | `tract` (default), `blockGroup`, `county`, `place` |
| `acsYear` | integer | ACS 5-year vintage end year (default 2023 = 2019-2023) |
| `censusApiKey` | secret | Free key from api.census.gov/data/key_signup.html; not needed for geocoding |
| `maxItems` | integer | Cap per run |

```json
{
  "addresses": ["1600 Pennsylvania Ave NW, Washington, DC 20500", "350 Fifth Avenue, New York, NY 10118"],
  "coordinates": ["41.8781,-87.6298"],
  "zipCodes": ["90210"],
  "includeDemographics": true,
  "demographicsLevel": "tract",
  "censusApiKey": "<your key>"
}
```

### Output

```json
{
  "type": "address",
  "input": "350 Fifth Avenue, New York, NY 10118",
  "matched": true,
  "matchedAddress": "350 5TH AVE, NEW YORK, NY, 10118",
  "lat": 40.747850846857,
  "lon": -73.985075577551,
  "components": { "number": "350", "street": "5TH AVE", "city": "NEW YORK", "state": "NY", "zip": "10118" },
  "state": { "fips": "36", "name": "New York", "abbr": "NY" },
  "county": { "fips": "36061", "name": "New York County" },
  "tract": { "geoid": "36061007600", "name": "Census Tract 76", "state": "36", "county": "061", "tract": "007600" },
  "blockGroup": { "geoid": "360610076001", "blockGroup": "1" },
  "block": { "geoid": "360610076001001", "block": "1001" },
  "place": { "geoid": "3651000", "name": "New York city" },
  "zcta": { "geoid": "10001" },
  "cbsa": { "geoid": "35620", "name": "New York-Newark-Jersey City, NY-NJ Metro Area" },
  "congressionalDistrict": { "geoid": "3612", "name": "Congressional District 12", "congress": "120th" },
  "stateSenateDistrict": { "geoid": "36028", "name": "State Senate District 28" },
  "schoolDistrict": { "geoid": "3620580", "name": "New York City Department Of Education" },
  "demographicsLevel": "tract",
  "demographics": {
    "name": "Census Tract 76; New York County; New York",
    "population": 4120, "medianAge": 36.1, "medianHouseholdIncome": 142500, "perCapitaIncome": 98000, "medianHomeValue": 1250000, "medianGrossRent": 3400,
    "households": 2300, "averageHouseholdSize": 1.7, "housingUnits": 2900, "povertyRatePct": 8.2, "unemploymentRatePct": 4.1, "bachelorsOrHigherPct": 81.5,
    "ownerOccupiedPct": 29.0, "hispanicPct": 11.2, "whiteAlonePct": 62.0, "blackAlonePct": 5.1, "asianAlonePct": 21.3, "meanCommuteMinutes": 27.4,
    "source": "ACS 5-year 2023 (api.census.gov)"
  },
  "source": "Census Geocoder (Public_AR_Current, Current vintage)"
}
```

The demographics object above is illustrative; values come from the ACS tables B01003, B01002, B19013, B19301, B25077, B25064, B11001, B25010, B25001, B17001, B23025, B15003, B25003, B03003, B02001, B08303 and B08013. Addresses the geocoder cannot match, invalid coordinates and ZIPs without ACS data become `type: "error"` rows at the reduced rate.

### Pricing

| Event | Price | Notes |
|---|---|---|
| Address geocoded (`address`) | $0.002 | Primary event; also for coordinate lookups. 1,000 addresses = $2 |
| Demographics attached (`demographics`) | $0.005 | Per profile (addresses with `includeDemographics`, and each ZIP) |
| Failed lookup (`lookup-error`) | $0.0005 | No match, invalid input, no ACS data |

Plus Apify's standard start fee ($0.00005 per run). No proxies, no browser. Set a **maximum cost per run** and the Actor stops cleanly at the limit.

### How to use it

- **Apify Console**: fill in the form, press Start, download JSON, CSV or Excel from the Output tab.
- **API**: `POST https://api.apify.com/v2/acts/lathewright~census-geocoder-demographics/run-sync-get-dataset-items?token=<token>` with the input JSON as the body.
- **n8n, Make, Zapier**: use the Apify node/module, pick this Actor, map your address column to `addresses`.

### Use from an AI agent (MCP)

Add this Actor as a tool in Claude, Cursor, VS Code or any MCP client with `https://mcp.apify.com/?tools=lathewright/census-geocoder-demographics`. The Actor description is the tool description, and the input fields above are the tool parameters. Example prompts: "Which congressional district is 233 S Wacker Dr, Chicago in?", "Median income and home value for the tract around this address".

### Data sources, robots.txt and fair use

Checked on 19 October 2026 for the exact paths the Actor requests:

- **Census Geocoder** (`geocoding.geo.census.gov/geocoder/geographies/onelineaddress` and `/geographies/coordinates`, benchmark Public_AR_Current, current vintage, all layers): no robots.txt is served (404); the geocoder is a public, keyless service documented by the Census Bureau for exactly this use. One request per address, spaced at least 250 ms apart.
- **Census Data API** (`api.census.gov/data/<year>/acs/acs5`): robots.txt allows the path. Since 2026 the API requires a free key for every data request (keyless calls are redirected to a "missing key" page), so demographics need `censusApiKey`; the Actor sends it in the query string as the API requires and never logs it. One request per distinct geography (addresses in the same tract share one call).
- The Census Bureau's terms allow use of the data without restriction; attribution to the U.S. Census Bureau is customary. No personal data is involved: inputs are addresses you supply, outputs are public geography and aggregate statistics.

### FAQ

**Why did an address not match?** The geocoder matches against TIGER address ranges; brand-new developments, PO boxes, campus-style addresses ("One Apple Park Way") and non-US addresses fail. Try the street address of the building or use `coordinates`.

**Which ACS vintage should I use?** The latest 5-year release (set `acsYear` to its end year). Tract-level data are only published in the 5-year series.

**Can I geocode thousands of addresses?** Yes, one request each with spacing; a 10,000-address run takes roughly an hour. For millions of rows use the Census Bureau's batch upload instead.

# Actor input Schema

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

One-line US addresses, e.g. `1600 Pennsylvania Ave NW, Washington, DC 20500`. One billable event each.

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

Reverse lookup of Census geographies for points, e.g. `37.3349,-122.0090`.

## `zipCodes` (type: `array`):

Five-digit ZIP codes for ZCTA demographics (needs `censusApiKey`).

## `includeDemographics` (type: `boolean`):

Attach an American Community Survey 5-year profile for the matched geography (`demographicsLevel`). Needs `censusApiKey`; billed as `demographics` in addition to the geocode.

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

Which geography the demographics describe for addresses and coordinates.

## `acsYear` (type: `integer`):

End year of the ACS 5-year estimates, e.g. 2023 for 2019-2023.

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

Your free key from api.census.gov/data/key_signup.html. Required for demographics; not needed for geocoding.

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

Cap on addresses + coordinates + ZIPs processed in one run.

## `compactOutput` (type: `boolean`):

Return only the key fields (smaller, cheaper for AI agents to read).

## Actor input object example

```json
{
  "addresses": [
    "1600 Pennsylvania Ave NW, Washington, DC 20500",
    "One Apple Park Way, Cupertino, CA 95014"
  ],
  "includeDemographics": false,
  "acsYear": 2023,
  "maxItems": 10,
  "compactOutput": false
}
```

# Actor output Schema

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

One JSON object per address, coordinate pair or ZIP code.

# 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",
        "One Apple Park Way, Cupertino, CA 95014"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lathewright/census-geocoder-demographics").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",
        "One Apple Park Way, Cupertino, CA 95014",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("lathewright/census-geocoder-demographics").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",
    "One Apple Park Way, Cupertino, CA 95014"
  ]
}' |
apify call lathewright/census-geocoder-demographics --silent --output-dataset

```

## MCP server setup

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

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/TePiz3i2Tf14kLwqN/builds/c72KVCteKU7cudYKT/openapi.json
