# BEA Regional Economic Accounts Scraper (`compute-edge/bea-regional-economic-scraper`) Actor

Extract Bureau of Economic Analysis (BEA) regional data — GDP by state and county, personal income, per-capita income, and employment by industry. Requires a free BEA API key.

- **URL**: https://apify.com/compute-edge/bea-regional-economic-scraper.md
- **Developed by:** [Compute Edge](https://apify.com/compute-edge) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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

## BEA Regional Economic Accounts Scraper

Extract **U.S. Bureau of Economic Analysis (BEA) regional data** — state and county GDP, personal income, per-capita income, and industry employment — directly from the official BEA API. Perfect for **economic research, market sizing, real-estate analysis, public policy, and macro investment models**.

The BEA is the authoritative source for U.S. regional economic statistics, used by federal agencies, Wall Street analysts, and academic researchers. This Actor wraps the BEA Regional dataset and returns clean, structured records ready for dashboards or RAG pipelines.

### What you get

| Field | Description |
| --- | --- |
| `tableName` | BEA table code (e.g., CAINC1, CAGDP1, CAEMP25N) |
| `lineCode` / `lineDescription` | Specific metric within the table |
| `geoFips` | 5-digit FIPS code identifying the geography |
| `geoName` | Plain-English geography name |
| `year` | Reporting year |
| `dataValue` | Numeric value (BEA's native unit) |
| `unitOfMeasure` / `unitMult` | Units and scaling multiplier |
| `noteRef` | Footnote reference for caveats |

### How to scrape BEA regional data

1. **Register a free API key** at <https://apps.bea.gov/API/signup/> (instant email delivery).
2. Open the Actor and paste your key into **BEA API Key**.
3. Choose a **Table Name** — `CAINC1` (Personal income summary), `CAGDP1` (State GDP), `CAEMP25N` (Employment), `CAINC30` (Per-capita income), and many more.
4. Set **Line Code** for the specific metric inside the table.
5. Set **Geographic FIPS** — `STATE`, `COUNTY`, or a comma-separated list of FIPS codes.
6. Set **Year** to `ALL` or specific years.
7. Click **Start**.

### Why a free API key?

BEA enforces per-key rate limits. Using your own key avoids shared throttling and keeps your runs fast. The key is free, requires only an email, and never expires.

### Use cases

- **Site selection** — Compare county-level income and employment growth.
- **Real-estate analysis** — Pair per-capita income with housing data.
- **Public-sector forecasting** — Build state revenue and tax-base models.
- **AI/LLM pipelines** — Inject authoritative macro context into RAG systems.

### Pricing

Priced at **$0.003 per result**. A statewide `CAINC1` for one year returns ~50 rows; a county-level pull across 10 years can exceed 30,000 rows.

### Input example

```json
{
  "apiKey": "YOUR-BEA-KEY",
  "tableName": "CAINC1",
  "lineCode": 1,
  "geoFips": "STATE",
  "year": "2023",
  "maxResults": 5000
}
````

### Output example

```json
{
  "tableName": "CAINC1",
  "lineDescription": "Personal income (thousands of dollars)",
  "geoFips": "06000",
  "geoName": "California",
  "year": "2023",
  "dataValue": 3193784000,
  "unitOfMeasure": "USD"
}
```

### Related Actors

- **FRED Federal Reserve Economic Data Scraper** — national-level macro series.
- **Treasury Fiscal Data Scraper** — federal debt and revenue.
- **Census Business Patterns Scraper** — employment by NAICS by county.

### FAQ

**Is an API key required?** Yes — but registration is free and instant. The Actor emits a notice record explaining how to get one if no key is supplied.

**Can I download all U.S. counties?** Yes — set `geoFips=COUNTY` and a `Year`.

### Legal

This Actor uses the public BEA Data API. Users must comply with [BEA's terms of service](https://apps.bea.gov/API/signup/). The Actor does not bypass any access controls.

Support: bciccarelli6@gmail.com

# Actor input Schema

## `apiKey` (type: `string`):

Free BEA API key. Register instantly at https://apps.bea.gov/API/signup/ . Leave blank to receive a registration notice in the dataset.

## `tableName` (type: `string`):

BEA Regional table code. Examples: CAINC1 (Personal income summary), CAGDP1 (GDP summary), CAEMP25N (Total employment), CAINC30 (Per-capita income). Full list: https://apps.bea.gov/api/\_pdf/bea\_web\_service\_api\_user\_guide.pdf

## `lineCode` (type: `integer`):

BEA line code within the table. Example: 1 = Personal income (thousands of dollars) for CAINC1.

## `geoFips` (type: `string`):

Geographic code. 'STATE' = all states, 'COUNTY' = all counties, or specific FIPS like '06000' (California), '36061' (NY County). Comma-separate for multiple.

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

Year(s) to fetch. 'ALL' for full history, single year ('2023'), or comma-separated list ('2020,2021,2022').

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

Maximum records to return. 0 = unlimited.

## Actor input object example

```json
{
  "tableName": "CAINC1",
  "lineCode": 1,
  "geoFips": "STATE",
  "year": "2023",
  "maxResults": 5000
}
```

# Actor output Schema

## `dataset` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("compute-edge/bea-regional-economic-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("compute-edge/bea-regional-economic-scraper").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 '{}' |
apify call compute-edge/bea-regional-economic-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=compute-edge/bea-regional-economic-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "BEA Regional Economic Accounts Scraper",
        "description": "Extract Bureau of Economic Analysis (BEA) regional data — GDP by state and county, personal income, per-capita income, and employment by industry. Requires a free BEA API key.",
        "version": "0.1",
        "x-build-id": "C6GJx9BmkGqdtAob7"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/compute-edge~bea-regional-economic-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-compute-edge-bea-regional-economic-scraper",
                "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/compute-edge~bea-regional-economic-scraper/runs": {
            "post": {
                "operationId": "runs-sync-compute-edge-bea-regional-economic-scraper",
                "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/compute-edge~bea-regional-economic-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-compute-edge-bea-regional-economic-scraper",
                "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": {
                    "apiKey": {
                        "title": "BEA API Key",
                        "type": "string",
                        "description": "Free BEA API key. Register instantly at https://apps.bea.gov/API/signup/ . Leave blank to receive a registration notice in the dataset."
                    },
                    "tableName": {
                        "title": "Table Name",
                        "type": "string",
                        "description": "BEA Regional table code. Examples: CAINC1 (Personal income summary), CAGDP1 (GDP summary), CAEMP25N (Total employment), CAINC30 (Per-capita income). Full list: https://apps.bea.gov/api/_pdf/bea_web_service_api_user_guide.pdf",
                        "default": "CAINC1"
                    },
                    "lineCode": {
                        "title": "Line Code",
                        "type": "integer",
                        "description": "BEA line code within the table. Example: 1 = Personal income (thousands of dollars) for CAINC1.",
                        "default": 1
                    },
                    "geoFips": {
                        "title": "Geographic FIPS",
                        "type": "string",
                        "description": "Geographic code. 'STATE' = all states, 'COUNTY' = all counties, or specific FIPS like '06000' (California), '36061' (NY County). Comma-separate for multiple.",
                        "default": "STATE"
                    },
                    "year": {
                        "title": "Year",
                        "type": "string",
                        "description": "Year(s) to fetch. 'ALL' for full history, single year ('2023'), or comma-separated list ('2020,2021,2022').",
                        "default": "2023"
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 0,
                        "maximum": 200000,
                        "type": "integer",
                        "description": "Maximum records to return. 0 = unlimited.",
                        "default": 5000
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
