# Census Building Permits State Change Feed (`anderson-data-tools/glacier-lean-2`) Actor

Compare monthly US Census residential building permits by state. Get period changes, FIPS codes, reported versus imputed units, valuation units and dated source evidence for market research. Source failures are flagged rather than treated as zero activity.

- **URL**: https://apify.com/anderson-data-tools/glacier-lean-2.md
- **Developed by:** [Benjamin Anderson](https://apify.com/anderson-data-tools) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 state comparisons

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?

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

## Census Building Permits State Change Feed

Compare official monthly Census state residential building permit estimates. Preserve FIPS, reported versus imputed units, valuation units, source vintages, and period changes.

### Input example

```json
{
  "period": "2026-08",
  "previous_period": "2026-07",
  "states": ["01", "22", "28"]
}
```

`period` is a `YYYY-MM` month or `latest`. If omitted, the Actor finds the latest listed monthly release. `previous_period` defaults to the month before the selected period. `states` accepts up to 51 two-digit FIPS strings; an empty list compares all states and DC.

### Output example

Selected fields from a recorded local SDK result on October 11, 2026 UTC. They show values from that run, not a current estimate or an accuracy guarantee.

```json
{
  "record_id": "01:2026-08:2026-07",
  "state_fips": "01",
  "name": "Alabama",
  "outcome": "ok",
  "billable": true,
  "period": "2026-08",
  "previous_period": "2026-07",
  "units": 1731,
  "previous_units": 1560,
  "units_change": 171,
  "units_change_pct": 10.9615,
  "valuation_usd": 451645000,
  "reported_units": 1318,
  "source_url": "https://www2.census.gov/econ/bps/State/st2608c.txt",
  "retrieved_at": "2026-10-11T03:03:37.205932+00:00"
}
```

One dataset row represents one successfully compared state. Values are monthly residential estimates, not individual permit records or addresses. Source thousands of dollars are converted to USD. Reported units are separate from estimates that include imputation. The result includes current and previous source URLs, retrieval dates, and hashes.

### Result meaning and limits

`ok` means both published files were readable and the state values were compared. `uncertain` means a source or row was incomplete, malformed, or changed; its message begins `uncertain - please check`. Missing states and values produce a free uncertain row. This Actor does not currently return a separate `no_match` outcome. A zero previous-period denominator produces a null percentage change. Revisions to a source file can change results between runs.

Uses the [U.S. Census Bureau Building Permits Survey](https://www.census.gov/construction/bps/index.html). The Actor compares monthly state aggregates; it does not provide addresses, permit leads, forecasts, seasonal adjustment, or revision classifications. No accuracy rate or agency endorsement is claimed. Verify important figures against the linked Census files.

### Pricing

The `state-comparison` event costs **$0.002 per successfully compared state**, with platform usage included. Uncertain rows are free; this Actor does not return a separate no-match outcome.

For all 50 states and DC, the maximum event charge per run is **$0.102**. A smaller selected-state list costs up to $0.002 per state compared. Each new run can incur new event charges.

# Actor input Schema

## `period` (type: `string`):

YYYY-MM (2000 onward), or latest to discover the latest published monthly file.

## `previous_period` (type: `string`):

YYYY-MM, earlier than current period. Omit for preceding calendar month.

## `states` (type: `array`):

Two-digit strings, e.g. \["01","22","28"]. Empty means all 50 states and DC.

## Actor input object example

```json
{
  "period": "latest",
  "states": [
    "01",
    "22",
    "28"
  ]
}
```

# 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 = {
    "states": [
        "01",
        "22",
        "28"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("anderson-data-tools/glacier-lean-2").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 = { "states": [
        "01",
        "22",
        "28",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("anderson-data-tools/glacier-lean-2").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 '{
  "states": [
    "01",
    "22",
    "28"
  ]
}' |
apify call anderson-data-tools/glacier-lean-2 --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,anderson-data-tools/glacier-lean-2"
        }
    }
}
```

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/ScF2gWlq9iHoFaJ9F/builds/U4lzDTFZPPEm4GKpk/openapi.json
