Quarterly Census of Employment and Wages API

The QCEW Data Landscape

The Quarterly Census of Employment and Wages (QCEW) is a division of the BLS. Some QCEW time-series data is available via the main BLS API, but the QCEW also houses quarterly data on their own API. The QCEW API returns employment and wage statistics sliced by area, industry type, or industry size. For further documentation on the QCEW API, you can refer to the QCEW website.

The QCEW API

The QCEW API is structured differently than the main BLS API. For this reason, the blscrapeR package includes a function for extracting these data.

For example, if we wanted to gather the quarterly employment and wage information for the Software Publishing industry in Q1 of 2016, we could run the following code:

library(blscrapeR)
dat <- qcew_api(year=2021, qtr=1, slice="industry", sliceCode=10)

We can also get annual averages by passing "A" as an argument to qtr.

library(blscrapeR)
dat <- qcew_api(year=2021, qtr="A", slice="industry", sliceCode=10)

Function Arguments

Included Data Sets

The qcew_api() function accepts various codes in the sliceCode argument. The sliceCode that is used will depend on the slice we wish to see. There are three built-in data sets to help with our sliceCode selections.

Area Description Data (FIPS codes)

areaCodes <- blscrapeR::area_titles
head(areaCodes)

Industry Description Data (NIACS codes)

industryCodes <- blscrapeR::niacs
head(industryCodes)

Industry Size Data (Size codes)

sizeCodes <- blscrapeR::size_titles
head(sizeCodes)


Try the blscrapeR package in your browser

Any scripts or data that you put into this service are public.

blscrapeR documentation built on Sept. 17, 2022, 1:05 a.m.