# U.S. Census County & ZIP Business Patterns Scraper (`logiover/us-census-county-business-patterns-scraper`) Actor

Keyless bulk export of official Census County and ZIP Code Business Patterns by geography, NAICS, establishments, employment, payroll and company-size bands. Built for site selection, market sizing, sales planning and economic research.

- **URL**: https://apify.com/logiover/us-census-county-business-patterns-scraper.md
- **Developed by:** [Logiover](https://apify.com/logiover) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 results

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 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

## U.S. Census County & ZIP Business Patterns Scraper

Export official U.S. Census Bureau County Business Patterns (CBP) and ZIP Code Business Patterns (ZBP) without a Census API key. Choose county, state, ZIP totals or ZIP-by-industry detail and receive analysis-ready establishment, employment, payroll and business-size data.

The Actor streams Census bulk ZIP files and enriches codes with official county and NAICS descriptions. It avoids the API-key requirement that applies to many Census API requests and can process large source files within a 512 MB Actor.

### Use cases

- Market sizing and sales-territory planning by industry and geography.
- Retail, logistics, franchise and commercial real-estate site selection.
- Local business-density and employment analysis.
- Industry concentration and regional economic dashboards.
- B2B total-addressable-market estimation by employee-size band.

### Geography modes

| Mode | Grain and scale |
| --- | --- |
| `county` | State + county + NAICS detail; the current uncompressed file exceeds 100 MB. |
| `state` | State + NAICS + legal form of organization. |
| `zipTotals` | One summarized record per ZIP with city, state and county labels. |
| `zipIndustry` | ZIP + NAICS detail; the current compressed source is roughly 284 MB. |

### Input

Use `latest` to automatically resolve the most recent Census reference year. Filter by state/county FIPS, ZIP prefix, NAICS prefix, legal form, establishments, employment or annual payroll. `maxResults` supports up to 500,000 records per run.

```json
{
  "year": "latest",
  "geographyLevel": "county",
  "stateFips": ["06", "48"],
  "naicsPrefixes": ["72"],
  "minEstablishments": 10,
  "minEmployment": 100,
  "maxResults": 50000
}
```

### Output

One item is one year–geography–industry cell, with the fields available for the selected source mode.

```json
{
  "dataYear": 2023,
  "geographyLevel": "county",
  "stateFips": "01",
  "fullCountyFips": "01001",
  "countyName": "Autauga County, Alabama",
  "naicsCode": "11----",
  "naicsDescription": "Agriculture, Forestry, Fishing and Hunting",
  "establishments": 10,
  "employment": 50,
  "annualPayrollThousands": 2945
}
```

Payroll fields preserve the Census source unit of thousands of dollars. `minAnnualPayroll` accepts normal dollars and converts before comparison. Noise flags and source links remain available for auditability.

### Scale and performance

Files are downloaded, decompressed and parsed as streams. The Actor stops the upstream transfer when it reaches the requested limit instead of loading the full file. Segment more than 500,000 results by year, state, county, ZIP or NAICS.

### API and integrations

Run through Apify Console, REST API, JavaScript, Python or MCP. Export JSON, JSONL, CSV, Excel, XML and RSS and connect schedules, webhooks, Make, Zapier, Sheets, warehouses and BI tools.

```bash
curl -X POST "https://api.apify.com/v2/acts/logiover~us-census-county-business-patterns-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"geographyLevel":"zipIndustry","zipPrefixes":["90"],"maxResults":10000}'
```

### FAQ

**Does it require a Census API key?** No; it uses official downloadable files.

**What does empty input do?** It discovers the latest reference year and exports county industry-detail records.

**Are these individual business leads?** No. CBP publishes aggregate counts by geography and industry, not company names.

**Why is employment or payroll sometimes null?** Census disclosure protection can suppress or noise-infuse values. Flags are preserved.

**Can I get hundreds of thousands of rows?** Yes. County and ZIP industry files contain a large result pool; each run supports 500,000 output items.

### Responsible use

This Actor is not affiliated with or endorsed by the Census Bureau. CBP is aggregate statistical data and reference years are released with a lag. Preserve disclosure context when interpreting small cells.

### Changelog

#### 2026-08-05

- Initial keyless Census CBP/ZBP bulk exporter.
- Added latest-release discovery, four geography modes, official reference enrichment and streaming ZIP parsing.
- Verified live default, filtered and bulk behavior.

# Actor input Schema

## `year` (type: `string`):

Use latest or a four-digit reference year from 1986 onward.

## `geographyLevel` (type: `string`):

County and ZIP Industry provide NAICS detail; ZIP Totals provides one summary row per ZIP.

## `stateFips` (type: `array`):

Two-digit state FIPS codes such as 06 for California or 48 for Texas.

## `countyFips` (type: `array`):

Five-digit state+county FIPS codes, for example 06037 for Los Angeles County.

## `zipPrefixes` (type: `array`):

Match one or more full ZIP codes or ZIP prefixes.

## `naicsPrefixes` (type: `array`):

Industry prefixes such as 72, 541 or 621. Not used by ZIP Totals.

## `legalFormCodes` (type: `array`):

Exact Census legal-form-of-organization codes. Primarily available in state data.

## `minEstablishments` (type: `number`):

Only keep geography-industry cells with at least this many establishments.

## `minEmployment` (type: `number`):

Only keep cells with at least this published employment count.

## `minAnnualPayroll` (type: `number`):

Filter using annual payroll converted from the source's thousands-of-dollars unit.

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

Maximum unique Census Business Patterns records saved.

## Actor input object example

```json
{
  "year": "latest",
  "geographyLevel": "county",
  "stateFips": [],
  "countyFips": [],
  "zipPrefixes": [],
  "naicsPrefixes": [],
  "legalFormCodes": [],
  "maxResults": 200
}
```

# 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 = {
    "maxResults": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("logiover/us-census-county-business-patterns-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 = { "maxResults": 200 }

# Run the Actor and wait for it to finish
run = client.actor("logiover/us-census-county-business-patterns-scraper").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 '{
  "maxResults": 200
}' |
apify call logiover/us-census-county-business-patterns-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,logiover/us-census-county-business-patterns-scraper"
        }
    }
}

```

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/AE4aQD9vnbl3HMd1D/builds/DSdh0BjCKfuGp4FoE/openapi.json
