get_series_search#
- FredAPI.get_series_search(search_text, search_type=None, realtime_start=None, realtime_end=None, limit=None, offset=None, order_by=None, sort_order=None, filter_variable=None, filter_value=None, tag_names=None, exclude_tag_names=None)[source]#
Get FRED series search
Searches for economic data series based on text queries.
- Parameters:
search_text (str) – The text to search for in economic data series. if ‘search_type’=’series_id’, it’s possible to put an ‘*’ in the middle of a string. ‘m*sl’ finds any series starting with ‘m’ and ending with ‘sl’.
search_type (str, optional) – The type of search to perform. Options include ‘full_text’ or ‘series_id’. Defaults to None.
realtime_start (str | datetime, optional) – The start of the real-time period. String format: YYYY-MM-DD. Defaults to None.
realtime_end (str | datetime, optional) – The end of the real-time period. String format: YYYY-MM-DD. Defaults to None.
limit (int, optional) – The maximum number of results to return. Defaults to None.
offset (int, optional) – The offset for the results. Defaults to None.
order_by (str, optional) – The attribute to order results by. Options include ‘search_rank’, ‘series_id’, ‘title’, etc. Defaults to None.
sort_order (str, optional) – The order to sort results. Options include ‘asc’ or ‘desc’. Defaults to None.
filter_variable (str, optional) – The variable to filter results by. Defaults to None.
filter_value (str, optional) – The value to filter results by. Defaults to None.
tag_names (str | list, optional) – A comma-separated list of tag names to include in the search. Defaults to None.
exclude_tag_names (str | list, optional) – A comma-separated list of tag names to exclude from the search. Defaults to None.
- Returns:
If multiple series are returned.
- Return type:
List[Series]
- Raises:
ValueError – If the API request fails or returns an error.
Example
>>> import fedfred as fd >>> fred = fd.FredAPI('your_api_key') >>> series = fred.get_series_search('monetary services index') >>> for s in series: >>> print(s.id) 'MSIM2' 'MSIM1P' 'OCM1P'...
- FRED API Documentation:
https://fred.stlouisfed.org/docs/api/fred/series_search.html