The Census APIs have over 200 endpoints, covering dozens of different datasets.

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

apis <- listCensusApis()
View(apis)

Here is a list of examples for dozens of the Census’s API endpoints. Read more about discovering an API’s variable and geography options in Getting started with censusapi

American Community Survey

ACS Detailed Tables

Get median household income, with associated annotations and margin of error, for census tracts in Alaska.

acs_income <- getCensus(
    name = "acs/acs5",
    vintage = 2018, 
    vars = c("NAME", "B19013_001E", "B19013_001EA", "B19013_001M", "B19013_001MA"), 
    region = "tract:*",
    regionin = "state:02")
head(acs_income)
state county tract NAME B19013_001E B19013_001EA B19013_001M B19013_001MA
02 068 000100 Census Tract 1, Denali Borough, Alaska 84196 NA 7160 NA
02 261 000200 Census Tract 2, Valdez-Cordova Census Area, Alaska 85933 NA 5274 NA
02 261 000300 Census Tract 3, Valdez-Cordova Census Area, Alaska 92813 NA 19527 NA
02 261 000100 Census Tract 1, Valdez-Cordova Census Area, Alaska 52419 NA 11601 NA
02 122 000200 Census Tract 2, Kenai Peninsula Borough, Alaska 56838 NA 6437 NA
02 122 000800 Census Tract 8, Kenai Peninsula Borough, Alaska 53882 NA 2985 NA

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 005 Bronx County, New York 21.3 1.0 39.0 2.5 17.4 1.4 6.8 1.2
36 061 New York County, New York 12.6 0.8 36.6 2.7 15.9 1.8 3.3 0.6
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 Data Profile

acs_profile <- getCensus(
    name = "acs/acs1/profile",
    vintage = 2018, 
    vars = "group(DP05)", 
    region = "region:*")

ACS Comparison Profiles

Get the mean travel time to work (in minutes) for the past five years.

acs_comparison <- getCensus(
    name = "acs/acs1/cprofile",
    vintage = 2017, 
    vars = c("NAME", "CP03_2013_025E", "CP03_2014_025E", "CP03_2015_025E", "CP03_2016_025E", "CP03_2017_025E"), 
    region = "metropolitan statistical area/micropolitan statistical area:*")
head(acs_comparison)
metropolitan_statistical_area_micropolitan_statistical_area NAME CP03_2013_025E CP03_2014_025E CP03_2015_025E CP03_2016_025E CP03_2017_025E
10140 Aberdeen, WA Micro Area 24.0 25.0 23.3 26.5 29.6
10180 Abilene, TX Metro Area 16.9 17.0 15.6 19.1 18.3
10300 Adrian, MI Micro Area 25.4 26.8 29.6 25.3 27.7
10380 Aguadilla-Isabela, PR Metro Area 26.0 24.8 25.3 23.9 25.2
10420 Akron, OH Metro Area 23.1 22.9 24.3 22.9 23.2
10460 Alamogordo, NM Micro Area 18.3 18.4 17.7 20.4 17.3

ACS Migration Flows

American Community Survey Migration Flows documentation

flows <- getCensus(
    name = "acs/flows",
    vintage = 2016,
    vars = c("MOVEDIN", "MOVEDOUT", "FULL1_NAME", "FULL2_NAME", "GEOID2"),
    region = "county:001",
    regionin = "state:01")
head(flows)
state county MOVEDIN MOVEDOUT FULL1_NAME FULL2_NAME GEOID2
01 001 70 NA Autauga County, Alabama Asia NA
01 001 51 NA Autauga County, Alabama Europe NA
01 001 36 126 Autauga County, Alabama Baldwin County, Alabama 1003
01 001 4 0 Autauga County, Alabama Barbour County, Alabama 1005
01 001 7 135 Autauga County, Alabama Bibb County, Alabama 1007
01 001 4 0 Autauga County, Alabama Blount County, Alabama 1009

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
00 United States 00 Total for all sectors 001 All firms 5437782
00 United States 00 Total for all sectors 611 Firms with no employees 547115
00 United States 00 Total for all sectors 612 Firms with 1 to 4 employees 2768756
00 United States 00 Total for all sectors 620 Firms with 5 to 9 employees 950224
00 United States 00 Total for all sectors 630 Firms with 10 to 19 employees 585516
00 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
00 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
00 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
00 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
00 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
00 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
00 United States Total for all sectors 0000 All firms ME Item not reported 2014 2733098 0.0 4926927597 NA 0.0 25408994 0.0 1074761744 0.0 0.2 0.0 1.7 0.0 0.6 0.0 0.6 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
00 United States Total for all sectors 00 All owners of respondent firms CA Founded or started 2014 4063687 70.4 0.2 0.3
00 United States Total for all sectors 00 All owners of respondent firms CB Purchased 2014 1211902 21 0.5 0.2
00 United States Total for all sectors 00 All owners of respondent firms CC Inherited 2014 227408 3.9 1.7 0.1
00 United States Total for all sectors 00 All owners of respondent firms CD Transfer of ownership or gift 2014 405356 7 0.6 0.1
00 United States Total for all sectors 00 All owners of respondent firms CE Total reporting 2014 5768389 100 0.2 0
00 United States Total for all sectors 00 All owners of respondent firms CF Item not reported 2014 14476 0 7.3 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_2018 <- getCensus(
    name = "cbp",
    vintage = 2018,
    vars = c("EMP", "ESTAB"),
    region = "state:*",
    NAICS2017 = 23)
head(cbp_2018)
state EMP ESTAB NAICS2017
31 49552 6527 23
28 43156 3890 23
29 129188 13540 23
30 26859 5656 23
32 80043 5146 23
33 29049 4245 23

Get employment data by state for companies with more than 1,000 employees.

cbp_2008 <- getCensus(
    name = "cbp",
    vintage = 2008,
    vars = c("YEAR", "GEO_TTL", "EMPSZES_TTL", "EMP", "ESTAB", "PAYANN"),
    region = "state:*",
    EMPSZES = 260)
head(cbp_2008)
state YEAR GEO_TTL EMPSZES_TTL EMP ESTAB PAYANN EMPSZES
01 2008 Alabama Establishments with 1,000 employees or more 175438 96 8034522 260
02 2008 Alaska Establishments with 1,000 employees or more 22598 16 1469718 260
78 2008 Virgin Islands of the United States Establishments with 1,000 employees or more 0 1 0 260
04 2008 Arizona Establishments with 1,000 employees or more 301091 124 17089056 260
05 2008 Arkansas Establishments with 1,000 employees or more 124452 68 4796665 260
06 2008 California Establishments with 1,000 employees or more 1872632 797 124024587 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 Total population and 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 reponse 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 2020-10-28 69.1 26.7
21 139 Livingston County, Kentucky 2020-10-28 62.6 32.7
21 143 Lyon County, Kentucky 2020-10-28 55.6 24.1
21 145 McCracken County, Kentucky 2020-10-28 71.9 56.7
21 149 McLean County, Kentucky 2020-10-28 63.8 26.2
21 151 Madison County, Kentucky 2020-10-28 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 2020-10-28 66.3 52.9
36 23965 Ellenville village, New York 2020-10-28 58.5 45.3
36 24075 Ellisburg village, New York 2020-10-28 52.6 18.1
36 24229 Elmira city, New York 2020-10-28 60.1 40.7
36 24295 Elmsford village, New York 2020-10-28 62.9 55.0
36 24515 Endicott village, New York 2020-10-28 58.3 45.0

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 Statistics

Health Insurance Statistics documentation

Get the uninsured rate by income group in Alabama for a single year.

sahie <- getCensus(
    name = "timeseries/healthins/sahie",
    vars = c("NAME", "IPRCAT", "IPR_DESC", "PCTUI_PT"),
    region = "state:01",
    time = 2018)
head(sahie)
time state NAME IPRCAT IPR_DESC PCTUI_PT
2018 01 Alabama 0 All Incomes 11.9
2018 01 Alabama 1 <= 200% of Poverty 19.6
2018 01 Alabama 2 <= 250% of Poverty 18.5
2018 01 Alabama 3 <= 138% of Poverty 20.6
2018 01 Alabama 4 <= 400% of Poverty 15.5
2018 01 Alabama 5 138% to 400% of Poverty 12.5

Get the uninsured rate in Alabama for multiple years.

sahie_annual <- getCensus(
    name = "timeseries/healthins/sahie",
    vars = c("NAME", "PCTUI_PT"),
    region = "state:01",
    time = "from 2006 to 2018")
sahie_annual
time state NAME PCTUI_PT
2006 01 Alabama 15.7
2007 01 Alabama 14.6
2008 01 Alabama 15.3
2009 01 Alabama 15.8
2010 01 Alabama 16.9
2011 01 Alabama 16.6
2012 01 Alabama 15.8
2013 01 Alabama 15.9
2014 01 Alabama 14.2
2015 01 Alabama 11.9
2016 01 Alabama 10.8
2017 01 Alabama 11.0
2018 01 Alabama 11.9

Get the uninsured rate for non-elderly adults with incomes of 138 to 400% of the poverty line, by race and state.

sahie_nonelderly <- getCensus(
    name = "timeseries/healthins/sahie",
    vars = c("NAME", "IPR_DESC", "PCTUI_PT", "AGE_DESC", "RACECAT", "RACE_DESC"), 
    region = "state:*", 
    time = 2018,
    IPRCAT = 5,
    AGECAT = 1)
head(sahie_nonelderly)
time state NAME IPR_DESC PCTUI_PT AGE_DESC RACECAT RACE_DESC IPRCAT AGECAT
2018 01 Alabama 138% to 400% of Poverty 16.0 18 to 64 years 0 All Races 5 1
2018 01 Alabama 138% to 400% of Poverty 14.4 18 to 64 years 1 White alone, not Hispanic 5 1
2018 01 Alabama 138% to 400% of Poverty 15.9 18 to 64 years 2 Black alone, not Hispanic 5 1
2018 01 Alabama 138% to 400% of Poverty 37.5 18 to 64 years 3 Hispanic (any race) 5 1
2018 02 Alaska 138% to 400% of Poverty 22.5 18 to 64 years 0 All Races 5 1
2018 02 Alaska 138% to 400% of Poverty 18.5 18 to 64 years 1 White alone, not Hispanic 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 Aruba AA 119428 77.52
2020 Antigua and Barbuda AC 98179 77.31
2020 United Arab Emirates AE 9992083 78.99
2020 Afghanistan AF 36643815 52.84
2020 Algeria AG 42972878 77.54
2020 Azerbaijan AJ 10205810 73.58

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 66971 NO 10
2050 Norway 67018 NO 11
2050 Norway 67097 NO 12
2050 Norway 67199 NO 13
2050 Norway 67352 NO 14
2050 Norway 67605 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 203186767799 201524734942
2018-01 0001 OPEC - TOTAL IMPORTS FOR ALL END-USE CODES 6337094420 5573376643
2018-01 0003 EUROPEAN UNION - TOTAL IMPORTS FOR ALL END-USE CODES 36862681499 36655928596
2018-01 0014 PACIFIC RIM COUNTRIES - TOTAL IMPORTS FOR ALL END-USE CODES 75727333696 74587615456
2018-01 0017 CAFTA-DR - TOTAL IMPORTS FOR ALL END-USE CODES 1751485326 1736737434
2018-01 0020 NAFTA - TOTAL IMPORTS FOR ALL END-USE CODES 52035360959 52050679748

Population Estimates and Projections

Population Estimates and Projections documentation

Population Estimates

Population Estimates documentation Note that variable names 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
28 2976149 7/1/2019 population estimate
29 6137428 7/1/2019 population estimate
30 1068778 7/1/2019 population estimate
31 1934408 7/1/2019 population estimate
32 3080156 7/1/2019 population estimate
33 1359711 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 1968 to 2018")
head(poverty)
time us RACE PCTPOV
2018 1 1 11.8
2017 1 1 12.3
2017 1 1 12.3
2016 1 1 12.7
2015 1 1 13.5
2014 1 1 14.8

Small Area Income and Poverty Estimates

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:*",
    time = 2018)
head(saipe)
time state NAME SAEPOVRT0_17_PT SAEPOVRTALL_PT
2018 01 Alabama 23.9 16.8
2018 02 Alaska 14.5 11.1
2018 04 Arizona 20.4 14.1
2018 05 Arkansas 23.8 16.8
2018 06 California 17.4 12.8
2018 08 Colorado 12.1 9.7

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",
    time = "from 2000 to 2018")
head(saipe_years)
time state county NAME SAEPOVRT0_17_PT SAEPOVRTALL_PT
2000 12 001 Alachua County 17.4 14.7
2001 12 001 Alachua County 18.3 15.1
2002 12 001 Alachua County 17.6 15.1
2003 12 001 Alachua County 19.8 16.2
2004 12 001 Alachua County 16.9 14.5
2005 12 001 Alachua County 22.8 21.8

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",
    time = 2018)
head(saipe_schools)
time state school_district_unified SD_NAME SAEPOV5_17V_PT SAEPOVRAT5_17RV_PT
2018 25 00001 Quabbin School District 2871 4.7
2018 25 00002 Spencer-East Brookfield School District 2087 7.8
2018 25 00013 Southwick-Tolland-Granville Regional School District 1880 10.9
2018 25 00067 Manchester Essex Regional School District 1578 4.8
2018 25 00542 Ayer-Shirley School District 2191 10.2
2018 25 00544 Monomoy Regional School District 1785 8.3

Quarterly Workforce Indicators

Quarterly Workforce Indicators documentation

The allow both simple calls and very specfic 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
11389 2887 2016-Q1 01 001
65363 2648 2016-Q1 01 003
7592 2668 2016-Q1 01 005
4008 2853 2016-Q1 01 007
8024 2664 2016-Q1 01 009
2659 2543 2016-Q1 01 011

Employment data over time for a single state.

qwi_time <- getCensus(
    name = "timeseries/qwi/sa",
    vars = c("Emp", "EarnBeg"),
    region = "state:01",
    time = "from 2007 to 2017")
head(qwi_time)
Emp EarnBeg time state
1873162 2833 2007-Q1 01
1897715 2786 2007-Q2 01
1889780 2773 2007-Q3 01
1907646 2978 2007-Q4 01
1878593 2894 2008-Q1 01
1901380 2880 2008-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"),
    year = 2012,
    quarter = 1,
    agegrp = "A07",
    ownercode = "A05",
    firmsize = 1,
    seasonadj = "U",
    industry = 21)
qwi
Emp sex year quarter agegrp ownercode firmsize seasonadj industry state
52 0 2012 1 A07 A05 1 U 21 02
46 1 2012 1 A07 A05 1 U 21 02
6 2 2012 1 A07 A05 1 U 21 02

Survey of Business Owners

Survey of Business Owners documentation

sbo <- getCensus(
    name = "sbo",
    vintage = 2012,
    vars = c("GEO_TTL", "RCPSZFI", "RCPSZFI_TTL", "FIRMPDEMP"),
    region = "state:*")
head(sbo)
state GEO_TTL RCPSZFI RCPSZFI_TTL FIRMPDEMP
01 Alabama 522 Firms with sales/receipts of $50,000 to $99,999 5479
01 Alabama 523 Firms with sales/receipts of $100,000 to $249,999 13205
01 Alabama 525 Firms with sales/receipts of $250,000 to $499,999 12005
01 Alabama 531 Firms with sales/receipts of $500,000 to $999,999 10522
01 Alabama 532 Firms with sales/receipts of $1,000,000 or more 21053
01 Alabama 001 All firms 67449
sbo_groups <- getCensus(
    name = "sbo",
    vintage = 2012,
    vars = c("GEO_TTL", "RACE_GROUP", "RACE_GROUP_TTL", "FIRMPDEMP"),
    region = "county:*",
    regionin = "state:09")
head(sbo_groups)
state county GEO_TTL RACE_GROUP RACE_GROUP_TTL FIRMPDEMP
09 005 Litchfield County 00 All firms 3975
09 005 Litchfield County 30 White 3407
09 005 Litchfield County 40 Black or African American 3
09 005 Litchfield County 50 American Indian and Alaska Native 3
09 005 Litchfield County 60 Asian 107
09 005 Litchfield County 61 Asian Indian 53

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

Disclaimer

This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau.