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.
- Tools
- 13
- What they doRead · write · destructive
- 13 · 0 · 013 read0 write0 destructive
- Users sign in with
- API key
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>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_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts 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.actionsconst connector = 'censusbureau'const identifier = 'user_123'// Generate an authorization link for the userconst { 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 callconst result = await actions.executeTool({connector,identifier,toolName: 'censusbureau_timeseries_datasets_list',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_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.actionsconnection_name = "censusbureau"identifier = "user_123"# Generate an authorization link for the userlink_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 callresult = actions.execute_tool(tool_input={},tool_name="censusbureau_timeseries_datasets_list",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their U.S. Census Bureau credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolcensusbureau_data_queryQuery 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.Read-onlyQuery Dataset (Two-Segment Path)
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.
Inputs
datasetstringrequired- Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
getstringrequired- 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.
programstringrequired- 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.
yearstringrequired- Vintage (reference year) of the dataset, as four digits. Example: 2022.
descriptiveboolean- Set to true to add a second header row with each variable's label. Example: true.
forstring- 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:*.
instring- 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.
ucgidstring- 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.
censusbureau_data_query_singleQuery statistics from a dataset whose path has one segment, such as cbp (County Business Patterns), zbp or ecnbasic.Read-onlyQuery Dataset (One-Segment Path)
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.
Inputs
datasetstringrequired- Single-segment dataset name, such as cbp (County Business Patterns), zbp (ZIP Code Business Patterns) or ecnbasic (Economic Census). Example: cbp.
getstringrequired- 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.
yearstringrequired- Vintage (reference year) of the dataset, as four digits. Example: 2022.
descriptiveboolean- Set to true to add a second header row with each variable's label. Example: true.
forstring- 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:*.
instring- 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.
naics2017string- NAICS 2017 industry code predicate for business datasets, e.g. 72 for accommodation and food services. Example: 72.
ucgidstring- 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.
censusbureau_data_query_table_typeQuery statistics from an ACS table-type dataset with a three-segment path, such as acs/acs5/subject, acs/acs1/profile or acs/acs5/cprofile.Read-onlyQuery ACS Table Type
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).
Inputs
datasetstringrequired- Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
getstringrequired- 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.
programstringrequired- 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_typestringrequired- Third segment of the dataset path for ACS table types: subject, profile, cprofile or spp (for example acs/acs5/subject). Example: subject.
yearstringrequired- Vintage (reference year) of the dataset, as four digits. Example: 2022.
descriptiveboolean- Set to true to add a second header row with each variable's label. Example: true.
forstring- 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:*.
instring- 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.
ucgidstring- 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.
censusbureau_datasets_listList every dataset available for one vintage (year), in DCAT catalog format.Read-onlyList Datasets for a Year
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.
Inputs
yearstringrequired- Vintage (reference year) of the dataset, as four digits. Example: 2022.
censusbureau_geography_listList the geography levels of a two-segment dataset such as acs/acs5 and the parent geographies each requires.Read-onlyList Dataset Geographies
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.
Inputs
datasetstringrequired- Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
programstringrequired- 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.
yearstringrequired- Vintage (reference year) of the dataset, as four digits. Example: 2022.
censusbureau_group_getGet the variables of one group (table) of a two-segment dataset such as acs/acs5.Read-onlyGet Group (Table) Variables
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.
Inputs
datasetstringrequired- Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
groupstringrequired- Group (table) name, e.g. B01001. Example: B01001.
programstringrequired- 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.
yearstringrequired- Vintage (reference year) of the dataset, as four digits. Example: 2022.
censusbureau_groups_listList the groups (tables) of a two-segment dataset such as acs/acs5.Read-onlyList Dataset Groups (Tables)
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.
Inputs
datasetstringrequired- Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
programstringrequired- 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.
yearstringrequired- Vintage (reference year) of the dataset, as four digits. Example: 2022.
censusbureau_table_type_group_getGet the variables of one group (table) of an ACS table-type dataset such as acs/acs5/subject.Read-onlyGet ACS Table Type Group
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.
Inputs
datasetstringrequired- Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
groupstringrequired- Group (table) name, e.g. S0101. Example: S0101.
programstringrequired- 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_typestringrequired- Third segment of the dataset path for ACS table types: subject, profile, cprofile or spp (for example acs/acs5/subject). Example: subject.
yearstringrequired- Vintage (reference year) of the dataset, as four digits. Example: 2022.
censusbureau_table_type_groups_listList the groups (tables) of an ACS table-type dataset such as acs/acs5/subject or acs/acs1/profile.Read-onlyList ACS Table Type Groups
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.
Inputs
datasetstringrequired- Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
programstringrequired- 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_typestringrequired- Third segment of the dataset path for ACS table types: subject, profile, cprofile or spp (for example acs/acs5/subject). Example: subject.
yearstringrequired- Vintage (reference year) of the dataset, as four digits. Example: 2022.
censusbureau_timeseries_datasets_listList every time series dataset (datasets that span many years, such as economic indicators, poverty and health insurance estimates).Read-onlyList Time Series Datasets
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.
Inputs
This tool takes no inputs.
censusbureau_timeseries_queryQuery 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.Read-onlyQuery Time Series Dataset
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.
Inputs
datasetstringrequired- Second segment of the time series path, e.g. saipe, sahie, resconst. Example: saipe.
getstringrequired- 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.
programstringrequired- First segment of the time series path, e.g. poverty, healthins, eits. Example: poverty.
descriptiveboolean- Set to true to add a second header row with each variable's label. Example: true.
forstring- 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:*.
instring- 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.
timestring- Time predicate for time series datasets, e.g. 2023, 2023-06, from 2020 to 2023, or from 2020-01. Example: from 2020 to 2023.
ucgidstring- 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.
censusbureau_variable_getGet the definition of one variable of a two-segment dataset such as acs/acs5.Read-onlyGet Variable
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.
Inputs
datasetstringrequired- Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
programstringrequired- 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.
variablestringrequired- Variable name, e.g. B01001_001E. Example: B01001_001E.
yearstringrequired- Vintage (reference year) of the dataset, as four digits. Example: 2022.
censusbureau_variables_listList every variable of a two-segment dataset such as acs/acs5, with label, concept, predicate type and group.Read-onlyList Dataset Variables
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.
Inputs
datasetstringrequired- Second segment of the dataset path. For acs/acs5 this is acs5; other examples: acs1, acsse, pl, dhc, population. Example: acs5.
programstringrequired- 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.
yearstringrequired- Vintage (reference year) of the dataset, as four digits. Example: 2022.
No tools match.