> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to U.S. Census Bureau

The U.S. Census Bureau connector lets your AI agent act in each user's U.S. Census Bureau account. Each user connects their own U.S. Census Bureau API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 13 tools.

**Authentication:** API Key
**Categories:** Analytics
**Tools:** 13: 13 read, 0 write, 0 destructive
**Users sign in with:** API key
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=CENSUSBUREAU)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the U.S. Census Bureau connection

   In **AgentKit > Connections**, create an U.S. Census Bureau connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'censusbureau'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize U.S. Census Bureau:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'censusbureau_timeseries_datasets_list',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "censusbureau"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize U.S. Census Bureau:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="censusbureau_timeseries_datasets_list",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their U.S. Census Bureau credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'censusbureau_data_query',
  toolInput: {
    dataset: '<dataset>',
    get: '<get>',
    program: '<program>',
    year: '<year>',
  },
  connector: 'censusbureau',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="censusbureau_data_query",
    tool_input={
        "dataset": "<dataset>",
        "get": "<get>",
        "program": "<program>",
        "year": "<year>",
    },
    connection_name="censusbureau",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `censusbureau_data_query`

Query Dataset (Two-Segment Path) · Read-only

Query statistics from a dataset whose path has two segments, such as acs/acs5, acs/acs1, dec/pl, dec/dhc or pep/population, for a set of variables and geographies. Returns a JSON array of rows: the first row holds the column names (the requested variables, then the geography codes) and each following row one geography's values as strings. Use this for most ACS and decennial queries. Use censusbureau_data_query_table_type for acs/acs5/subject or profile tables, and censusbureau_data_query_single for cbp.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
- `get` (`string`, required): Comma-separated variables to return, at most 50, for example NAME,B01001_001E. Use group(TABLE) to return a whole table, e.g. group(B01001). Find variable names with censusbureau_variables_list or censusbureau_groups_list. Example: NAME,B01001_001E.
- `program` (`string`, required): First segment of the dataset path, usually the survey program: acs (American Community Survey), dec (Decennial Census), pep (Population Estimates), abscs, cbp and so on. For acs/acs5 this is acs. Example: acs.
- `year` (`string`, required): Vintage (reference year) of the dataset, as four digits. Example: 2022.
- `descriptive` (`boolean`, optional): Set to true to add a second header row with each variable's label. Example: true.
- `for` (`string`, optional): Geography level and codes to return, as level:code or level:* for all, e.g. state:*, state:06, county:*, place:44000. Leave empty when you use ucgid. Example: state:*.
- `in` (`string`, optional): Parent geography that limits the for clause, e.g. state:06 to get counties in California; separate several parents with a space, e.g. state:06 county:037. Example: state:06.
- `ucgid` (`string`, optional): Uniform Census Geography Identifier, an alternative to for and in, e.g. 0400000US06 for California or pseudo(0400000US06$0500000) for all its counties. Example: 0400000US06.

Example input: `{"dataset":"<dataset>","get":"<get>","program":"<program>","year":"<year>"}`

### `censusbureau_data_query_single`

Query Dataset (One-Segment Path) · Read-only

Query statistics from a dataset whose path has one segment, such as cbp (County Business Patterns), zbp or ecnbasic. Returns a JSON array of rows: the first row holds the column names (the requested variables, then the geography codes) and each following row one geography's values as strings. Use this for business and economic datasets. Use censusbureau_data_query for acs or dec datasets.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): Single-segment dataset name, such as cbp (County Business Patterns), zbp (ZIP Code Business Patterns) or ecnbasic (Economic Census). Example: cbp.
- `get` (`string`, required): Comma-separated variables to return, at most 50, for example NAME,B01001_001E. Use group(TABLE) to return a whole table, e.g. group(B01001). Find variable names with censusbureau_variables_list or censusbureau_groups_list. Example: NAME,B01001_001E.
- `year` (`string`, required): Vintage (reference year) of the dataset, as four digits. Example: 2022.
- `descriptive` (`boolean`, optional): Set to true to add a second header row with each variable's label. Example: true.
- `for` (`string`, optional): Geography level and codes to return, as level:code or level:* for all, e.g. state:*, state:06, county:*, place:44000. Leave empty when you use ucgid. Example: state:*.
- `in` (`string`, optional): Parent geography that limits the for clause, e.g. state:06 to get counties in California; separate several parents with a space, e.g. state:06 county:037. Example: state:06.
- `naics2017` (`string`, optional): NAICS 2017 industry code predicate for business datasets, e.g. 72 for accommodation and food services. Example: 72.
- `ucgid` (`string`, optional): Uniform Census Geography Identifier, an alternative to for and in, e.g. 0400000US06 for California or pseudo(0400000US06$0500000) for all its counties. Example: 0400000US06.

Example input: `{"dataset":"<dataset>","get":"<get>","year":"<year>"}`

### `censusbureau_data_query_table_type`

Query ACS Table Type · Read-only

Query statistics from an ACS table-type dataset with a three-segment path, such as acs/acs5/subject, acs/acs1/profile or acs/acs5/cprofile. Returns a JSON array of rows: the first row holds the column names (the requested variables, then the geography codes) and each following row one geography's values as strings. Use this for subject (S), data profile (DP) and comparison profile (CP) tables. Use censusbureau_data_query for detailed tables (B and C).

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
- `get` (`string`, required): Comma-separated variables to return, at most 50, for example NAME,B01001_001E. Use group(TABLE) to return a whole table, e.g. group(B01001). Find variable names with censusbureau_variables_list or censusbureau_groups_list. Example: NAME,B01001_001E.
- `program` (`string`, required): First segment of the dataset path, usually the survey program: acs (American Community Survey), dec (Decennial Census), pep (Population Estimates), abscs, cbp and so on. For acs/acs5 this is acs. Example: acs.
- `table_type` (`string`, required): Third segment of the dataset path for ACS table types: subject, profile, cprofile or spp (for example acs/acs5/subject). Example: subject.
- `year` (`string`, required): Vintage (reference year) of the dataset, as four digits. Example: 2022.
- `descriptive` (`boolean`, optional): Set to true to add a second header row with each variable's label. Example: true.
- `for` (`string`, optional): Geography level and codes to return, as level:code or level:* for all, e.g. state:*, state:06, county:*, place:44000. Leave empty when you use ucgid. Example: state:*.
- `in` (`string`, optional): Parent geography that limits the for clause, e.g. state:06 to get counties in California; separate several parents with a space, e.g. state:06 county:037. Example: state:06.
- `ucgid` (`string`, optional): Uniform Census Geography Identifier, an alternative to for and in, e.g. 0400000US06 for California or pseudo(0400000US06$0500000) for all its counties. Example: 0400000US06.

Example input: `{"dataset":"<dataset>","get":"<get>","program":"<program>","table_type":"<table_type>","year":"<year>"}`

### `censusbureau_datasets_list`

List Datasets for a Year · Read-only

List every dataset available for one vintage (year), in DCAT catalog format. Returns per dataset its title, description, path segments (c_dataset), vintage, and links to its variables, groups, geography and examples. Use this to find a dataset path such as acs/acs5. Use censusbureau_timeseries_datasets_list for time series.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `year` (`string`, required): Vintage (reference year) of the dataset, as four digits. Example: 2022.

Example input: `{"year":"<year>"}`

### `censusbureau_geography_list`

List Dataset Geographies · Read-only

List the geography levels of a two-segment dataset such as acs/acs5 and the parent geographies each requires. Returns per level its name (e.g. county), geo level code and the required in clause. Use this to build the for and in parameters.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
- `program` (`string`, required): First segment of the dataset path, usually the survey program: acs (American Community Survey), dec (Decennial Census), pep (Population Estimates), abscs, cbp and so on. For acs/acs5 this is acs. Example: acs.
- `year` (`string`, required): Vintage (reference year) of the dataset, as four digits. Example: 2022.

Example input: `{"dataset":"<dataset>","program":"<program>","year":"<year>"}`

### `censusbureau_group_get`

Get Group (Table) Variables · Read-only

Get the variables of one group (table) of a two-segment dataset such as acs/acs5. Returns a variables object keyed by variable name with label, concept and predicate type. Use this to pick variables for censusbureau_data_query, or pass group(NAME) as get.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
- `group` (`string`, required): Group (table) name, e.g. B01001. Example: B01001.
- `program` (`string`, required): First segment of the dataset path, usually the survey program: acs (American Community Survey), dec (Decennial Census), pep (Population Estimates), abscs, cbp and so on. For acs/acs5 this is acs. Example: acs.
- `year` (`string`, required): Vintage (reference year) of the dataset, as four digits. Example: 2022.

Example input: `{"dataset":"<dataset>","group":"<group>","program":"<program>","year":"<year>"}`

### `censusbureau_groups_list`

List Dataset Groups (Tables) · Read-only

List the groups (tables) of a two-segment dataset such as acs/acs5. Returns each group's name (e.g. B01001), description and link to its variables. Use this to find a table. Use censusbureau_group_get for its variables.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
- `program` (`string`, required): First segment of the dataset path, usually the survey program: acs (American Community Survey), dec (Decennial Census), pep (Population Estimates), abscs, cbp and so on. For acs/acs5 this is acs. Example: acs.
- `year` (`string`, required): Vintage (reference year) of the dataset, as four digits. Example: 2022.

Example input: `{"dataset":"<dataset>","program":"<program>","year":"<year>"}`

### `censusbureau_table_type_group_get`

Get ACS Table Type Group · Read-only

Get the variables of one group (table) of an ACS table-type dataset such as acs/acs5/subject. Returns a variables object keyed by variable name with label and concept. Use this to pick variables for censusbureau_data_query_table_type.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
- `group` (`string`, required): Group (table) name, e.g. S0101. Example: S0101.
- `program` (`string`, required): First segment of the dataset path, usually the survey program: acs (American Community Survey), dec (Decennial Census), pep (Population Estimates), abscs, cbp and so on. For acs/acs5 this is acs. Example: acs.
- `table_type` (`string`, required): Third segment of the dataset path for ACS table types: subject, profile, cprofile or spp (for example acs/acs5/subject). Example: subject.
- `year` (`string`, required): Vintage (reference year) of the dataset, as four digits. Example: 2022.

Example input: `{"dataset":"<dataset>","group":"<group>","program":"<program>","table_type":"<table_type>","year":"<year>"}`

### `censusbureau_table_type_groups_list`

List ACS Table Type Groups · Read-only

List the groups (tables) of an ACS table-type dataset such as acs/acs5/subject or acs/acs1/profile. Returns each group's name (e.g. S0101), description and variables link. Use this to find subject or profile tables.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
- `program` (`string`, required): First segment of the dataset path, usually the survey program: acs (American Community Survey), dec (Decennial Census), pep (Population Estimates), abscs, cbp and so on. For acs/acs5 this is acs. Example: acs.
- `table_type` (`string`, required): Third segment of the dataset path for ACS table types: subject, profile, cprofile or spp (for example acs/acs5/subject). Example: subject.
- `year` (`string`, required): Vintage (reference year) of the dataset, as four digits. Example: 2022.

Example input: `{"dataset":"<dataset>","program":"<program>","table_type":"<table_type>","year":"<year>"}`

### `censusbureau_timeseries_datasets_list`

List Time Series Datasets · Read-only

List every time series dataset (datasets that span many years, such as economic indicators, poverty and health insurance estimates). Returns per dataset its title, description, path segments and discovery links. Use this to find a timeseries dataset path such as eits/resconst.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `censusbureau_timeseries_query`

Query Time Series Dataset · Read-only

Query a time series dataset with a two-segment path, such as eits/resconst, poverty/saipe, healthins/sahie or asm/industry, for variables, geographies and a time range. Returns a JSON array of rows: the first row holds the column names (the requested variables, then the geography codes) and each following row one geography's values as strings. Use this for statistics across many years. Use censusbureau_timeseries_datasets_list to find the path.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): Second segment of the time series path, e.g. saipe, sahie, resconst. Example: saipe.
- `get` (`string`, required): Comma-separated variables to return, at most 50, for example NAME,B01001_001E. Use group(TABLE) to return a whole table, e.g. group(B01001). Find variable names with censusbureau_variables_list or censusbureau_groups_list. Example: NAME,SAEPOVRTALL_PT.
- `program` (`string`, required): First segment of the time series path, e.g. poverty, healthins, eits. Example: poverty.
- `descriptive` (`boolean`, optional): Set to true to add a second header row with each variable's label. Example: true.
- `for` (`string`, optional): Geography level and codes to return, as level:code or level:* for all, e.g. state:*, state:06, county:*, place:44000. Leave empty when you use ucgid. Example: state:*.
- `in` (`string`, optional): Parent geography that limits the for clause, e.g. state:06 to get counties in California; separate several parents with a space, e.g. state:06 county:037. Example: state:06.
- `time` (`string`, optional): Time predicate for time series datasets, e.g. 2023, 2023-06, from 2020 to 2023, or from 2020-01. Example: from 2020 to 2023.
- `ucgid` (`string`, optional): Uniform Census Geography Identifier, an alternative to for and in, e.g. 0400000US06 for California or pseudo(0400000US06$0500000) for all its counties. Example: 0400000US06.

Example input: `{"dataset":"<dataset>","get":"<get>","program":"<program>"}`

### `censusbureau_variable_get`

Get Variable · Read-only

Get the definition of one variable of a two-segment dataset such as acs/acs5. Returns its label, concept, predicate type, group, limit and attributes. Use this to check what a variable measures.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
- `program` (`string`, required): First segment of the dataset path, usually the survey program: acs (American Community Survey), dec (Decennial Census), pep (Population Estimates), abscs, cbp and so on. For acs/acs5 this is acs. Example: acs.
- `variable` (`string`, required): Variable name, e.g. B01001_001E. Example: B01001_001E.
- `year` (`string`, required): Vintage (reference year) of the dataset, as four digits. Example: 2022.

Example input: `{"dataset":"<dataset>","program":"<program>","variable":"<variable>","year":"<year>"}`

### `censusbureau_variables_list`

List Dataset Variables · Read-only

List every variable of a two-segment dataset such as acs/acs5, with label, concept, predicate type and group. Returns a variables object keyed by variable name. The list can be very large (tens of thousands for ACS), so prefer censusbureau_group_get for one table. Use this for datasets with few variables.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
- `program` (`string`, required): First segment of the dataset path, usually the survey program: acs (American Community Survey), dec (Decennial Census), pep (Population Estimates), abscs, cbp and so on. For acs/acs5 this is acs. Example: acs.
- `year` (`string`, required): Vintage (reference year) of the dataset, as four digits. Example: 2022.

Example input: `{"dataset":"<dataset>","program":"<program>","year":"<year>"}`

## Related

Other Analytics connectors ([all 177](/agentkit/connectors/?category=analytics)):

- [Google Sheets](/agentkit/connectors/googlesheets/): Scalekit connector, OAuth, 48 tools
- [HubSpot](/agentkit/connectors/hubspot/): Scalekit connector, OAuth, 457 tools
- [AWS Redshift](/agentkit/connectors/redshift/): Scalekit connector, Trusted identity provider, 10 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
