Search FRED for a series by full text of series or by series ID.

fredr_series_search_text(
  search_text,
  ...,
  tag_names = NULL,
  exclude_tag_names = NULL,
  filter_variable = NULL,
  filter_value = NULL,
  limit = NULL,
  offset = NULL,
  order_by = NULL,
  sort_order = NULL,
  realtime_start = NULL,
  realtime_end = NULL
)

fredr_series_search_id(
  search_text,
  ...,
  limit = 1000L,
  offset = 0,
  order_by = NULL,
  sort_order = "asc",
  filter_variable = NULL,
  filter_value = NULL,
  realtime_start = NULL,
  realtime_end = NULL,
  tag_names = NULL,
  exclude_tag_names = NULL
)

Arguments

search_text

A string containing the words to match against economic data series. For use with fredr_series_search_text and fredr_series_search_id.

...

These dots only exist for future extensions and should be empty.

tag_names

A semicolon delimited string of tag names that series match all of. Defaults to no tag filtering.

exclude_tag_names

A semicolon delimited string of tag names that series match none of. Defaults to no tag filtering.

filter_variable

A string indicating the attribute to filter results by. Possible values are: "frequency", "units", "seasonal_adjustment". Defaults to no filter.

filter_value

The value of the filter_variable attribute to filter by. Possible values depend on the value of filter_variable. Defaults to no filter.

limit

An integer limit on the maximum number of results to return. Defaults to 1000, the maximum.

offset

An integer used in conjunction with limit for long series. This mimics the idea of pagination to retrieve large amounts of data over multiple calls. Defaults to 0.

order_by

A string indicating the attribute to order results by. Defaults to "search_rank" for fredr_series_search_text() and "series_id" for fredr_series_search_id(). Possible values are:

  • "search_rank"

  • "series_id"

  • "title"

  • "units"

  • "frequency"

  • "seasonal_adjustment"

  • "realtime_start"

  • "realtime_end"

  • "last_updated"

  • "observation_start"

  • "observation_end"

  • "popularity"

  • "group_popularity"

sort_order

A string representing the order of the resulting series. Possible values are: "asc" (default), and "desc".

realtime_start

A Date indicating the start of the real-time period. Defaults to today's date. For more information, see Real-Time Periods.

realtime_end

A Date indicating the end of the real-time period. Defaults to today's date. For more information, see Real-Time Periods.

Value

A tibble object where each row represents a series matching the query.

References

API Documentation:

series/search

Examples

if (fredr_has_key()) {
# search for series with text matching "oil" and return the top 10 most popular
# series
fredr_series_search_text(
  search_text = "oil",
  order_by = "popularity",
  limit = 10
)
# search for series with text matching "oil" with the tag "usa" and return the
# top 10 search results
fredr_series_search_text(
  search_text = "oil",
  order_by = "search_rank",
  limit = 10,
  tag_names = "usa"
)
# search for series with text matching "unemployment" and return only series
# with monthly frequency
fredr_series_search_text(
  search_text = "unemployment",
  filter_variable = "frequency",
  filter_value = "Monthly"
)
# search for series ID matching "UNRATE" and return oldest series first
fredr_series_search_id(
  search_text = "UNRATE",
  order_by = "observation_start"
)
}
#> # A tibble: 16 × 16
#>    id        realt…¹ realt…² title obser…³ obser…⁴ frequ…⁵ frequ…⁶ units units…⁷
#>    <chr>     <chr>   <chr>   <chr> <chr>   <chr>   <chr>   <chr>   <chr> <chr>  
#>  1 UNRATE    2022-0… 2022-0… Unem… 1948-0… 2022-0… Monthly M       Perc… %      
#>  2 UNRATENSA 2022-0… 2022-0… Unem… 1948-0… 2022-0… Monthly M       Perc… %      
#>  3 UNRATECT… 2022-0… 2022-0… Long… 2009-0… 2022-0… Not Ap… NA      Four… Fourth…
#>  4 UNRATECT… 2022-0… 2022-0… Long… 2009-0… 2022-0… Not Ap… NA      Four… Fourth…
#>  5 UNRATECT… 2022-0… 2022-0… Long… 2009-0… 2022-0… Not Ap… NA      Four… Fourth…
#>  6 UNRATERH… 2022-0… 2022-0… Long… 2009-0… 2022-0… Not Ap… NA      Four… Fourth…
#>  7 UNRATERL… 2022-0… 2022-0… Long… 2009-0… 2022-0… Not Ap… NA      Four… Fourth…
#>  8 UNRATERM… 2022-0… 2022-0… Long… 2009-0… 2022-0… Not Ap… NA      Four… Fourth…
#>  9 UNRATEMD… 2022-0… 2022-0… Long… 2015-0… 2022-0… Not Ap… NA      Perc… %      
#> 10 UNRATECTH 2022-0… 2022-0… FOMC… 2022-0… 2024-0… Annual  A       Four… Fourth…
#> 11 UNRATECTL 2022-0… 2022-0… FOMC… 2022-0… 2024-0… Annual  A       Four… Fourth…
#> 12 UNRATECTM 2022-0… 2022-0… FOMC… 2022-0… 2024-0… Annual  A       Four… Fourth…
#> 13 UNRATEMD  2022-0… 2022-0… FOMC… 2022-0… 2024-0… Annual  A       Perc… %      
#> 14 UNRATERH  2022-0… 2022-0… FOMC… 2022-0… 2024-0… Annual  A       Four… Fourth…
#> 15 UNRATERL  2022-0… 2022-0… FOMC… 2022-0… 2024-0… Annual  A       Four… Fourth…
#> 16 UNRATERM  2022-0… 2022-0… FOMC… 2022-0… 2024-0… Annual  A       Four… Fourth…
#> # … with 6 more variables: seasonal_adjustment <chr>,
#> #   seasonal_adjustment_short <chr>, last_updated <chr>, popularity <int>,
#> #   group_popularity <int>, notes <chr>, and abbreviated variable names
#> #   ¹​realtime_start, ²​realtime_end, ³​observation_start, ⁴​observation_end,
#> #   ⁵​frequency, ⁶​frequency_short, ⁷​units_short
#> # ℹ Use `colnames()` to see all variable names