# Us Census Acs Demographics Scraper (`coder_zoro/us-census-acs-demographics-scraper`) Actor

This Actor collects official U.S. Census Bureau American Community Survey (ACS) demographic, socioeconomic, and housing statistics by state, county, ZIP code, city, metro area, or census tract. It extracts total population, median household income, median age, poverty rates, educational attainment.

- **URL**: https://apify.com/coder_zoro/us-census-acs-demographics-scraper.md
- **Developed by:** [Zoro](https://apify.com/coder_zoro) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 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/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 ACS Demographics Scraper — State and County Population, Income, and Housing Data

![US Census ACS Demographics Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/us-census-acs-demographics-scraper-cover.png)

Collect demographic statistics from the U.S. Census Bureau's American Community Survey (ACS). Select state or county geography, choose an ACS year and demographic measures, and export structured records for research, geographic comparisons, and data analysis.

### Overview

The US Census ACS Demographics Scraper collects publicly available American Community Survey (ACS) demographic estimates for selected U.S. states and counties.

The actor uses Data USA as its data provider, making ACS demographic information accessible without requiring users to provide credentials.

Each record includes geographic information, ACS release details, and demographic measures such as total population, median household income, median home value, and median age. The original measure values are also available in the `rawMeasures` field.

Users can select geographic areas using state and county FIPS codes and control the maximum number of collected records.

### Features

- Collect state-level demographic records.
- Collect county-level demographic records.
- Optionally restrict county collection to selected states and counties.
- Select an ACS release year or use `latest` for the newest available year.
- Choose between 1-year and 5-year ACS estimates.
- Select specific demographic measures.
- Filter geographic records using state FIPS codes.
- Filter county records using county FIPS codes.
- Control the maximum number of collected records.
- Retrieve structured population, income, housing, and age statistics.
- Export results in JSON, CSV, Excel, and other supported Apify dataset formats.

### Collection Modes

| Mode | Description |
|---|---|
| `state` | Collect demographic records for all available states or only the states specified in `stateFips`. |
| `county` | Collect county-level demographic records. Optionally narrow the results using `stateFips` and `countyFips`. |

### Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `geoLevel` | String | No | Not specified | Geographic collection level: `state` or `county`. |
| `acsEstimate` | String | No | Not specified | ACS estimate type: `5-year` for all supported geographies or `1-year` for larger areas. |
| `year` | String | No | Not specified | ACS release year, such as `2022`, or `latest` to select the newest available year. |
| `measures` | Array of Strings | No | Not specified | Demographic measures to collect: `totalPopulation`, `medianHouseholdIncome`, `medianHomeValue`, and `medianAge`. |
| `stateFips` | Array of Strings | No | Empty | Two-digit state FIPS codes used to restrict geographic results. Leave empty to include all states. |
| `countyFips` | Array of Strings | No | Empty | Three-digit county FIPS codes used in county mode. Leave empty to include all counties within the selected geographic scope. |
| `maxItems` | Integer | No | Not specified | Maximum number of demographic records to collect. Hard maximum: `5000`. |
| `requestDelaySecs` | Number | No | Not specified | Delay between collection requests, in seconds. |

### Example Input

```json
{
    "geoLevel": "state",
    "acsEstimate": "5-year",
    "year": "latest",
    "measures": [
        "totalPopulation",
        "medianHouseholdIncome",
        "medianHomeValue",
        "medianAge"
    ],
    "stateFips": ["06"],
    "maxItems": 100,
    "requestDelaySecs": 1
}
```

### What Data Does This Actor Extract?

The actor returns structured demographic information for the selected geographic areas.

| Field | Description |
|---|---|
| `geoName` | Name of the state or county. |
| `geoId` | Census geography identifier, such as `04000US06`. |
| `geoLevel` | Geographic level: `state` or `county`. |
| `stateFips` | Two-digit state FIPS code. |
| `countyFips` | Three-digit county FIPS code, when collecting county records. |
| `acsYear` | ACS data release year. |
| `acsEstimate` | ACS estimate type used: `1-year` or `5-year`. |
| `totalPopulation` | Estimated total population from ACS table B01003. |
| `medianHouseholdIncome` | Estimated median household income from ACS table B19013. |
| `medianHomeValue` | Estimated median owner-occupied home value from ACS table B25077. |
| `medianAge` | Estimated median age from ACS table B01002. |
| `rawMeasures` | Collection of original demographic measure values organized by their measure names. |
| `source` | Data source attribution. |

### Example Output

```json
{
    "geoId": "04000US06",
    "geoName": "California",
    "geoLevel": "state",
    "stateFips": "06",
    "acsYear": 2022,
    "acsEstimate": "5-year",
    "source": "Data USA (US Census Bureau ACS)",
    "totalPopulation": 39356104,
    "medianHouseholdIncome": 91905,
    "medianHomeValue": 659300,
    "medianAge": 37.3,
    "rawMeasures": {
        "Population": 39356104,
        "Household Income by Race": 91905,
        "Property Value": 659300,
        "Median Age": 37.3
    }
}
```

### Use Cases

- **Market Sizing:** Compare state and county population estimates when evaluating potential markets.
- **Real Estate Research:** Analyze median home values, population, and household income across geographic areas.
- **Demographic Enrichment:** Combine demographic statistics with CRM, property, and business datasets using geographic FIPS codes.
- **Policy and Nonprofit Research:** Prepare demographic datasets for community research, grant applications, and regional planning.
- **Geographic Analysis:** Compare demographic characteristics across states and counties.
- **Business Research:** Evaluate population distribution and household income when researching potential business locations.
- **Data Analysis and Reporting:** Prepare structured demographic datasets for statistical analysis and research reports.

### Working with Your Dataset

After the actor completes:

1. Open the **Dataset** tab in your Apify run.
2. Review the collected state or county demographic records.
3. Export the results in JSON, CSV, Excel, or another supported format.
4. Use the collected information for demographic research, geographic comparisons, market analysis, or data enrichment.

### FAQ

**What information does this actor collect?**

The actor collects U.S. Census ACS demographic estimates, including population, median household income, median home value, and median age, along with geographic identifiers and original measure values.

**Which geographic levels are supported?**

Two geographic levels are supported:

- `state` — State-level demographic records.
- `county` — County-level demographic records.

**Can I collect data for every state?**

Yes. Leave `stateFips` empty in state mode to include all available states.

**Can I collect all counties or only selected counties?**

Yes. In county mode, leave `stateFips` and `countyFips` empty to include all available counties. Alternatively, specify state FIPS codes and county FIPS codes to narrow the geographic selection.

**Which ACS estimate should I use?**

The 5-year estimate provides coverage for states and counties and is suitable for more comprehensive geographic analysis. The 1-year estimate provides more recent estimates but is available only for larger geographic areas.

**Can I select specific demographic measures?**

Yes. Use `measures` to select the demographic information you want to collect:

- `totalPopulation`
- `medianHouseholdIncome`
- `medianHomeValue`
- `medianAge`

**What does the `latest` year option mean?**

Set `year` to `latest` to select the newest available ACS release.

**How many records can I collect per run?**

You can collect up to `5,000` records per run. Use `maxItems` to control the maximum number of records.

**What export formats are available?**

You can export collected records in JSON, CSV, Excel, and other supported Apify dataset formats.

**Can I schedule recurring collections?**

Yes. Configure an Apify schedule to run the actor periodically using your selected input parameters.

### Disclaimer

This actor is an independent tool and is not affiliated with or endorsed by the U.S. Census Bureau or Data USA. It collects publicly available demographic information. Users are responsible for ensuring that their use of the collected data complies with applicable laws and relevant source terms.

### Is Web Scraping Legal?

Collecting information that is already public is generally legal. There is no single law that bans all forms of web scraping. The limits are the usual ones: do not break into accounts, do not take private or confidential data, and be careful with personal data and copyrighted works. A site's terms can also restrict how you access it. Facts such as a public name, price, or rating are not the same as republishing someone's article or photo.

This actor collects information from public pages. It does not log in and it does not bypass access controls.

For a longer explanation, see Apify's article [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

## `geoLevel` (type: `string`):

Geography level to collect. State returns one row per state; County returns one row per county (optionally limited to selected states).

## `acsEstimate` (type: `string`):

Which ACS estimate to use. The 5-year estimate covers every state and county; the 1-year estimate is more current but only covers larger areas.

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

ACS release year, for example 2022. Use 'latest' to automatically pick the newest available year.

## `measures` (type: `array`):

Which demographic measures to include in each record.

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

Two-digit state FIPS codes to keep (for example 06 for California). Leave empty to collect all states (or, in County mode, all counties in every state).

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

County mode only. Three-digit county FIPS codes to keep within the selected states. Leave empty for all counties.

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

Stop after this many records. Hard max is 5000.

## `requestDelaySecs` (type: `number`):

Seconds to wait before each request. Default is about 1 request per second.

## `userAgent` (type: `string`):

User-Agent header sent with each request.

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## `proxyConfiguration` (type: `object`):

Optional proxy. Leave off unless you need it.

## Actor input object example

```json
{
  "geoLevel": "state",
  "acsEstimate": "5-year",
  "year": "latest",
  "measures": [
    "totalPopulation",
    "medianHouseholdIncome",
    "medianHomeValue",
    "medianAge"
  ],
  "stateFips": [
    "06"
  ],
  "countyFips": [],
  "maxItems": 100,
  "requestDelaySecs": 1,
  "userAgent": "ActorResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Demographic rows in the overview table.

## `dataset` (type: `string`):

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# 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 = {
    "year": "latest",
    "measures": [
        "totalPopulation",
        "medianHouseholdIncome",
        "medianHomeValue",
        "medianAge"
    ],
    "stateFips": [
        "06"
    ],
    "countyFips": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("coder_zoro/us-census-acs-demographics-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 = {
    "year": "latest",
    "measures": [
        "totalPopulation",
        "medianHouseholdIncome",
        "medianHomeValue",
        "medianAge",
    ],
    "stateFips": ["06"],
    "countyFips": [],
}

# Run the Actor and wait for it to finish
run = client.actor("coder_zoro/us-census-acs-demographics-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 '{
  "year": "latest",
  "measures": [
    "totalPopulation",
    "medianHouseholdIncome",
    "medianHomeValue",
    "medianAge"
  ],
  "stateFips": [
    "06"
  ],
  "countyFips": []
}' |
apify call coder_zoro/us-census-acs-demographics-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,coder_zoro/us-census-acs-demographics-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/FItpmXgxMVRCidDHr/builds/tW4SYceFdRHI4KZvV/openapi.json
