Description
fredapi is a Python API for FRED, the economic data service of the Federal Reserve Bank of St. Louis, and for ALFRED, its archive of data revisions. It wraps the FRED web service and returns data as pandas Series or DataFrame objects, so it fits into existing analysis code. You need a FRED API key, which the README says you can apply for free on the FRED website. The key can be set through the FRED_API_KEY environment variable, saved to a file and passed with the api_key_file parameter, or passed directly as api_key. Beyond plain retrieval, the package has methods for data revisions. Many economic series are revised after release, and ALFRED stores each observation with a date, a realtime start and a realtime end. The README uses GDP for 2014 Q1, which was released three times, to show how to get only the first release or the latest data. The README has sections on installation, basic usage and working with revisions, and the source is on GitHub.…
Highlights
- Pandas Series and DataFrame output
- FRED and ALFRED revision handling
- First release only or latest data
- API key from environment, file or code
Ratings & Reviews
No ratings yet
Be the first to rate Fredapi.
People also visit
Fredapi FAQ
What is fredapi?
A Python wrapper for the FRED economic data web service and for ALFRED, which keeps the history of data revisions.
Do I need an API key?
Yes. The README says you can apply for one for free on the FRED website.
How do I give it the key?
Set the FRED_API_KEY environment variable, save the key to a file and pass api_key_file, or pass api_key directly.
What is ALFRED used for here?
It stores data revisions. fredapi can return the first release of a value or the latest one, as the README explains.
What are the best Fredapi alternatives?
Popular alternatives to Fredapi include Pandas Datareader, Frds and Simfin. See all Fredapi alternatives









