Federal Reserve Economic Data (FRED) Client

Python client for interfacing with the Federal Reserve Bank’s FRED API. Our goal is to provide a simple, well-documented solution for FRED-related programming in Python.

For other ways to interface with FRED in Python, see mortada/fredapi or zachwill/fred .

Note

This is a third-party client that is developed and maintained independently of the Federal Reserve Bank. As such, it is not affiliated with or supported by the institution.

Compatibility

The Federal Reserve Bank does not provide a versioned API. We constantly monitor the API to ensure that our client is compatible with FRED. If you notice a compatibility issue, please let use know and we’ll work to resolve the issue.

Basic usage

from fred import Fred
fr = Fred(api_key='abcdefghijklmnopqrstuvwxyz123456',response_type='dict')

params = {
         'limit':2,
         'tag_names':'trade;goods'
         }

res = fr.category.series(125,params=params)

for record in res:
    print(record)

Features

This client was built to provide users with an intuitive and effective framework for making requests to the FRED API from within Python. As such, our main feature is the ability to interact with the FRED web-service.

Comprehensive query support

Request economic data from all 5 data groups available in FRED and ALFRED. For reference, the data groups are included below. See Federal Reserve Bank of St. Louis for additional documentation, or click on a specific query to go directly to documentation for that query.

FRED vs. ALFRED

FRED stands for Federal Reserve Economic Data. FRED contains frequently updated US macro and regional economic time series at annual, quarterly, monthly, weekly, and daily frequencies.

ALFRED stands for Archival Federal Reserve Economic Data. ALFRED archives FRED data by adding the real-time period when values were originally released and later revised.

FRED and ALFRED use the same web-service. As noted in the Federal Reserve Bank documentation, most users are interested in FRED. As such, default parameters have been selected by the bank to cater to FRED users. If you want to access ALFRED for a given period, simply provide the real-time period by passing the relevant realtime_start and realtime_end parameters to the function handling your request.

License

The MIT License (MIT)

Copyright (c) 2016 Aleksandar Velkoski https://github.com/avelkoski

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Affiliation

The author is affiliated with the Data Science division of the National Association of REALTORS.

Indices and tables