FRED Series

Sam Boysel

2018-07-22

Introduction

This vignette is intended to introduce the user to fredr functions for the Series endpoint of the FRED API.

FRED series are the primary data objects in the FRED database. Each FRED series is assigned a string identifier. For example:

FRED series are assigned categories and tags attributes for organization and classification. The following examples illustrate usage of the Series endpoint functions in fredr.

Retrieve observations

The function fredr(), an alias for fredr_series_observations(), is the core function in fredr for fetching FRED data series. See the Get started article and ?fredr() for many usage examples.

Search for FRED series

Use fredr_series_search_text() to search for a series by text in the series description. The data returned is a tibble where each row represents series with description text that matches the text specified by search_text. For example, to search for series with description text that matches “UNRATE”:

Use fredr_series_search_id() to search for a series by character ID of the series. The data returned is a tibble where each row represents series with an ID that matches the text specified by search_text. For example, to search for series with an ID that matches “UNRATE”:

fredr_series_search_id(
  search_text = "UNRATE",
  limit = 100L
)
#> # A tibble: 16 x 16
#>    id    realtime_start realtime_end title observation_sta… observation_end
#>  * <chr> <chr>          <chr>        <chr> <chr>            <chr>          
#>  1 UNRA… 2018-07-22     2018-07-22   Civi… 1948-01-01       2018-06-01     
#>  2 UNRA… 2018-07-22     2018-07-22   FOMC… 2018-01-01       2020-01-01     
#>  3 UNRA… 2018-07-22     2018-07-22   Long… 2009-02-18       2018-06-13     
#>  4 UNRA… 2018-07-22     2018-07-22   FOMC… 2018-01-01       2020-01-01     
#>  5 UNRA… 2018-07-22     2018-07-22   Long… 2009-02-18       2018-06-13     
#>  6 UNRA… 2018-07-22     2018-07-22   FOMC… 2018-01-01       2020-01-01     
#>  7 UNRA… 2018-07-22     2018-07-22   Long… 2009-02-18       2018-06-13     
#>  8 UNRA… 2018-07-22     2018-07-22   FOMC… 2018-01-01       2020-01-01     
#>  9 UNRA… 2018-07-22     2018-07-22   Long… 2015-06-17       2018-06-13     
#> 10 UNRA… 2018-07-22     2018-07-22   Civi… 1948-01-01       2018-06-01     
#> 11 UNRA… 2018-07-22     2018-07-22   FOMC… 2018-01-01       2020-01-01     
#> 12 UNRA… 2018-07-22     2018-07-22   Long… 2009-02-18       2018-06-13     
#> 13 UNRA… 2018-07-22     2018-07-22   FOMC… 2018-01-01       2020-01-01     
#> 14 UNRA… 2018-07-22     2018-07-22   Long… 2009-02-18       2018-06-13     
#> 15 UNRA… 2018-07-22     2018-07-22   FOMC… 2018-01-01       2020-01-01     
#> 16 UNRA… 2018-07-22     2018-07-22   Long… 2009-02-18       2018-06-13     
#> # ... with 10 more variables: frequency <chr>, frequency_short <chr>,
#> #   units <chr>, units_short <chr>, seasonal_adjustment <chr>,
#> #   seasonal_adjustment_short <chr>, last_updated <chr>, popularity <int>,
#> #   group_popularity <int>, notes <chr>

Search for FRED series by tags

Use fredr_series_search_tags() to search for series tags. The data returned is a tibble where each row represents a tag matching the text in series_search_text. For example, to return the top 100 tags (by series count) matching the text “unemployment”:

Get basic information for a FRED series

The fredr_series() function returns information for a single series specified by series_id. The data returned is a tibble in which each row represents the series specified. For example, to get information for the UNRATE series:

Note that there may potentially be more than one row returned if the series has been revised and real time periods are adjusted:

Get the categories for a FRED series

The fredr_series_categories() function returns a list of categories for the series specified by series_id. The data returned is a tibble in which each row represents a category that the series belongs to. For example, to get the categories for the UNRATE series:

Get the release for a FRED series

The fredr_series_release() function returns a list of releases that the series specified by series_id belongs to. The data returned is a tibble in which each row represents a release that the series belongs to. For example, to get the release for the UNRATE series:

Get the tags for a FRED series

The fredr_series_tags() function returns a list of tags that are assigned to the series specified by series_id. The data returned is a tibble in which each row represents a tag assigned to the series. For example, to get the tags for the UNRATE series:

Get a set of recently updated FRED series

The fredr_series_updates() function returns a list of series recently updated on the FRED server. The data returned is a tibble in which each row represents a series. For example, the default call simply lists 1000 recent updates (the default for the limit parameter), most recent updates appearing first:

Use the start_time and end_time parameters to filter the results by time. For example, to get all the macroeconomic times series updated in the last hour:

Get the data vintage dates for a FRED series

The fredr_series_vintagedates() function returns a sequence of dates in history when the series specified by series_id was revised or appended to. The data returned is a tibble where each row is a date. For example, to get the vintage dates for the series UNRATE: