Skip to contents

The Census APIs have more than 1,000 endpoints, covering dozens of different surveys.

To see a current table of every available endpoint, run listCensusApis:

apis <- listCensusApis()

American Community Survey

There are multiple useful ACS datasets with slightly different purposes. Here’s how the Census Bureau describes them: “Detailed Tables contain the most detailed cross-tabulations, many of which are published down to block groups. The data are population counts. There are over 20,000 variables in this dataset.

Subject Tables provide an overview of the estimates available in a particular topic. The data are presented as population counts and percentages. There are over 18,000 variables in this dataset.

Data Profiles contain broad social, economic, housing, and demographic information. The data are presented as population counts and percentages. There are over 1,000 variables in this dataset.

Comparison Profiles are similar to Data Profiles but also include comparisons with past-year data. The current year data are compared with prior 5-Year data and include statistical significance testing. There are over 1,000 variables in this dataset.”

ACS Detailed Tables

Get total population and median income for places (towns, cities, etc) in Indiana.

acs_income <- getCensus(
    name = "acs/acs5",
    vintage = 2020, 
    vars = c("NAME", "B01001_001E", "B19013_001E"), 
    region = "place:*",
    regionin = "state:18")
head(acs_income)
state place NAME B01001_001E B19013_001E
18 49932 Mishawaka city, Indiana 49675 44792
18 49950 Mitchell city, Indiana 4272 43598
18 50058 Modoc town, Indiana 161 37750
18 50148 Monon town, Indiana 1650 44904
18 50202 Monroe town, Indiana 864 60625
18 50526 Monroe City town, Indiana 1027 57917

ACS Subject Tables

Get the percent of people without an internet subscription by income for the five counties of New York City, with associated margins of error:

  • overall: S2801_C02_019E
  • income less $20,000: S2801_C02_023E
  • income $20,000 to $74,999: S2801_C02_027E
  • income $75,000 or greater: S2801_C02_031E
acs_subject <- getCensus(
    name = "acs/acs1/subject",
    vintage = 2018, 
    vars = c("NAME", "S2801_C02_019E", "S2801_C02_019M",
                     "S2801_C02_023E", "S2801_C02_023M", 
                     "S2801_C02_027E", "S2801_C02_027M",
                     "S2801_C02_031E", "S2801_C02_031M"), 
    region = "county:005,047,061,081,085",
    regionin = "state:36")
head(acs_subject)
state county NAME S2801_C02_019E S2801_C02_019M S2801_C02_023E S2801_C02_023M S2801_C02_027E S2801_C02_027M S2801_C02_031E S2801_C02_031M
36 081 Queens County, New York 13.6 0.6 35.7 2.3 15.6 1.1 5.5 0.6
36 061 New York County, New York 12.6 0.8 36.6 2.7 15.9 1.8 3.3 0.6
36 005 Bronx County, New York 21.3 1.0 39.0 2.5 17.4 1.4 6.8 1.2
36 047 Kings County, New York 17.2 0.6 39.7 1.8 18.5 1.0 5.6 0.5
36 085 Richmond County, New York 16.3 1.5 40.7 6.4 22.8 3.6 6.4 1.8

ACS Comparison Profiles

Get the annual median household income in inflation-adjusted 2019 dollars for Alabama cities for the past five years.

acs_comparison <- getCensus(
    name = "acs/acs1/cprofile",
    vintage = 2019, 
    vars = c("NAME", "CP03_2015_062E", "CP03_2016_062E", "CP03_2017_062E", "CP03_2018_062E"), 
    region = "place:*",
    regionin = "state:01")
head(acs_comparison)
state place NAME CP03_2015_062E CP03_2016_062E CP03_2017_062E CP03_2018_062E
01 50000 Mobile city, Alabama 41530 41963 42024 39349
01 77256 Tuscaloosa city, Alabama 46960 41950 49226 44314
01 51000 Montgomery city, Alabama 44702 44250 44303 49771
01 07000 Birmingham city, Alabama 34831 38529 35235 37055
01 35896 Hoover city, Alabama 83387 84004 87954 88899
01 21184 Dothan city, Alabama 47645 45112 45973 50156

ACS Migration Flows

American Community Survey Migration Flows documentation

Get the number of people who moved in and out of Los Angeles county by their origin or destination.

flows <- getCensus(
    name = "acs/flows",
    vintage = 2019,
    vars = c("MOVEDIN", "MOVEDOUT", "GEOID2", "FULL1_NAME", "FULL2_NAME"),
    region = "county:037",
    regionin = "state:06")
head(flows, n = 15L)
state county MOVEDIN MOVEDOUT GEOID2 FULL1_NAME FULL2_NAME
06 037 2585 NA NA Los Angeles County, California Africa
06 037 37932 NA NA Los Angeles County, California Asia
06 037 13073 NA NA Los Angeles County, California Central America
06 037 962 NA NA Los Angeles County, California Caribbean
06 037 9953 NA NA Los Angeles County, California Europe
06 037 312 NA NA Los Angeles County, California U.S. Island Areas
06 037 1774 NA NA Los Angeles County, California Northern America
06 037 2001 NA NA Los Angeles County, California Oceania and At Sea
06 037 4341 NA NA Los Angeles County, California South America
06 037 0 7 1003 Los Angeles County, California Baldwin County, Alabama
06 037 9 0 1009 Los Angeles County, California Blount County, Alabama
06 037 20 40 1015 Los Angeles County, California Calhoun County, Alabama
06 037 0 9 1031 Los Angeles County, California Coffee County, Alabama
06 037 0 60 1045 Los Angeles County, California Dale County, Alabama
06 037 0 16 1051 Los Angeles County, California Elmore County, Alabama

American Community Survey Language Statistics

American Community Survey Language Statistics documentation

Get the number of people in New York state who speak each language.

languages <- getCensus(
    name = "language",
    vintage = 2013,
    vars = c("EST", "LAN", "LANLABEL"),
    region = "state:36")
head(languages)
state EST LAN LANLABEL
36 2705225 625 Spanish
36 NA 627 Ladino
36 133535 620 French
36 5645 622 Patois
36 NA 624 Cajun
36 44980 629 Portuguese

Annual Survey of Entrepreneurs

Annual Survey of Entrepreneurs documentation

ase_csa <- getCensus(
    name = "ase/csa",
    vintage = 2014,
    vars = c("GEO_TTL", "NAICS2012", "NAICS2012_TTL", "EMPSZFI", "EMPSZFI_TTL", "FIRMPDEMP"),
    region = "us:*")
head(ase_csa)
us GEO_TTL NAICS2012 NAICS2012_TTL EMPSZFI EMPSZFI_TTL FIRMPDEMP
1 United States 00 Total for all sectors 001 All firms 5437782
1 United States 00 Total for all sectors 611 Firms with no employees 547115
1 United States 00 Total for all sectors 612 Firms with 1 to 4 employees 2768756
1 United States 00 Total for all sectors 620 Firms with 5 to 9 employees 950224
1 United States 00 Total for all sectors 630 Firms with 10 to 19 employees 585516
1 United States 00 Total for all sectors 641 Firms with 20 to 49 employees 376051
ase_cscb <- getCensus(
    name = "ase/cscb",
    vintage = 2014,
    vars = c("GEO_TTL", "NAICS2012_TTL", "ASECB", "ASECB_TTL", "SPOUSES", "SPOUSES_TTL", "YEAR", 
                     "FIRMPDEMP", "FIRMPDEMP_PCT", "RCPPDEMP", "RCPPDEMP_F", "RCPPDEMP_PCT", 
                     "EMP", "EMP_PCT", "PAYANN", "PAYANN_PCT", "FIRMPDEMP_S", "FIRMPDEMP_PCT_S", 
                     "RCPPDEMP_S", "RCPPDEMP_PCT_S", "EMP_S", "EMP_PCT_S", "PAYANN_S", "PAYANN_PCT_S"),
    region = "us:*")
head(ase_cscb)
us GEO_TTL NAICS2012_TTL ASECB ASECB_TTL SPOUSES SPOUSES_TTL YEAR FIRMPDEMP FIRMPDEMP_PCT RCPPDEMP RCPPDEMP_F RCPPDEMP_PCT EMP EMP_PCT PAYANN PAYANN_PCT FIRMPDEMP_S FIRMPDEMP_PCT_S RCPPDEMP_S RCPPDEMP_PCT_S EMP_S EMP_PCT_S PAYANN_S PAYANN_PCT_S
1 United States Total for all sectors 0000 All firms A1 All firms 2014 5437782 0.0 33036935112 NA 0.0 115129295 0.0 5640982990 0.0 0.0 0.0 0.5 0.0 0.3 0.0 0.3 0.0
1 United States Total for all sectors 0000 All firms MA Jointly owned but primarily operated by male spouse 2014 336310 30.7 603733952 NA 18.8 3015332 21.0 109460428 20.2 0.8 0.3 3.2 1.8 1.8 3.5 3.0 3.5
1 United States Total for all sectors 0000 All firms LZ Jointly owned and equally operated by spouses 2014 335149 30.6 493143589 NA 15.4 3303608 23.0 104343482 19.2 0.6 0.3 3.7 5.5 1.7 6.2 1.8 5.5
1 United States Total for all sectors 0000 All firms MB Jointly owned but primarily operated by female spouse 2014 96475 8.8 140228793 NA 4.4 850573 5.9 25984506 4.8 1.9 0.2 12.6 1.1 3.6 0.6 4.7 0.3
1 United States Total for all sectors 0000 All firms MC Not jointly owned by spouses 2014 328625 30.0 1966858366 NA 61.4 7222018 50.2 302838280 55.8 0.6 0.5 2.5 8.1 1.6 10.3 1.9 9.0
1 United States Total for all sectors 0000 All firms MD Total reporting 2014 1096559 100.0 3203964700 NA 100.0 14391531 100.0 542626696 100.0 0.2 0.0 1.8 0.0 0.9 0.0 1.3 0.0
ase_cscbo <- getCensus(
    name = "ase/cscbo",
    vintage = 2014,
    vars = c("GEO_TTL", "NAICS2012_TTL", "ASECBO", "ASECBO_TTL", "ACQBUS", "ACQBUS_TTL", 
                     "YEAR", "OWNPDEMP", "OWNPDEMP_PCT", "OWNPDEMP_S", "OWNPDEMP_PCT_S"),
    region = "us:*")
head(ase_cscbo)
us GEO_TTL NAICS2012_TTL ASECBO ASECBO_TTL ACQBUS ACQBUS_TTL YEAR OWNPDEMP OWNPDEMP_PCT OWNPDEMP_S OWNPDEMP_PCT_S
1 United States Total for all sectors 00 All owners of respondent firms CA Founded or started 2014 4063687 70.4 0.2 0.3
1 United States Total for all sectors 00 All owners of respondent firms CB Purchased 2014 1211902 21.0 0.5 0.2
1 United States Total for all sectors 00 All owners of respondent firms CC Inherited 2014 227408 3.9 1.7 0.1
1 United States Total for all sectors 00 All owners of respondent firms CD Transfer of ownership or gift 2014 405356 7.0 0.6 0.1
1 United States Total for all sectors 00 All owners of respondent firms CE Total reporting 2014 5768389 100.0 0.2 0.0
1 United States Total for all sectors 00 All owners of respondent firms CF Item not reported 2014 14476 0.0 7.3 0.0

Annual Survey of Manufactures

Annual Survey of Manufactures documentation

asm_state <- getCensus(
    name = "timeseries/asm/state",
    vars = c("GEO_TTL", "NAICS_TTL", "EMP"),
    region = "state:*",
    time = 2016,
    naics = "31-33")
head(asm_state)
time state GEO_TTL NAICS_TTL EMP NAICS
2016 01 Alabama Manufacturing 234803 31-33
2016 02 Alaska Manufacturing 12178 31-33
2016 56 Wyoming Manufacturing 8377 31-33
2016 04 Arizona Manufacturing 136946 31-33
2016 05 Arkansas Manufacturing 145733 31-33
2016 06 California Manufacturing 1119896 31-33
asm_product <- getCensus(
    name = "timeseries/asm/product",
    vars = c("PSCODE_TTL", "GEO_TTL", "PRODVAL"),
    region = "us:*",
    time = 2016,
    pscode = 311111)
head(asm_product)
time us PSCODE_TTL GEO_TTL PRODVAL PSCODE
2016 1 Dog and cat food manufacturing United States 22933334 311111

County Business Patterns and Nonemployer Statistics

County Business Patterns and Nonemployer Statistics documentation

County Business Patterns

County Business Patterns documentation

Get employment data for the construction industry.

cbp <- getCensus(
    name = "cbp",
    vintage = 2020,
    vars = c("EMP", "ESTAB"),
    region = "state:*",
    NAICS2017 = 23)
head(cbp)
state EMP ESTAB NAICS2017
28 45342 3879 23
29 132302 13640 23
30 29453 5909 23
41 108291 13885 23
26 165921 19831 23
27 134064 16938 23

Get the number of companies and employees at organizations with more than 1,000 employees (EMPSZES = 260).

cbp_large_companies <- getCensus(
    name = "cbp",
    vintage = 2020,
    vars = c("NAME", "EMP", "ESTAB"),
    region = "state:*",
    EMPSZES = 260)
head(cbp_large_companies)
state NAME EMP ESTAB EMPSZES
28 Mississippi 123549 54 260
29 Missouri 385553 154 260
30 Montana 22451 13 260
53 Washington 466849 179 260
08 Colorado 364415 146 260
25 Massachusetts 655117 258 260

Zip Codes Business Patterns

Zip Codes Business Patterns documentation

zbp_2018 <- getCensus(
    name = "zbp",
    vintage = 2018,
    vars = c("EMP", "ESTAB", "EMPSZES"),
    region = "zipcode:90210")
head(zbp_2018)
zip_code EMP ESTAB EMPSZES
90210 35324 2496 001
90210 0 1758 210
90210 0 322 220
90210 0 199 230
90210 0 137 241
90210 0 50 242

Nonemployer statistics

Nonemployer statistics documentation

nonemp <- getCensus(
    name = "nonemp",
    vintage = 2016,
    vars = c("GEO_TTL", "NRCPTOT", "NAICS2012_TTL"),
    region = "state:*",
    naics2012 = 54)
head(nonemp)
state GEO_TTL NRCPTOT NAICS2012_TTL NAICS2012
01 Alabama 1284130 Professional, scientific, and technical services 54
02 Alaska 265996 Professional, scientific, and technical services 54
04 Arizona 2991782 Professional, scientific, and technical services 54
05 Arkansas 616936 Professional, scientific, and technical services 54
06 California 28746664 Professional, scientific, and technical services 54
08 Colorado 3709131 Professional, scientific, and technical services 54

Decennial Census

Decennial Census documentation

Using the 2020 Decennial Census redistricting file, get the total population for places in Arkansas.

data2020 <- getCensus(
    name = "dec/pl",
    vintage = 2020,
    vars = c("NAME", "P1_001N"), 
    region = "place:*",
    regionin = "state:05")
head(data2020)
state place NAME P1_001N
05 00190 Acorn CDP, Arkansas 376
05 00250 Adona city, Arkansas 149
05 00580 Alexander city, Arkansas 3385
05 00700 Alicia town, Arkansas 143
05 00730 Alix CDP, Arkansas 100
05 00820 Alleene CDP, Arkansas 97

Get total population and the number of housing units for metropolitan/micropolitan statistical areas in 2010.

data2010 <- getCensus(
    name = "dec/sf1",
    vintage = 2010,
    vars = c("NAME", "P001001", "H010001"), 
    region = "metropolitan statistical area/micropolitan statistical area:*")
head(data2010)
metropolitan_statistical_area_micropolitan_statistical_area NAME P001001 H010001
31540 Madison, WI Metro Area 568593 554078
31580 Madisonville, KY Micro Area 46920 45834
36820 Oskaloosa, IA Micro Area 22381 21722
36860 Ottawa-Streator, IL Micro Area 154908 151500
36900 Ottumwa, IA Micro Area 35625 34758
36940 Owatonna, MN Micro Area 36576 35982

Get the urban/rural status group of variables (P2) by metropolitan/micropolitan statistical areas in 2010.

# Show variable metadata for the P2 group
group_p2 <- listCensusMetadata(
    name = "dec/sf1",
    vintage = 2010,
    type = "variables",
    group = "P2")

# Get the P2 variable group (URBAN AND RURAL)
data2010 <- getCensus(
    name = "dec/sf1",
    vintage = 2010,
    vars = "group(P2)", 
    region = "metropolitan statistical area/micropolitan statistical area:*")
head(data2010)
metropolitan_statistical_area_micropolitan_statistical_area GEO_ID P002001 P002002 P002003 P002004 P002005 P002006 NAME P002001ERR
31540 310M100US31540 568593 455002 401661 53341 113591 0 Madison, WI Metro Area NA
31580 310M100US31580 46920 24809 0 24809 22111 0 Madisonville, KY Micro Area NA
36820 310M100US36820 22381 12545 0 12545 9836 0 Oskaloosa, IA Micro Area NA
36860 310M100US36860 154908 94406 0 94406 60502 0 Ottawa-Streator, IL Micro Area NA
36900 310M100US36900 35625 24771 0 24771 10854 0 Ottumwa, IA Micro Area NA
36940 310M100US36940 36576 25394 0 25394 11182 0 Owatonna, MN Micro Area NA

Get 2010 population by block group within a specific tract.

tract_pop <- getCensus(
    name = "dec/sf1",
    vintage = 2010,
    vars = "P001001", 
    region = "block:*",
    regionin = "state:36+county:027+tract:010000")
head(tract_pop)
state county tract block P001001
36 027 010000 1000 31
36 027 010000 1011 17
36 027 010000 1028 41
36 027 010000 1001 0
36 027 010000 1031 0
36 027 010000 1002 4

Decennial Census Self-Response Rates

Decennial Census Self-Response Rates documentation Get self-response rates for the 2020 and 2010 Decennial Census by state, county, tract, place and more.

Get overall and internet repose rates for all counties.

county_responses <- getCensus(
    name = "dec/responserate",
    vintage = 2020,
    vars = c("NAME", "RESP_DATE", "CRRALL", "CRRINT"),
    region = "county:*")
head(county_responses)
state county NAME RESP_DATE CRRALL CRRINT
21 137 Lincoln County, Kentucky 2021-01-29 69.1 26.7
21 139 Livingston County, Kentucky 2021-01-29 62.6 32.7
21 143 Lyon County, Kentucky 2021-01-29 55.6 24.1
21 145 McCracken County, Kentucky 2021-01-29 71.9 56.7
21 149 McLean County, Kentucky 2021-01-29 63.8 26.2
21 151 Madison County, Kentucky 2021-01-29 72.2 60.3

Get response rates for places (cities, towns, etc) within New York state.

ny_place_responses <- getCensus(
    name = "dec/responserate",
    vintage = 2020,
    vars = c("NAME", "RESP_DATE", "CRRALL", "CRRINT"),
    region = "place:*",
    regionin = "state:36")
head(ny_place_responses)
state place NAME RESP_DATE CRRALL CRRINT
36 23745 Elba village, New York 2021-01-29 66.3 52.9
36 23965 Ellenville village, New York 2021-01-29 58.5 45.3
36 24075 Ellisburg village, New York 2021-01-29 52.6 18.1
36 24229 Elmira city, New York 2021-01-29 60.1 40.8
36 24295 Elmsford village, New York 2021-01-29 62.9 55.1
36 24515 Endicott village, New York 2021-01-29 58.4 45.1

Get final 2010 Decennial Census self-response rates.

county_responses_2010 <- getCensus(
    name = "dec/responserate",
    vintage = 2010,
    vars = c("NAME", "FSRR2010"),
    region = "county:*")
head(county_responses_2010)
state county NAME FSRR2010
01 001 Autauga County, Alabama 68.6
01 003 Baldwin County, Alabama 59.4
01 005 Barbour County, Alabama 55.2
01 007 Bibb County, Alabama 54.8
01 009 Blount County, Alabama 66.3
01 011 Bullock County, Alabama 34.0

Decennial Census Surname Files

Decennial Census Surname documentation

Get counts of the top 25 most popular surnames and share of each by race.

top_surnames <- getCensus(
    name = "surname",
    vintage = 2010,
    vars = c("NAME", "COUNT", "PROP100K", "PCTWHITE", "PCTBLACK", "PCTAIAN", "PCTAPI", "PCTHISPANIC", "PCT2PRACE"),
    RANK = "1:25")
head(top_surnames)
NAME COUNT PROP100K PCTWHITE PCTBLACK PCTAIAN PCTAPI PCTHISPANIC PCT2PRACE RANK
ANDERSON 784404 265.92 75.17 18.93 0.74 0.61 2.44 2.11 15
BROWN 1437026 487.16 57.95 35.6 0.87 0.51 2.52 2.55 4
DAVIS 1116357 378.45 62.2 31.6 0.82 0.49 2.44 2.45 8
GARCIA 1166120 395.32 5.38 0.45 0.47 1.41 92.03 0.26 6
GONZALEZ 841025 285.11 4.03 0.35 0.14 0.38 94.97 0.13 13
HARRIS 624252 211.63 51.4 42.39 0.67 0.47 2.26 2.80 25

Economic Census

Economic Census documentation

ewks_2012 <- getCensus(
    name = "ewks",
    vintage = 2012,
    vars = c("EMP", "OPTAX", "GEOTYPE"),
    region = "state:*",
    naics2012 = 54)
head(ewks_2012)
state EMP OPTAX GEOTYPE NAICS2012
01 89988 A 02 54
01 88566 T 02 54
01 1422 Y 02 54
02 17648 A 02 54
08 4616 Y 02 54
02 17328 T 02 54
ewks_2007 <- getCensus(
    name = "ewks",
    vintage = 2007,
    vars = c("EMP", "OPTAX", "GEOTYPE"),
    region = "state:*",
    naics2007 = 54)
head(ewks_2007)
state EMP OPTAX GEOTYPE NAICS2007
01 94051 A 2 54
01 92759 T 2 54
01 1292 Y 2 54
02 12843 A 2 54
02 12509 T 2 54
02 334 Y 2 54

Economic Indicators

Economic Indicators documentation

eits <- getCensus(
    name = "timeseries/eits/resconst",
    vars = c("cell_value", "data_type_code", "time_slot_id", "error_data", "category_code", "seasonally_adj"),
    region = "us:*",
    time = "from 2004-05 to 2012-12")
head(eits)
cell_value data_type_code time_slot_id error_data category_code seasonally_adj time us
367 MULTI 653 no ACOMPLETIONS yes 2004-05 1
1893 TOTAL 653 no ACOMPLETIONS yes 2004-05 1
1505 SINGLE 653 no ACOMPLETIONS yes 2004-05 1
11 E_MULTI 653 yes ACOMPLETIONS yes 2004-05 1
4 E_TOTAL 653 yes ACOMPLETIONS yes 2004-05 1
4 E_SINGLE 653 yes ACOMPLETIONS yes 2004-05 1

Health Insurance: Small Area Health Insurance Estimates

Health Insurance Statistics documentation

Get the uninsured rate by income group for each county for a single year.

sahie <- getCensus(
    name = "timeseries/healthins/sahie",
    vars = c("NAME", "IPRCAT", "IPR_DESC", "PCTUI_PT"),
    region = "county:*",
    year = 2019)
head(sahie)
state county NAME IPRCAT IPR_DESC PCTUI_PT YEAR
01 001 Autauga County, AL 0 All Incomes 9.4 2019
01 001 Autauga County, AL 1 <= 200% of Poverty 17.3 2019
01 001 Autauga County, AL 2 <= 250% of Poverty 16.3 2019
01 001 Autauga County, AL 3 <= 138% of Poverty 18.5 2019
01 001 Autauga County, AL 4 <= 400% of Poverty 12.8 2019
01 001 Autauga County, AL 5 138% to 400% of Poverty 10.2 2019

Get the uninsured rate for a county for multiple years.

sahie_annual <- getCensus(
    name = "timeseries/healthins/sahie",
    vars = c("NAME", "PCTUI_PT"),
    region = "county:037",
    regionin = "state:06",
    year = "2006:2019")
sahie_annual
state county NAME PCTUI_PT YEAR
06 037 Los Angeles County, CA 23.8 2006
06 037 Los Angeles County, CA 23.1 2007
06 037 Los Angeles County, CA 23.8 2008
06 037 Los Angeles County, CA 24.9 2009
06 037 Los Angeles County, CA 25.9 2010
06 037 Los Angeles County, CA 24.8 2011
06 037 Los Angeles County, CA 24.5 2012
06 037 Los Angeles County, CA 23.7 2013
06 037 Los Angeles County, CA 17.4 2014
06 037 Los Angeles County, CA 12.5 2015
06 037 Los Angeles County, CA 10.7 2016
06 037 Los Angeles County, CA 10.1 2017
06 037 Los Angeles County, CA 10.2 2018
06 037 Los Angeles County, CA 11.1 2019

Get the uninsured rate for non-elderly adults (AGECAT = 1) with incomes of 138 to 400% of the poverty line (IPRCAT = 5), by race and state.

sahie_nonelderly <- getCensus(
    name = "timeseries/healthins/sahie",
    vars = c("NAME", "PCTUI_PT", "RACECAT", "RACE_DESC"), 
    region = "state:*", 
    year = 2019,
    IPRCAT = 5,
    AGECAT = 1)
head(sahie_nonelderly)
state NAME PCTUI_PT RACECAT RACE_DESC YEAR IPRCAT AGECAT
01 Alabama 16.0 0 All Races 2019 5 1
01 Alabama 14.5 1 White alone, not Hispanic 2019 5 1
01 Alabama 15.8 2 Black alone, not Hispanic 2019 5 1
01 Alabama 36.1 3 Hispanic (any race) 2019 5 1
02 Alaska 21.1 0 All Races 2019 5 1
02 Alaska 16.4 1 White alone, not Hispanic 2019 5 1

International Data Base

International Data Base documentation

Get Census Bureau projections of 2020 populations and life expectancy at birth by country.

intl_pop <- getCensus(
    name = "timeseries/idb/5year",
    vars = c("NAME", "FIPS", "POP", "E0"),
    time = 2020)
head(intl_pop)
time NAME FIPS POP E0
2020 Andorra AN 85722 83.03
2020 United Arab Emirates AE 9792173 79.17
2020 Afghanistan AF 36594776 52.84
2020 Antigua and Barbuda AC 98012 77.31
2020 Anguilla AV 18066 81.79
2020 Albania AL 3080930 78.99

Get predictions of population by age in 2050 for Norway for ages 10-18. https://api.census.gov/data/timeseries/idb/1year?get=AREA_KM2,NAME,AGE,POP&FIPS=NO&time=2050

norway_pop <- getCensus(
    name = "timeseries/idb/1year",
    vars = c("NAME", "POP"),
    time = 2050,
    FIPS = "NO",
    AGE = "10:18")
head(norway_pop)
time NAME POP FIPS AGE
2050 Norway 66797 NO 10
2050 Norway 66877 NO 11
2050 Norway 66975 NO 12
2050 Norway 67090 NO 13
2050 Norway 67258 NO 14
2050 Norway 67513 NO 15

International Trade

International Trade documentation

Note: The international trade datasets are buggy and frequently give the general error message of “There was an error while running your query. We’ve logged the error and we’ll correct it ASAP. Sorry for the inconvenience.” This error message comes from the U.S. Census Bureau. If you run in to repeated issues or inconsistencies, contact the Census Bureau for help or consider using a bulk data download instead.

Get the general imports value and imports for consumption value for all end-use codes and all countries for January 2018.

imports <- getCensus(
    name = "timeseries/intltrade/imports/enduse",
    vars = c("CTY_CODE", "CTY_NAME", "I_ENDUSE", "I_ENDUSE_LDESC", "GEN_VAL_MO", "CON_VAL_MO"),
    time = "2018-01")
head(imports)
time CTY_CODE CTY_NAME I_ENDUSE I_ENDUSE_LDESC GEN_VAL_MO CON_VAL_MO
2018-01 - TOTAL FOR ALL COUNTRIES - TOTAL IMPORTS FOR ALL END-USE CODES 203028883846 201363447994
2018-01 0001 OPEC - TOTAL IMPORTS FOR ALL END-USE CODES 5811776722 5077058800
2018-01 0003 EUROPEAN UNION - TOTAL IMPORTS FOR ALL END-USE CODES 32324828722 32147782489
2018-01 0014 PACIFIC RIM COUNTRIES - TOTAL IMPORTS FOR ALL END-USE CODES 75627219017 74486177148
2018-01 0017 CAFTA-DR - TOTAL IMPORTS FOR ALL END-USE CODES 1745667404 1730840561
2018-01 0020 NAFTA - TOTAL IMPORTS FOR ALL END-USE CODES 51972571108 51987882777

Population Estimates and Projections

Population Estimates and Projections documentation

Population Estimates

Population Estimates documentation Note that variable names and data structure in the PEP APIs are not always consistent from year to year.

popest <- getCensus(
    name = "pep/population",
    vintage = 2019,
    vars = c("POP", "DATE_DESC"),
    region = "state:*")
head(popest)
state POP DATE_DESC
01 4903185 7/1/2019 population estimate
02 731545 7/1/2019 population estimate
04 7278717 7/1/2019 population estimate
05 3017804 7/1/2019 population estimate
06 39512223 7/1/2019 population estimate
08 5758736 7/1/2019 population estimate
popest_housing <- getCensus(
    name = "pep/housing",
    vintage = 2018,
    vars = c("DATE_CODE", "DATE_DESC", "HUEST"),
    region = "county:195",
    regionin = "state:02")
head(popest_housing)
state county DATE_CODE DATE_DESC HUEST
02 195 1 4/1/2010 Census housing unit count 1994
02 195 2 4/1/2010 housing unit estimates base 1644
02 195 3 7/1/2010 housing unit estimate 1646
02 195 4 7/1/2011 housing unit estimate 1647
02 195 5 7/1/2012 housing unit estimate 1659
02 195 6 7/1/2013 housing unit estimate 1662

Population Projections

Population Projections documentation

popproj <- getCensus(
    name = "pep/projpop",
    vintage = 2014,
    vars = c("YEAR", "POP", "AGE"),
    region = "us:1")
head(popproj)
us YEAR POP AGE
1 2014 3971847 0
1 2014 3957864 1
1 2014 3972081 2
1 2014 4003272 3
1 2014 4001929 4
1 2014 4002977 5

Poverty Statistics

Poverty Statistics documentation

Current Population Survey Poverty Statistics

Get national poverty rates by race for the past 50 years.

poverty <- getCensus(
    name = "timeseries/poverty/histpov2",
    vars = c("RACE", "PCTPOV"),
    region = "us:*",
    time = "from 1970 to 2020")
head(poverty)
time us RACE PCTPOV
2020 1 1 11.4
2020 1 2 10.1
2020 1 4 8.2
2020 1 6 19.3
2020 1 7 19.5
2020 1 9 8.0

Small Area Income and Poverty Estimates (SAIPE)

Get poverty rate for children and overall for a single year.

saipe <- getCensus(
    name = "timeseries/poverty/saipe",
    vars = c("NAME", "SAEPOVRT0_17_PT", "SAEPOVRTALL_PT"),
    region = "state:*",
    year = 2019)
head(saipe)
state NAME SAEPOVRT0_17_PT SAEPOVRTALL_PT YEAR
01 Alabama 21.9 15.6 2019
02 Alaska 13.2 10.2 2019
04 Arizona 19.2 13.5 2019
05 Arkansas 21.7 16.0 2019
06 California 15.6 11.8 2019
08 Colorado 11.2 9.4 2019

Get the poverty rate for children and overall in a single county over time.

saipe_years <- getCensus(
    name = "timeseries/poverty/saipe",
    vars = c("NAME", "SAEPOVRT0_17_PT", "SAEPOVRTALL_PT"),
    region = "county:001",
    regionin = "state:12",
    year = "2000:2019")
head(saipe_years)
state county NAME SAEPOVRT0_17_PT SAEPOVRTALL_PT YEAR
12 001 Alachua County 17.4 14.7 2000
12 001 Alachua County 18.3 15.1 2001
12 001 Alachua County 17.6 15.1 2002
12 001 Alachua County 19.8 16.2 2003
12 001 Alachua County 16.9 14.5 2004
12 001 Alachua County 22.8 21.8 2005

SAIPE School Districts

Get the number (SAEPOV5_17V_PT) and rate (SAEPOVRAT5_17RV_PT) of children ages 5-17 living in poverty for unified school districts in Massachusetts.

saipe_schools <- getCensus(
    name = "timeseries/poverty/saipe/schdist",
    vars = c("SD_NAME", "SAEPOV5_17V_PT", "SAEPOVRAT5_17RV_PT"),
    region = "school district (unified):*",
    regionin = "state:25",
    year = 2019)
head(saipe_schools)
state school_district_unified SD_NAME SAEPOV5_17V_PT SAEPOVRAT5_17RV_PT YEAR
25 00001 Quabbin School District 2852 7.9 2019
25 00002 Spencer-East Brookfield School District 2073 9.9 2019
25 00013 Southwick-Tolland-Granville Regional School District 1847 7.1 2019
25 00067 Manchester Essex Regional School District 1555 3.9 2019
25 00542 Ayer-Shirley School District 2173 5.6 2019
25 00544 Monomoy Regional School District 1744 11.1 2019

Public Sector Statistics

Public Sector Statistics documentation

This endpoint includes data from multiple surveys organized be sure to read the Census Bureau’s documentation for variable definitions and labels.

Get expenditures for Public Elementary-Secondary School System Finances for Massachusetts.

govs <- getCensus(
    name = "timeseries/govs",
    vars = c("SVY_COMP_LABEL", "AGG_DESC", "AGG_DESC_LABEL" ,"AMOUNT"),
    region = "state:25",
    year = "2020",
    SVY_COMP = "06",
    EXPENDTYPE = "001")
head(govs)
state SVY_COMP_LABEL AGG_DESC AGG_DESC_LABEL AMOUNT YEAR SVY_COMP EXPENDTYPE
25 Annual Survey of School System Finance SS0601 Total current spending 18243103 2020 06 001
25 Annual Survey of School System Finance SS0604 Current spending - Instruction - Total 11837313 2020 06 001
25 Annual Survey of School System Finance SS0610 Current spending - All other functions 506940 2020 06 001
25 Annual Survey of School System Finance SS0708 Current spending - Support services - Other and nonspecified support services 388291 2020 06 001
25 Annual Survey of School System Finance SS0701 Current spending - Support services - Total 5898850 2020 06 001
25 Annual Survey of School System Finance SS0702 Current spending - Support services - Pupil support services 1469771 2020 06 001

Quarterly Workforce Indicators

Quarterly Workforce Indicators documentation

The QWI endpoints allow both simple calls and very specific ones. Make sure to read the documentation closely. Here’s a simple call that gets employment data by county.

qwi_counties <- getCensus(
    name = "timeseries/qwi/sa",
    vars = c("Emp", "EarnBeg"),
    region = "county:*",
    regionin = "state:01",
    time = "2016-Q1")
head(qwi_counties)
Emp EarnBeg time state county
11366 2751 2016-Q1 01 001
66146 2643 2016-Q1 01 003
7840 2570 2016-Q1 01 005
4008 2921 2016-Q1 01 007
8127 2647 2016-Q1 01 009
2684 2387 2016-Q1 01 011

Got total employment and average earnings by quarter for a single state.

qwi_time <- getCensus(
    name = "timeseries/qwi/sa",
    vars = c("Emp", "EarnBeg"),
    region = "state:01",
    time = "from 2018 to 2022")
head(qwi_time)
Emp EarnBeg time state
1881745 3515 2018-Q1 01
1891438 3471 2018-Q2 01
1911704 3434 2018-Q3 01
1908636 3687 2018-Q4 01
1913671 3597 2019-Q1 01
1919022 3578 2019-Q2 01

Here’s a much more specific call. Read the Census Bureau’s documentation closely to see all of the options allowed by the QWI APIs.

qwi <- getCensus(
    name = "timeseries/qwi/sa",
    region = "state:02",
    vars = c("Emp", "sex"),
    time = 2012,
    quarter = 1,
    agegrp = "A07",
    ownercode = "A05",
    firmsize = 1,
    seasonadj = "U",
    industry = 21)
qwi
Emp sex time quarter agegrp ownercode firmsize seasonadj industry state
54 0 2012-Q1 1 A07 A05 1 U 21 02
48 1 2012-Q1 1 A07 A05 1 U 21 02
6 2 2012-Q1 1 A07 A05 1 U 21 02

The Planning Database

The Planning Database documentation Get population and 2010 Census mail return rates for block groups in Autauga County, AL.

pdb <- getCensus(
    name = "pdb/blockgroup",
    vintage = 2018,
    vars = c("GIDBG", "County_name", "State_name", "Tot_Population_CEN_2010", "Mail_Return_Rate_CEN_2010"),
    region = "block group:*",
    regionin = "state:01+county:001")
head(pdb)
County_name State_name Tot_Population_CEN_2010 Mail_Return_Rate_CEN_2010 state county tract block_group GIDBG
Autauga County Alabama 570 79.7 01 001 020400 4 10010204004
Autauga County Alabama 1737 84.6 01 001 020500 1 10010205001
Autauga County Alabama 7023 72.8 01 001 020500 2 10010205002
Autauga County Alabama 2006 86.0 01 001 020500 3 10010205003
Autauga County Alabama 2423 87.8 01 001 020600 1 10010206001
Autauga County Alabama 1245 73.4 01 001 020600 2 10010206002