# US Census ACS Data Scraper — Demographics by Zip & County (`copious_atoll/census-acs-data`) Actor

Extract US Census American Community Survey data. Get population, median income, home values, poverty rates by state, county, or zip code. Free Census API, no proxy needed.

- **URL**: https://apify.com/copious\_atoll/census-acs-data.md
- **Developed by:** [Grim R](https://apify.com/copious_atoll) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## US Census ACS Data Scraper

Extract American Community Survey (ACS) 5-year estimates from the US Census Bureau. Get population, median household income, home values, poverty rates, rent, and dozens of other demographic variables by state, county, or zip code. Powered by the free Census Bureau API — no proxy or authentication needed.

> **Disclaimer:** This actor is unofficial and is not affiliated with, sponsored by, or endorsed by the United States Census Bureau or the Department of Commerce.

### What Census data can you extract?

This actor wraps the free Census Bureau ACS 5-Year Estimates API to extract demographic and economic data for any geography in the United States. Common variables include:

- **Total population** (B01001\_001E) — population count for any area
- **Median household income** (B19013\_001E) — income in the past 12 months
- **Median home value** (B25077\_001E) — owner-occupied housing values
- **Median age** (B01002\_001E) — median age of the population
- **Poverty count** (B17001\_002E) — population below poverty level
- **Median gross rent** (B25064\_001E) — monthly rent amounts

The Census Bureau publishes thousands of variables covering demographics, economics, housing, education, and more.

### Input parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| Geography Level | select | `state` for all US states, `county` for counties in a state, `zip` for zip codes in a state |
| State FIPS Code | string | Two-digit state code (06=California, 36=New York, 48=Texas). Required for county/zip. |
| Census Variables | string | Comma-separated variable codes (e.g., NAME,B01001\_001E,B19013\_001E) |
| ACS Year | string | Survey year (most recent is typically 2 years prior to current year) |
| Max Results | integer | Maximum areas to return (1–5,000, default 100) |

### Output example

Each record in the output contains:

```json
{
    "name": "Los Angeles County, California",
    "totalPopulation": 9829544,
    "medianHouseholdIncome": 76367,
    "medianHomeValue": 654900,
    "medianAge": 36.7,
    "stateCode": "06",
    "countyCode": "037",
    "source": "US Census Bureau ACS 5-Year Estimates",
    "sourceUrl": "https://data.census.gov/"
}
```

### How much does it cost to scrape Census data?

This actor uses **pay-per-event pricing**. You pay per geographic area returned.

- **$0.00005 per actor start** (Apify default)
- **Per-result charge** based on the number of areas extracted
- **No proxy costs** — the Census API is free and public

A county-level query for one state typically returns 30-250 records. A zip-level query can return 1,000+ records.

**Tip:** Use the `maxResults` parameter and specific state codes to control costs.

### Who uses Census ACS data?

- **Real estate investors** — analyze demographics, income levels, and home values to identify target markets
- **Site selection analysts** — evaluate population density, income, and housing for retail or office locations
- **Marketing agencies** — build audience profiles and geographic targeting based on demographics
- **Urban planners** — study population trends, housing, and poverty for municipal planning
- **Academic researchers** — access standardized demographic data for social science and economics studies
- **Insurance companies** — assess risk profiles based on population characteristics and property values

### Tips for best results

- **Find variable codes** at the Census API variable list: https://api.census.gov/data/2022/acs/acs5/variables.html — search for specific topics.
- **State FIPS codes**: 06=CA, 36=NY, 48=TX, 12=FL, 17=IL, 42=PA. Full list at census.gov.
- **Zip code queries** return ZCTA (Zip Code Tabulation Areas) which closely match but do not exactly equal USPS zip codes.
- **Negative values** (like -666666666) indicate the Census Bureau suppressed the estimate due to insufficient sample size.
- **The 5-year ACS** is the most reliable estimate, covering all geographies. 1-year estimates only cover areas with 65,000+ population.

### Integrations

Export your data as JSON, CSV, or Excel. Schedule annual runs when new ACS data is released. Use webhooks to trigger updates to your analytics pipeline.

This actor works as an **MCP server** — AI agents can discover and use it to access Census demographics programmatically.

# Actor input Schema

## `geography` (type: `string`):

Geographic level to query: 'state' for all US states, 'county' for counties within a state, or 'zip' for zip codes within a state.

## `stateCode` (type: `string`):

Two-digit FIPS state code (e.g., 06 for California, 36 for New York, 48 for Texas). Required for county and zip geography. See full list: https://www.census.gov/library/reference/code-lists/ansi.html

## `variables` (type: `string`):

Comma-separated Census variable codes. Common: B01001\_001E (population), B19013\_001E (median income), B25077\_001E (median home value), B01002\_001E (median age), B17001\_002E (poverty count).

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

American Community Survey year (5-year estimates). Most recent available is typically 2 years prior to current year.

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

Maximum number of geographic areas to return.

## Actor input object example

```json
{
  "geography": "county",
  "stateCode": "06",
  "variables": "NAME,B01001_001E,B19013_001E,B25077_001E,B01002_001E",
  "year": "2022",
  "maxResults": 100
}
```

# 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 = {
    "geography": "county",
    "stateCode": "06",
    "variables": "NAME,B01001_001E,B19013_001E,B25077_001E,B01002_001E",
    "year": "2022",
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("copious_atoll/census-acs-data").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 = {
    "geography": "county",
    "stateCode": "06",
    "variables": "NAME,B01001_001E,B19013_001E,B25077_001E,B01002_001E",
    "year": "2022",
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("copious_atoll/census-acs-data").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 '{
  "geography": "county",
  "stateCode": "06",
  "variables": "NAME,B01001_001E,B19013_001E,B25077_001E,B01002_001E",
  "year": "2022",
  "maxResults": 100
}' |
apify call copious_atoll/census-acs-data --silent --output-dataset

```

## MCP server setup

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

```

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/4SRbO1IScE3iy6RIj/builds/xnAjREnFjbG2YFBLY/openapi.json
