# US Census ACS - Demographics & Income | $0.002 (`pink_comic/us-census-acs-search`) Actor

Search Census American Community Survey (ACS). Query demographic, economic, housing, and social statistics by geography. For market researchers, urban planners, real estate analysts, and grant writers. Pay per result.

- **URL**: https://apify.com/pink\_comic/us-census-acs-search.md
- **Developed by:** [Ava Torres](https://apify.com/pink_comic) (community)
- **Categories:** Business, Automation, MCP servers
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 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.

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

## U.S. Census ACS - Demographics, Income, Housing & Population Data by Geography

Query the U.S. Census Bureau American Community Survey (ACS) for population, income, housing, education, employment, and demographic data — at any geographic level from national down to census tract. Four built-in presets cover the most common use cases, or specify any Census variable codes directly. Covers all 50 states, 3,200+ counties, 33,000+ ZIP codes, 29,000+ cities and places, and 85,000+ census tracts.

Data is sourced from the official Census Bureau API. No API key required.

---

### Output Fields

| Field | Type | Description |
|---|---|---|
| `name` | string | Geography name (e.g. `Los Angeles County, California`) |
| `geoLevel` | string | Geography level (state, county, zip, place, tract, etc.) |
| `stateFIPS` | string | 2-digit state FIPS code |
| `countyFIPS` | string | 3-digit county FIPS code |
| `data` | object | Key-value map of Census variable codes to values |

The `data` object contains the actual Census variable values. When using a preset, fields are labeled with readable names. When using custom variables, keys are the raw Census codes (e.g. `B01001_001E`).

---

### Use Cases

- **Market sizing and site selection** — Pull median household income, population density, and age distribution for any ZIP code or county before opening a location or launching a campaign.
- **Real estate and mortgage analytics** — Get median home values, rental rates, occupancy, and housing stock data by census tract for underwriting or investment screening.
- **Public health and nonprofit grant writing** — Retrieve poverty rates, uninsured rates, and educational attainment by county to support grant applications.
- **Political and academic research** — Analyze demographic shifts, income inequality, or language diversity across congressional districts or metro areas.
- **Lead generation and territory planning** — Segment geographies by income, age, or household composition to prioritize sales territories or ad targeting.

---

### How to Use

Choose a preset (or leave blank for custom variables), select a geography level, and optionally filter by state or county FIPS code.

**Example input — demographics for all U.S. states:**

```json
{
  "preset": "demographics",
  "geoLevel": "state",
  "year": 2022,
  "maxResults": 52
}
````

**Example input — economic data for all counties in Texas:**

```json
{
  "preset": "economics",
  "geoLevel": "county",
  "stateFIPS": "48",
  "year": 2022,
  "maxResults": 300
}
```

**Example input — housing data for ZIP codes in California:**

```json
{
  "preset": "housing",
  "geoLevel": "zip",
  "stateFIPS": "06",
  "year": 2022,
  "maxResults": 2000
}
```

**Example input — custom variables for a specific city:**

```json
{
  "preset": "",
  "geoLevel": "place",
  "stateFIPS": "36",
  "variables": ["B01001_001E", "B19013_001E", "B25077_001E"],
  "year": 2022,
  "maxResults": 100
}
```

#### Data Presets

| Preset | Variables Included |
|---|---|
| `demographics` | Total population, median age, sex, race, Hispanic origin |
| `economics` | Median household income, per capita income, poverty rate, employment |
| `housing` | Median home value, median gross rent, occupancy status, housing units |
| `social` | Educational attainment, language spoken at home, household size |

#### Geography Levels

| Level | Description |
|---|---|
| `us` | United States (single national row) |
| `state` | All 50 states + DC |
| `county` | Counties (requires `stateFIPS` for state filter) |
| `place` | Cities and places |
| `zip` | ZIP Code Tabulation Areas (ZCTAs) |
| `tract` | Census tracts (requires `stateFIPS` and `countyFIPS`) |
| `congressional_district` | Congressional districts |
| `metro` | Metropolitan statistical areas |

Find FIPS codes at [www.census.gov/geographies/reference-files](https://www.census.gov/geographies/reference-files.html) and variable codes at [api.census.gov/data/2022/acs/acs5/variables.html](https://api.census.gov/data/2022/acs/acs5/variables.html).

***

### Cost

Approximately **$0.10 per run** (platform start fee) plus minimal compute. Most runs complete in under 30 seconds.

***

### Output Formats

Results are available as **JSON**, **CSV**, and **Excel** from the Apify dataset interface. The `data` field in JSON contains the full variable map for each geography.

***

### FAQ

**Does this require a Census API key?**
No. The actor uses the Census Bureau public API without authentication.

**What is ACS 5-Year vs 1-Year data?**
The 5-year ACS (default) pools 5 years of survey responses for stable estimates at small geographies like ZIP codes and tracts. The 1-year ACS has more recent data but only covers geographies with 65,000+ population.

**What year should I use?**
ACS 2022 5-year data (the default) is the most recent widely available release. Use the `year` field to access earlier vintages back to 2009.

**What FIPS codes do I need?**
State FIPS codes are 2 digits (e.g. `06` for California, `48` for Texas, `36` for New York). County FIPS codes are 3 digits and used within a state (e.g. `037` for Los Angeles County). Leading zeros are required.

**How do I find Census variable codes?**
Browse the full variable list at api.census.gov for the dataset and year you want. Common examples: `B01001_001E` (total population), `B19013_001E` (median household income), `B25077_001E` (median home value).

# Actor input Schema

## `preset` (type: `string`):

Choose a preset data package or leave empty to specify custom variables.

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

Geographic level to query data for.

## `stateFIPS` (type: `string`):

2-digit state FIPS code to filter results (e.g. "06" for California, "36" for New York, "48" for Texas). Required for county, place, and tract queries.

## `countyFIPS` (type: `string`):

3-digit county FIPS code (e.g. "037" for Los Angeles County). Used with tract-level queries.

## `geoFilter` (type: `string`):

Specific geography code to look up (e.g. "51000" for New York City place, or "90210" for ZIP code). Use "\*" or leave empty for all.

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

Census API dataset. Most users should use the default. Only change for advanced queries.

## `year` (type: `integer`):

ACS survey year. Default is 2022 (most recent 5-year data).

## `variables` (type: `array`):

Census variable codes to retrieve (e.g. \["B01001\_001E", "B19013\_001E"]). Only used when no preset is selected. Find variables at api.census.gov/data/2022/acs/acs5/variables.html

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

Maximum number of geography records to return.

## Actor input object example

```json
{
  "preset": "demographics",
  "geoLevel": "state",
  "stateFIPS": "",
  "countyFIPS": "",
  "geoFilter": "",
  "dataset": "acs/acs5",
  "year": 2022,
  "variables": [],
  "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 = {
    "preset": "demographics",
    "geoLevel": "state",
    "year": 2022,
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("pink_comic/us-census-acs-search").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 = {
    "preset": "demographics",
    "geoLevel": "state",
    "year": 2022,
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("pink_comic/us-census-acs-search").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 '{
  "preset": "demographics",
  "geoLevel": "state",
  "year": 2022,
  "maxResults": 100
}' |
apify call pink_comic/us-census-acs-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=pink_comic/us-census-acs-search",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "US Census ACS - Demographics & Income | $0.002",
        "description": "Search Census American Community Survey (ACS). Query demographic, economic, housing, and social statistics by geography. For market researchers, urban planners, real estate analysts, and grant writers. Pay per result.",
        "version": "0.1",
        "x-build-id": "qCcFzoAl8UneyFLcg"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/pink_comic~us-census-acs-search/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-pink_comic-us-census-acs-search",
                "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/pink_comic~us-census-acs-search/runs": {
            "post": {
                "operationId": "runs-sync-pink_comic-us-census-acs-search",
                "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/pink_comic~us-census-acs-search/run-sync": {
            "post": {
                "operationId": "run-sync-pink_comic-us-census-acs-search",
                "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": {
                    "preset": {
                        "title": "Data Preset",
                        "enum": [
                            "demographics",
                            "economics",
                            "housing",
                            "social",
                            ""
                        ],
                        "type": "string",
                        "description": "Choose a preset data package or leave empty to specify custom variables.",
                        "default": "demographics"
                    },
                    "geoLevel": {
                        "title": "Geography Level",
                        "enum": [
                            "us",
                            "state",
                            "county",
                            "place",
                            "zip",
                            "tract",
                            "congressional_district",
                            "metro"
                        ],
                        "type": "string",
                        "description": "Geographic level to query data for.",
                        "default": "state"
                    },
                    "stateFIPS": {
                        "title": "State FIPS Code",
                        "type": "string",
                        "description": "2-digit state FIPS code to filter results (e.g. \"06\" for California, \"36\" for New York, \"48\" for Texas). Required for county, place, and tract queries.",
                        "default": ""
                    },
                    "countyFIPS": {
                        "title": "County FIPS Code",
                        "type": "string",
                        "description": "3-digit county FIPS code (e.g. \"037\" for Los Angeles County). Used with tract-level queries.",
                        "default": ""
                    },
                    "geoFilter": {
                        "title": "Geography Code Filter",
                        "type": "string",
                        "description": "Specific geography code to look up (e.g. \"51000\" for New York City place, or \"90210\" for ZIP code). Use \"*\" or leave empty for all.",
                        "default": ""
                    },
                    "dataset": {
                        "title": "Dataset",
                        "enum": [
                            "acs/acs5",
                            "acs/acs1",
                            "acs/acs5/profile",
                            "acs/acs1/profile"
                        ],
                        "type": "string",
                        "description": "Census API dataset. Most users should use the default. Only change for advanced queries.",
                        "default": "acs/acs5"
                    },
                    "year": {
                        "title": "Survey Year",
                        "minimum": 2009,
                        "maximum": 2023,
                        "type": "integer",
                        "description": "ACS survey year. Default is 2022 (most recent 5-year data).",
                        "default": 2022
                    },
                    "variables": {
                        "title": "Custom Variables",
                        "type": "array",
                        "description": "Census variable codes to retrieve (e.g. [\"B01001_001E\", \"B19013_001E\"]). Only used when no preset is selected. Find variables at api.census.gov/data/2022/acs/acs5/variables.html",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Maximum number of geography records to return.",
                        "default": 100
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
