qcew_api: Request data from the Quarterly Census of Employment and Wages.
Description
Return data from the QCEW API. This is separate from the main BLS API and returns quarterly data
sliced by industry, area or size. Industry is identified by NIACS code and area is identified by FIPS code.
A key is not required for the QCEW API.
These data begin in 2012 and go to the most recent complete quarter. The argument can be entered
as an integer or a character. The default is 2012.
qtr
Quarter: This can be any integer between 1 and 4, or "A" for annual. The argument can be entered
as an integer or a character. The default is 1, which returns the first quarter.
slice
The slice should be one of the three data slices offered by the API; "industry", "area", or "size."
sliceCode
The slice codes depend on what slice you select. For example, if you select the "area" slice,
your sliceCode should be a FIPS code. If you select "industry," your sliceCode should be a NIACS code.
There are three internal data sets containing acceptable slice codes to help with selections; blscrapeR::niacs
contains industry codes and descriptions, blscrapeR::area_titles contains FIPS codes and area descriptions,
and blscrapeR::size_titles contains industry size codes. These codes can be used for the sliceCode argument.
if (FALSE) {
# A request for the employment levels and wages for NIACS 5112: Software Publishers.dat <- qcew_api(c(format(Sys.Date(), "%Y")), qtr="1", slice="industry", sliceCode=10)
}