Skip to main content

United States Federal Reserve API

Table of Contents

Current Version

Version: 0.1.0

Overview

What is FRED? Short for Federal Reserve Economic Data, FRED is an online database consisting of hundred of thousands of economic data time series from scores of national, international, public, and private sources. FRED, created and maintained by the Research Department at the Federal Reserve Bank of St. Louis, goes far beyond simply providing data: It combines data with a powerful mix of tools that help the user understand, interact with, display, and disseminate the data. In essence, FRED helps users tell their data stories. The purpose of this article is to guide the potential (or current) FRED user through the various aspects and tools of the database.

This library will give you the capability to query data from FRED using Python. To get started using this library all you need is an API key. To register for an API Key please go the developers resources provided by Fred.

Setup

Setup - Requirements Install:

For this particular project, you only need to install the dependencies, to use the project. The dependencies are listed in the requirements.txt file and can be installed by running the following command:

pip install -r requirements.txt

After running that command, the dependencies should be installed.

Setup - Local Install:

If you are planning to make modifications to this project or you would like to access it before it has been indexed on PyPi. I would recommend you either install this project in editable mode or do a local install. For those of you, who want to make modifications to this project. I would recommend you install the library in editable mode.

If you want to install the library in editable mode, make sure to run the setup.py file, so you can install any dependencies you may need. To run the setup.py file, run the following command in your terminal.

pip install -e .

If you don't plan to make any modifications to the project but still want to use it across your different projects, then do a local install.

pip install .

This will install all the dependencies listed in the setup.py file. Once done you can use the library wherever you want.

Setup - PyPi Install:

To install the library, run the following command from the terminal.

pip install federal-reserve-python-api

Setup - PyPi Upgrade:

To upgrade the library, run the following command from the terminal.

pip install --upgrade federal-reserve-python-api

Usage

Here is a simple example of using the fred library to query some category data.

from pprint import pprint
from configparser import ConfigParser
from fred.client import FederalReserveClient

# Initialize the Parser.
config = ConfigParser()

# Read the file.
config.read('config/config.ini')

# Get the specified credentials.
api_key = config.get('main', 'api_key')

# Initialize the Client.
fred_client = FederalReserveClient(api_key=api_key)

# Initialize the Categories Service.
categories_service = fred_client.categories()

# Grab a category by it's ID.
pprint(categories_service.get_category(category_id='125'))

Support These Projects

Patreon: Help support this project and future projects by donating to my Patreon Page. I'm always looking to add more content for individuals like yourself, unfortuantely some of the APIs I would require me to pay monthly fees.

YouTube: If you'd like to watch more of my content, feel free to visit my YouTube channel Sigma Coding.

Questions: If you have questions please feel free to reach out to me at coding.sigma@gmail.com

Metadata

Release files for federal-reserve-python-api 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for federal-reserve-python-api 0.1.0
File Size Uploaded
federal-reserve-python-api-0.1.0.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for federal-reserve-python-api 0.1.0
File Interpreter ABI Platform
federal_reserve_python_api-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.3 kB

Release files / federal-reserve-python-api-0.1.0.tar.gz

Download URL federal-reserve-python-api-0.1.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7135016a0669f47f1b94405bf080308ab83409cd7cfc024b41937160837f53aa
BLAKE2b-256 checksum
How to use checksums
eb6b97754751aca05dcb5ac53ca5f7e7c4847c5af41a66ebf9f0aa2c892b019c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.4

Release files / federal_reserve_python_api-0.1.0-py3-none-any.whl

Download URL federal_reserve_python_api-0.1.0-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a660cf49373014dbf7f3059a639c440895ac23b06e1a7d7b88e0bd781be00d62
BLAKE2b-256 checksum
How to use checksums
fdac6c788ca9db8d4c7ebda0302beae16ef32e3b1453c89c683d787ca0080d37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page