# US Census Geocoder Scraper (`parseforge/uscensus-geocoder-scraper`) Actor

Free US-only geocoding via the official US Census Bureau geocoder. Forward-geocode one-line addresses to latitude/longitude or reverse-geocode coordinates to a matching address. Optionally enrich each match with census tract, block, and county geographies.

- **URL**: https://apify.com/parseforge/uscensus-geocoder-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $11.00 / 1,000 result items

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

![ParseForge Banner](https://github.com/ParseForge/apify-assets/blob/ad35ccc13ddd068b9d6cba33f323962e39aed5b2/banner.jpg?raw=true)

## 📍 US Census Geocoder Scraper

> 🚀 **Geocode US addresses for free in seconds.** Forward-geocode addresses to **latitude / longitude** or reverse-geocode coordinates back to a matching street address using the official US Census Bureau geocoder. Optional enrichment with **census tract, block, and county FIPS codes**. No API key, no per-request fees, no rate-limit surprises.

> 🕒 **Last updated:** 2026-05-23 · **📊 23 fields** per match · **🇺🇸 US-wide coverage** · **↔️ Forward + reverse** · **🏛️ Census tract / block / county enrichment**

The **US Census Geocoder Scraper** wraps the official US Census Bureau geocoder, a fully public address-matching service maintained by the federal government. Each match returns the canonical street address, latitude, longitude, TIGER/Line edge ID, address range, city, state, ZIP, county name and FIPS, state FIPS, and optionally the census tract, block, and block GEOID for downstream demographic joins.

The geocoder covers **every US street address in the TIGER/Line address-range database**, including residential, commercial, and rural-route addresses across all 50 states, DC, and US territories. Use it to bootstrap a lead-enrichment pipeline, append lat/lng to a CRM export, build a "find my representative" map, or attach demographic context to any address list. This Actor returns clean CSV, Excel, JSON, or XML in under five minutes.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| Real-estate platforms, civic-tech developers, marketing teams, US-focused logistics, lead-enrichment SaaS, public-health researchers | Address normalization, CRM enrichment, district mapping, demographic appending, route-planning prep, free geocoding for US addresses |

---

### 📋 What the US Census Geocoder Scraper does

Two geocoding modes in a single Actor:

- ➡️ **Forward (Address → Coordinates).** Resolve one-line addresses to latitude / longitude with the canonical matched-address string.
- ⬅️ **Reverse (Coordinates → Address).** Resolve a lat / lng pair to the closest matching TIGER/Line street segment and address range.

Optional **Census enrichment** appends tract, block, block GEOID, state FIPS, and county FIPS, so each match can immediately join the American Community Survey, Decennial Census, or any tract-keyed federal dataset.

Each record includes the original input query, the canonical matched address, lat/lng, TIGER/Line ID, side of street, from/to address range, street name, suffix, city, state, ZIP, county, FIPS codes, and (when enabled) tract / block / GEOID and the full geographies object.

> 💡 **Why it matters:** the US Census geocoder is one of the few free, no-key, no-quota geocoders covering every US address. Commercial alternatives charge per lookup. Building your own pipeline around the underlying TIGER service means handling batch endpoints, retry logic, and FIPS parsing by hand. This Actor skips all of that.

---

### 🎬 Full Demo

_🚧 Coming soon: a 3-minute walkthrough showing how to go from sign-up to a downloaded geocoded dataset._

---

### ⚙️ Input

<table>
<thead>
<tr><th>Input</th><th>Type</th><th>Default</th><th>Behavior</th></tr>
</thead>
<tbody>
<tr><td>maxItems</td><td>integer</td><td>10</td><td>Records to return. Free plan caps at 10, paid plan at 1,000,000.</td></tr>
<tr><td>mode</td><td>string</td><td>"address"</td><td>address = forward geocode, coordinates = reverse geocode.</td></tr>
<tr><td>addresses</td><td>array of string</td><td>3 sample addresses</td><td>One-line US addresses. Only used when mode = address.</td></tr>
<tr><td>coordinates</td><td>array of {lat, lng}</td><td>2 sample points</td><td>Lat / lng pairs to reverse geocode. Only used when mode = coordinates.</td></tr>
<tr><td>returnGeographies</td><td>boolean</td><td>false</td><td>Enrich each match with census tract, block, and county metadata.</td></tr>
</tbody>
</table>

**Example: forward-geocode three US addresses with census enrichment.**

```json
{
    "maxItems": 50,
    "mode": "address",
    "addresses": [
        "1600 Pennsylvania Ave NW, Washington, DC 20500",
        "350 5th Ave, New York, NY 10118",
        "1 Apple Park Way, Cupertino, CA 95014"
    ],
    "returnGeographies": true
}
````

**Example: reverse-geocode two points.**

```json
{
    "mode": "coordinates",
    "coordinates": [
        { "lat": 38.8977, "lng": -77.0365 },
        { "lat": 40.7484, "lng": -73.9857 }
    ]
}
```

> ⚠️ **Good to Know:** the US Census geocoder covers US addresses only. Non-US addresses, PO boxes, and brand-new addresses (not yet in TIGER/Line) may return no match. The benchmark database is updated periodically by the Census Bureau.

***

### 📊 Output

Each match contains **23 fields** (or 18 without census enrichment). Download the dataset as CSV, Excel, JSON, or XML.

#### 🧾 Schema

| Field | Type | Example |
|---|---|---|
| 🆔 `inputQuery` | string | `"1600 Pennsylvania Ave NW, Washington, DC 20500"` |
| 🎯 `mode` | string | `"address"` |
| 🏷️ `matchedAddress` | string | `"1600 PENNSYLVANIA AVE NW, WASHINGTON, DC, 20500"` |
| 📍 `latitude` | number | `38.898754` |
| 📍 `longitude` | number | `-77.0365427` |
| 🆔 `tigerLineId` | string | null | `"76225813"` |
| 🛣️ `side` | string | null | `"L"` |
| 🏠 `fromAddress` | string | null | `"1600"` |
| 🏠 `toAddress` | string | null | `"1698"` |
| 🛣️ `streetName` | string | null | `"PENNSYLVANIA"` |
| 🏷️ `suffixType` | string | null | `"AVE"` |
| 🏙️ `city` | string | null | `"WASHINGTON"` |
| 🏛️ `state` | string | null | `"DC"` |
| 📮 `zip` | string | null | `"20500"` |
| 🏛️ `countyName` | string | null | `"District of Columbia"` |
| 🆔 `countyFips` | string | null | `"001"` |
| 🆔 `stateFips` | string | null | `"11"` |
| 🧭 `tract` | string | null | `"006202"` |
| 🧭 `block` | string | null | `"1031"` |
| 🆔 `censusBlockGeoid` | string | null | `"110010062021031"` |
| 🗺️ `geographies` | object | null | Full census geographies payload |
| 🕒 `scrapedAt` | ISO 8601 | `"2026-05-23T16:00:00.000Z"` |
| ⚠️ `error` | string | null | only present on failure |

#### 📦 Sample records

<details>
<summary><strong>🏛️ Forward match: The White House</strong></summary>

```json
{
    "inputQuery": "1600 Pennsylvania Ave NW, Washington, DC 20500",
    "mode": "address",
    "matchedAddress": "1600 PENNSYLVANIA AVE NW, WASHINGTON, DC, 20500",
    "latitude": 38.898754,
    "longitude": -77.0365427,
    "tigerLineId": "76225813",
    "side": "L",
    "fromAddress": "1600",
    "toAddress": "1698",
    "streetName": "PENNSYLVANIA",
    "suffixType": "AVE",
    "city": "WASHINGTON",
    "state": "DC",
    "zip": "20500",
    "countyName": "District of Columbia",
    "countyFips": "001",
    "stateFips": "11",
    "tract": "006202",
    "block": "1031",
    "censusBlockGeoid": "110010062021031",
    "geographies": { "Census Blocks": [{ "GEOID": "110010062021031" }] },
    "scrapedAt": "2026-05-23T16:00:00.000Z"
}
```

</details>

<details>
<summary><strong>🗽 Reverse match: Empire State Building coordinates</strong></summary>

```json
{
    "inputQuery": "40.7484, -73.9857",
    "mode": "coordinates",
    "matchedAddress": "350 5TH AVE, NEW YORK, NY, 10118",
    "latitude": 40.7484,
    "longitude": -73.9857,
    "tigerLineId": "59658549",
    "side": "R",
    "fromAddress": "350",
    "toAddress": "358",
    "streetName": "5TH",
    "suffixType": "AVE",
    "city": "NEW YORK",
    "state": "NY",
    "zip": "10118",
    "countyName": "New York",
    "countyFips": "061",
    "stateFips": "36",
    "tract": null,
    "block": null,
    "censusBlockGeoid": null,
    "geographies": null,
    "scrapedAt": "2026-05-23T16:00:00.000Z"
}
```

</details>

<details>
<summary><strong>🍎 Forward match: Apple Park</strong></summary>

```json
{
    "inputQuery": "1 Apple Park Way, Cupertino, CA 95014",
    "mode": "address",
    "matchedAddress": "1 APPLE PARK WAY, CUPERTINO, CA, 95014",
    "latitude": 37.334922,
    "longitude": -122.009033,
    "tigerLineId": "192408641",
    "side": "L",
    "fromAddress": "1",
    "toAddress": "99",
    "streetName": "APPLE PARK",
    "suffixType": "WAY",
    "city": "CUPERTINO",
    "state": "CA",
    "zip": "95014",
    "countyName": "Santa Clara",
    "countyFips": "085",
    "stateFips": "06",
    "tract": "508704",
    "block": "1010",
    "censusBlockGeoid": "060855087041010",
    "geographies": null,
    "scrapedAt": "2026-05-23T16:00:00.000Z"
}
```

</details>

***

### ✨ Why choose this Actor

| | Capability |
|---|---|
| 🇺🇸 | **Full US coverage.** Every address in the TIGER/Line database across 50 states, DC, and territories. |
| ↔️ | **Bidirectional.** Forward (address → coords) and reverse (coords → address) in one Actor. |
| 🏛️ | **Census enrichment.** One toggle adds tract, block, GEOID, and county FIPS for demographic joins. |
| 🆓 | **Free upstream source.** The Census geocoder is no-key, no-quota, no per-request fees. |
| ⚡ | **Fast.** Tens of addresses per minute, batchable across thousands. |
| 🔁 | **Always fresh.** Every run hits the latest published Census benchmark. |
| 🚫 | **No authentication.** No API key, no signup, no rate-limit surprises. |

> 📊 The US Census geocoder underpins federal statistical surveys, FEMA disaster mapping, and many state and city civic-tech platforms.

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Filters | Setup |
|---|---|---|---|---|---|
| **⭐ US Census Geocoder Scraper** *(this Actor)* | $5 free credit, then pay-per-use | **All US addresses** | **Live per run** | forward / reverse / census enrichment | ⚡ 2 min |
| Commercial geocoders | $$$ per 1,000 lookups | Global | Live | Vendor-defined | ⏳ Hours |
| Self-hosted Nominatim | Free | Global, OSM-quality | Manual | None | 🐢 Days |
| Direct Census batch UI | Free | US | Live | Manual CSV | 🕒 Variable |

Pick this Actor when you want free US geocoding with census enrichment, batched server-side and exportable as CSV / Excel / JSON / XML.

***

### 🚀 How to use

1. 📝 **Sign up.** [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes).
2. 🌐 **Open the Actor.** Go to the US Census Geocoder Scraper page on the Apify Store.
3. 🎯 **Set input.** Pick a mode (address or coordinates), list inputs, optionally enable census enrichment.
4. 🚀 **Run it.** Click **Start** and let the Actor collect your data.
5. 📥 **Download.** Grab your results in the **Dataset** tab as CSV, Excel, JSON, or XML.

> ⏱️ Total time from signup to downloaded dataset: **3-5 minutes.** No coding required.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%" valign="top">

#### 🏠 Real Estate & Property Tech

- Append lat/lng to property listings
- Normalize broker-supplied address strings
- Map listings into census tracts for school zoning
- Detect duplicate listings via canonical addresses

</td>
<td width="50%" valign="top">

#### 🎯 Lead Enrichment & CRM

- Geocode CRM exports for territory assignment
- Append county / state FIPS for compliance routing
- Power "addresses near me" search features
- Normalize free-form address inputs to canonical form

</td>
</tr>
<tr>
<td width="50%" valign="top">

#### 🚚 US Logistics & Field Ops

- Pre-geocode delivery manifests before routing
- Reverse-geocode driver GPS pings to nearest address
- Enrich service-area data with county boundaries
- Census-tract context for last-mile analytics

</td>
<td width="50%" valign="top">

#### 📊 Civic Tech & Public Health

- Find-my-representative lookup pipelines
- Disease mapping by census tract
- Equity analyses joining ACS to address lists
- Voter outreach with precinct-adjacent tract context

</td>
</tr>
</table>

***

### 🔌 Automating US Census Geocoder Scraper

Control the scraper programmatically for scheduled runs and pipeline integrations:

- 🟢 **Node.js.** Install the `apify-client` NPM package.
- 🐍 **Python.** Use the `apify-client` PyPI package.
- 📚 See the [Apify API documentation](https://docs.apify.com/api/v2) for full details.

The [Apify Schedules feature](https://docs.apify.com/platform/schedules) lets you trigger this Actor on any cron interval. Nightly batch jobs let you re-geocode incoming leads or property listings on a predictable cadence.

***

### 🌟 Beyond business use cases

Geocoding powers more than commercial workflows. The same structured records support research, education, civic transparency, and personal initiatives.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Public-health studies linking addresses to ACS tract data
- Urban-planning coursework with parcel-level geocoding
- Reproducible social-science research with cited dataset pulls
- GIS workshops on US census geography

</td>
<td width="50%">

#### 🎨 Personal and creative

- Family-history projects mapping ancestor residences
- Personal travel logs with geocoded stops
- Indie real-estate tools for first-time buyers
- Side projects mapping local civic infrastructure

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Non-profit and civic

- Voter-registration outreach mapped to precincts
- Disaster-response address validation for relief orgs
- Investigative journalism on ZIP-code disparities
- Civic-tech dashboards mapping public assets

</td>
<td width="50%">

#### 🧪 Experimentation

- Train address-parsing models on canonical matched output
- Prototype reverse-geocoding agents
- Build "address quality" scoring tools
- Test ETL pipelines with FIPS-enriched joins

</td>
</tr>
</table>

***

### 🤖 Ask an AI assistant about this scraper

Open a ready-to-send prompt about this ParseForge actor in the AI of your choice:

- 💬 [**ChatGPT**](https://chat.openai.com/?q=How%20do%20I%20use%20the%20US%20Census%20Geocoder%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🧠 [**Claude**](https://claude.ai/new?q=How%20do%20I%20use%20the%20US%20Census%20Geocoder%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🔍 [**Perplexity**](https://perplexity.ai/search?q=How%20do%20I%20use%20the%20US%20Census%20Geocoder%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🅒 [**Copilot**](https://copilot.microsoft.com/?q=How%20do%20I%20use%20the%20US%20Census%20Geocoder%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)

***

### ❓ Frequently Asked Questions

#### 🧩 How does it work?

Pick a mode (address or coordinates), list your inputs, optionally enable census enrichment, and click Start. The Actor hits the official US Census Bureau geocoder and emits one structured record per match.

#### 📏 How accurate is the data?

Match quality depends on the address. Clean, well-formatted urban and suburban addresses typically resolve to within a single TIGER/Line address range (within tens of meters). Rural-route and recently built addresses may not match if they are not yet in the TIGER/Line database.

#### 🌎 Does it cover non-US addresses?

No. The Census geocoder is a US-only service. For non-US addresses, look at the Nominatim OSM scraper or a commercial provider.

#### 🏛️ What does census enrichment add?

When `returnGeographies` is enabled, each match includes the census tract, block, block GEOID, state FIPS, and county FIPS for the matched coordinate. This lets you join your data to ACS, Decennial Census, or any tract-keyed dataset.

#### 🔁 How often is the dataset refreshed?

The Census Bureau publishes the geocoder benchmark periodically (typically annually). Every run uses the most recent published benchmark, so your results always reflect the latest TIGER/Line data.

#### ⏰ Can I schedule regular runs?

Yes. Use Apify Schedules to geocode nightly CRM exports or property-listing updates on a predictable cron interval.

#### ⚖️ Is this data legal to use?

Yes. US Census geocoder results derive from public TIGER/Line data, which is in the public domain. You can use, redistribute, and embed results in your own products without restriction.

#### 💼 Can I use this data commercially?

Yes. The underlying TIGER/Line data is public-domain, so commercial use is permitted without licensing fees.

#### 💳 Do I need a paid Apify plan to use this Actor?

No. The free Apify plan is enough for testing and small runs (10 records per run). A paid plan lifts the limit and gives you access to scheduling, higher concurrency, and larger datasets.

#### 🔁 What happens if a run fails or gets interrupted?

Apify automatically retries transient errors. If a run still fails, you can inspect the log in the Runs tab, fix the input, and re-run. Partial datasets from failed runs are preserved so you never lose progress.

#### 🆘 What if I need help?

Our support team is here to help. Contact us through the Apify platform or use the Tally form linked below.

***

### 🔌 Integrate with any app

US Census Geocoder Scraper connects to any cloud service via [Apify integrations](https://apify.com/integrations):

- [**Make**](https://docs.apify.com/platform/integrations/make) - Automate multi-step workflows
- [**Zapier**](https://docs.apify.com/platform/integrations/zapier) - Connect with 5,000+ apps
- [**Slack**](https://docs.apify.com/platform/integrations/slack) - Get run notifications in your channels
- [**Airbyte**](https://docs.apify.com/platform/integrations/airbyte) - Pipe geocoded addresses into your warehouse
- [**GitHub**](https://docs.apify.com/platform/integrations/github) - Trigger runs from commits and releases
- [**Google Drive**](https://docs.apify.com/platform/integrations/drive) - Export datasets straight to Sheets

You can also use webhooks to trigger downstream actions when a run finishes. Push geocoded leads straight into your CRM, or fan results out to a downstream district-mapping service.

***

### 🔗 Recommended Actors

- [**🗺️ Nominatim OSM Scraper**](https://apify.com/parseforge/nominatim-osm-scraper) - Global geocoding via OpenStreetMap
- [**🏛️ FEC Campaign Finance Scraper**](https://apify.com/parseforge/fec-campaign-finance-scraper) - US federal donor data
- [**📊 ACS Census Scraper**](https://apify.com/parseforge/acs-census-scraper) - American Community Survey demographic data
- [**🏠 Zillow Scraper**](https://apify.com/parseforge/zillow-scraper) - US real-estate listings and home values
- [**📮 USPS ZIP Lookup Scraper**](https://apify.com/parseforge/usps-zip-lookup-scraper) - US ZIP code validation

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more reference-data scrapers.

***

**🆘 Need Help?** [**Open our contact form**](https://tally.so/r/BzdKgA) to request a new scraper, propose a custom data project, or report an issue.

***

> **⚠️ Disclaimer:** this Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by the US Census Bureau or the US Department of Commerce. All trademarks mentioned are the property of their respective owners. Only publicly available US Census geocoder results are collected.

# Actor input Schema

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

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## `mode` (type: `string`):

address = forward geocode one-line addresses to lat/lng. coordinates = reverse geocode a lat/lng pair to the closest matching address.

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

List of US one-line addresses to geocode. Example: '1600 Pennsylvania Ave NW, Washington, DC 20500'. Used only when mode = address.

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

List of {lat, lng} pairs to reverse geocode. Used only when mode = coordinates.

## `returnGeographies` (type: `boolean`):

If enabled, each match is enriched with the surrounding census tract, block, and county polygon IDs.

## Actor input object example

```json
{
  "maxItems": 10,
  "mode": "address",
  "addresses": [
    "1600 Pennsylvania Ave NW, Washington, DC 20500",
    "350 5th Ave, New York, NY 10118",
    "1 Apple Park Way, Cupertino, CA 95014"
  ],
  "coordinates": [
    {
      "lat": 38.8977,
      "lng": -77.0365
    },
    {
      "lat": 40.7484,
      "lng": -73.9857
    }
  ],
  "returnGeographies": false
}
```

# Actor output Schema

## `overview` (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 = {
    "maxItems": 10,
    "mode": "address",
    "addresses": [
        "1600 Pennsylvania Ave NW, Washington, DC 20500",
        "350 5th Ave, New York, NY 10118",
        "1 Apple Park Way, Cupertino, CA 95014"
    ],
    "coordinates": [
        {
            "lat": 38.8977,
            "lng": -77.0365
        },
        {
            "lat": 40.7484,
            "lng": -73.9857
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/uscensus-geocoder-scraper").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 = {
    "maxItems": 10,
    "mode": "address",
    "addresses": [
        "1600 Pennsylvania Ave NW, Washington, DC 20500",
        "350 5th Ave, New York, NY 10118",
        "1 Apple Park Way, Cupertino, CA 95014",
    ],
    "coordinates": [
        {
            "lat": 38.8977,
            "lng": -77.0365,
        },
        {
            "lat": 40.7484,
            "lng": -73.9857,
        },
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/uscensus-geocoder-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxItems": 10,
  "mode": "address",
  "addresses": [
    "1600 Pennsylvania Ave NW, Washington, DC 20500",
    "350 5th Ave, New York, NY 10118",
    "1 Apple Park Way, Cupertino, CA 95014"
  ],
  "coordinates": [
    {
      "lat": 38.8977,
      "lng": -77.0365
    },
    {
      "lat": 40.7484,
      "lng": -73.9857
    }
  ]
}' |
apify call parseforge/uscensus-geocoder-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parseforge/uscensus-geocoder-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "US Census Geocoder Scraper",
        "description": "Free US-only geocoding via the official US Census Bureau geocoder. Forward-geocode one-line addresses to latitude/longitude or reverse-geocode coordinates to a matching address. Optionally enrich each match with census tract, block, and county geographies.",
        "version": "1.0",
        "x-build-id": "1gG5W5RS5D5OFVmev"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~uscensus-geocoder-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-uscensus-geocoder-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/parseforge~uscensus-geocoder-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-uscensus-geocoder-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/parseforge~uscensus-geocoder-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-uscensus-geocoder-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
                    },
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "address",
                            "coordinates"
                        ],
                        "type": "string",
                        "description": "address = forward geocode one-line addresses to lat/lng. coordinates = reverse geocode a lat/lng pair to the closest matching address."
                    },
                    "addresses": {
                        "title": "Addresses",
                        "uniqueItems": false,
                        "type": "array",
                        "description": "List of US one-line addresses to geocode. Example: '1600 Pennsylvania Ave NW, Washington, DC 20500'. Used only when mode = address.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "coordinates": {
                        "title": "Coordinates",
                        "type": "array",
                        "description": "List of {lat, lng} pairs to reverse geocode. Used only when mode = coordinates."
                    },
                    "returnGeographies": {
                        "title": "Return Census Geographies",
                        "type": "boolean",
                        "description": "If enabled, each match is enriched with the surrounding census tract, block, and county polygon IDs.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
