# US ZIP / ZCTA County & District Lookup (`factrelay/us-zip-zcta-jurisdiction-lookup`) Actor

Look up a US ZIP code or ZIP+4 to Census ZCTA county, county FIPS, state, and 119th Congressional District mappings. Supports batch ZIP lookup, structured output, overlap percentages, and optional Census tracts.

- **URL**: https://apify.com/factrelay/us-zip-zcta-jurisdiction-lookup.md
- **Developed by:** [Liou](https://apify.com/factrelay) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 completed jurisdiction lookups

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

Paste a US ZIP code or ZIP+4 and get a structured Census geography result with county, county FIPS, state, and 119th Congressional District mappings. This is designed for both quick manual checks and API or batch workflows.

**Quick example:** `90210` returns Los Angeles County, county FIPS `06037`, plus every supported congressional-district relationship. ZIP+4 such as `90210-1234` is accepted and normalized automatically.

### US ZIP code to county and FIPS lookup

Use this Actor when you need a ZIP code county lookup, ZIP to county conversion, county FIPS lookup, or a structured Census ZCTA mapping. Results include state name and FIPS, county names and FIPS codes, overlap percentages, and a primary county selected by the largest supported land-area overlap.

For ZIP codes that intersect more than one county, the full county relationship list remains available instead of silently collapsing the result to one county.

### ZIP code to congressional district lookup

The result includes all supported 119th Congressional District intersections for the matching Census ZCTA and a primary district selected by the largest supported land-area overlap. This makes the Actor useful for congressional district lookup, district routing, civic-data enrichment, territory analysis, and jurisdiction matching.

The primary county and district fields are convenience mappings. Full relationship arrays stay available for multi-county or multi-district ZCTAs.

### ZIP lookup API and batch input

Single lookup is the default. For bulk work, paste one ZIP code per line, up to 10,000 values. Normalized duplicates reuse the first completed lookup and are not charged twice in the same run.

Structured Dataset output can be consumed directly from Apify or through the Dataset API. Optional Census tract intersections are available when deeper geography detail is required.

### Quick start

1. Paste a ZIP code such as `90210`.
2. Click **Start**.
3. Read the county, county FIPS, and district fields in the Dataset overview.
4. Open the full row only when you need every relationship or source detail.

### Important Census ZCTA scope

This Actor uses U.S. Census ZIP Code Tabulation Area (ZCTA) statistical geography. A ZCTA is not the exact USPS delivery boundary for a ZIP Code, and some USPS ZIP Codes do not have a matching ZCTA. A `NOT_FOUND` result means the packaged Census relationship data has no matching ZCTA; it is not a postal-address validity judgment.

### Billing policy

A completed `SUCCESS` lookup or confirmed ZCTA `NOT_FOUND` lookup is one completed event. Invalid input is not a completed billable lookup. Duplicate normalized values within the same run reuse the first result and are not charged a second time.

### Data source and independence

The packaged snapshot is built from published U.S. Census Bureau relationship files and runs offline after deployment, so normal lookups do not depend on a live government API, browser session, proxy, or login.

This is an independent data tool. It is not affiliated with, endorsed by, or operated by the U.S. Census Bureau or USPS. Source references are included in each result.

# Actor input Schema

## `zip_code` (type: `string`):

Paste 4 or 5 ZIP digits, or ZIP+4. Results use Census ZCTA geography, not USPS address validation.

## `zip_codes` (type: `array`):

Paste one value per line, up to 10,000. Duplicates are reused and not charged twice in the same run.

## `include_tracts` (type: `boolean`):

Add all Census tract intersections. Leave off for smaller, faster-to-read results.

## Actor input object example

```json
{
  "zip_code": "90210",
  "include_tracts": false
}
```

# 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 = {
    "zip_code": "90210"
};

// Run the Actor and wait for it to finish
const run = await client.actor("factrelay/us-zip-zcta-jurisdiction-lookup").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 = { "zip_code": "90210" }

# Run the Actor and wait for it to finish
run = client.actor("factrelay/us-zip-zcta-jurisdiction-lookup").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 '{
  "zip_code": "90210"
}' |
apify call factrelay/us-zip-zcta-jurisdiction-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,factrelay/us-zip-zcta-jurisdiction-lookup"
        }
    }
}

```

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/67fDCDAsGbmH1eXrp/builds/UUE9QaivMgsrSCj3J/openapi.json
