Introduction to BLSloadR

library(BLSloadR)

Overview

BLSloadR is a packages designed to streamline access to the time series database downloads from the U.S. Bureau of Labor Statistics (https://www.bls.gov/), made available as flat files (https://download.bls.gov/pub/time.series/). It is focused on accessing series that are frequently used by states to get state-level estimates, but includes the load_bls_dataset() function to provide generalized access to the other databases at this website.

Basic Usage

The primary functions in this package all begin with get_ and are listed below:

These functions download a series of files in the time.series database from BLS, join those files together, and then perform some simple filtering and streamlining to prepare the data for time series analysis. Generally speaking, these functions may be used with only the default parameters to get a table formatted and ready to be analyzed. To reduce the filtering and summaries performed by these functions, a series of arguments may beset to retain the data closer to its original format.

Common Function Arguments

Within the functions to retrieve specific data sets there are a few common arguments which exist to simplify the results and minimize subsequent filtering.

Helper Functions in the Package

This package relies on a custom function, fread_bls() which aids in downloading and reading text files from the BLS. Ordinarily, attempting to read files from the BLS directly from R will return a 403 error, even though these files may be accessed easily from a web browser. This package adds HTML headers to the GET requests to the BLS web page to enable file downloads, checks the format of the files, and reads in the contents. The functions above pull specific files from the associated databases. The functions below, in contrast, are designed to enable the user to

These optional helper functions can aid the user of this package by providing ways to summarize and explore all the time.series databases. The full list of databases as of November 2025 is listed at the end of this document.

Additional Diagnostics

Within each of the core functions is an argument that allows you to receive more robust diagnostic information about the loading process. setting return_diagnostics = TRUE will return a bls_data_collection object, which can be used to get more information about the loading process. For load_bls_dataset() you should set return_full = TRUE.

Disclaimer

This package was not created,endorsed, or maintained by the U.S. Bureau of Labor Statistics. It exists to make accessing that data easier and more streamlined using websites that are already publicly available.

List of Databases

The current list of databases in the time.series folder as of November 2025 is listed below. Please note, not all series have current data available. Additional information about a series may be gained by running the bls_overview() function for a selected series, such as bls_overview("ap").