Note: I am not affiliated in any way with BLS.
npm install qcew
The module has three functions, which you would use as below. For documentation on what the data means, please see the BLS QCEW website and overview, which will have the most up-to-date and in-depth information.
All functions can take an optional
format parameter as the last argument to determine the data format you'll receive. If nothing is set, the data will come back as Json. The options are:
'json'— The default and needs not be specified. Returns an array of objects.
'csv'— Returns the data as a csv string — how the API sends it. Useful for writing data to file.
'rows'— Returns an array of arrays representing each row in the data. The first array contains the header values.
getAreaData(year, quarter, area, callback[, format])
This function takes a year, quarter, and area argument and returns data containing the associated area data. Use 'a' for annual averages.
For all area codes and titles see: http://www.bls.gov/cew/doc/titles/area/area_titles.htm
getIndustryData(year, quarter, industry_code, callback[, format])
This function takes a year, quarter, and industry code and returns data containing the associated industry data. Use 'a' for annual averages. Some industry codes contain hyphens. The CSV files use underscores instead of hyphens. So 31-33 becomes 31_33.
For all industry codes and titles see: http://www.bls.gov/cew/doc/titles/industry/industry_titles.htm
getSizeData(year, establishment_size_class_code, callback[, format])
This function takes a year and establishment size class code and returns data containing the associated size data. Size data is only available for the first quarter of each year.
For all establishment size classes and titles see: http://www.bls.gov/cew/doc/titles/size/size_titles.htm
var qcew = ;// Data output format can be `json`, `csv` or `rows`.// If no value is passed as the last argument, `json` will be returned.// `rows` will return an array of arrays representing the desired table.qcew;qcew;qcew;