Introduction

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

FRED series are derived from a specific data source. Each FRED source is assigned an integer identifier. The following examples illustrate usage of the Sources endpoint functions in fredr.

Get FRED sources

The function fredr_sources() returns a list of FRED data sources. The information returned is a tibble in which each row represents a FRED source. For example, running fredr_sources() without any arguments returns the first 1000 (limit default) sources ordered by ascending source ID (but here we limit to just 10):

fredr_sources(limit = 10)
#> # A tibble: 10 × 5
#>       id realtime_start realtime_end name                                  link 
#>    <int> <chr>          <chr>        <chr>                                 <chr>
#>  1     1 2023-04-17     2023-04-17   Board of Governors of the Federal Re… http…
#>  2     3 2023-04-17     2023-04-17   Federal Reserve Bank of Philadelphia  http…
#>  3     4 2023-04-17     2023-04-17   Federal Reserve Bank of St. Louis     http…
#>  4     6 2023-04-17     2023-04-17   Federal Financial Institutions Exami… http…
#>  5    11 2023-04-17     2023-04-17   Dow Jones & Company                   http…
#>  6    14 2023-04-17     2023-04-17   University of Michigan                http…
#>  7    15 2023-04-17     2023-04-17   Council of Economic Advisers (US)     http…
#>  8    16 2023-04-17     2023-04-17   U.S. Office of Management and Budget  http…
#>  9    17 2023-04-17     2023-04-17   U.S. Congressional Budget Office      http…
#> 10    18 2023-04-17     2023-04-17   U.S. Bureau of Economic Analysis      http…

Get a single FRED source

The function fredr_source() returns information for a single source indicated by source_id. The data returned is a tibble in which each row represents a FRED source. For example, the Federal Financial Institutions Examination Council source ID is 6:

fredr_source(source_id = 6L)
#> # A tibble: 1 × 5
#>      id realtime_start realtime_end name                                   link 
#>   <int> <chr>          <chr>        <chr>                                  <chr>
#> 1     6 2023-04-17     2023-04-17   Federal Financial Institutions Examin… http…

Get FRED releases for a source

The function fredr_source_releases() returns FRED release information for the source indicated by source_id. As with the functions for the Releases endpoint, the data returned is a tibble in which each row represents a FRED release for the specified source. For example, to get the first 10 releases from the Federal Reserve Board of Governors, ordered by ascending release ID:

fredr_source_releases(
  source_id = 1L,
  limit = 10L
)
#> # A tibble: 10 × 7
#>       id realtime_start realtime_end name              press_release link  notes
#>    <int> <chr>          <chr>        <chr>             <lgl>         <chr> <chr>
#>  1    13 2023-04-17     2023-04-17   G.17 Industrial … TRUE          http…  NA  
#>  2    14 2023-04-17     2023-04-17   G.19 Consumer Cr… TRUE          http…  NA  
#>  3    15 2023-04-17     2023-04-17   G.5 Foreign Exch… TRUE          http…  NA  
#>  4    17 2023-04-17     2023-04-17   H.10 Foreign Exc… TRUE          http…  NA  
#>  5    18 2023-04-17     2023-04-17   H.15 Selected In… TRUE          http…  NA  
#>  6    19 2023-04-17     2023-04-17   H.3 Aggregate Re… TRUE          http… "The…
#>  7    20 2023-04-17     2023-04-17   H.4.1 Factors Af… TRUE          http…  NA  
#>  8    21 2023-04-17     2023-04-17   H.6 Money Stock … TRUE          http…  NA  
#>  9    22 2023-04-17     2023-04-17   H.8 Assets and L… TRUE          http…  NA  
#> 10    52 2023-04-17     2023-04-17   Z.1 Financial Ac… TRUE          http… "The…

To get University of Michigan releases since 1950:

fredr_source_releases(
  source_id = 14L,
  realtime_start = as.Date("1950-01-01")
)
#> # A tibble: 1 × 6
#>      id realtime_start realtime_end name                 press_release link     
#>   <int> <chr>          <chr>        <chr>                <lgl>         <chr>    
#> 1    91 1998-07-31     9999-12-31   Surveys of Consumers TRUE          http://w…