Skip to main content

pyfredapi - Python library for the Federal Reserve Economic Data (FRED) API

CI/CD CI - Test
Docs Documentation Status
Package PyPi Version Supported Python Versions
Meta Hatch project linting - Ruff code style - Black types - Mypy License - MIT

pyfredapi is a full featured Python library that makes it is easy to retrieve data from the Federal Reserve Economic Data (FRED) API web service. pyfredapi covers all the FRED api endpoints, and can retrieve data from FRED and ALFRED. Data can be returned as a pandas dataframe or json. Requests to the FRED API can be customized according to the parameters made available by the web service endpoints.

Documentation

The documentation is made with MkDocs and hosted on Read the Docs.

Installation

Install the latest version with pip:

pip install pyfredapi

Install pyfredapi with all optional dependencies.

pip install 'pyfredapi[all]'

You can also install a subset of all optional dependencies.

pip install 'pyfredapi[polars]'

Quick Start

FRED API Key

Before using pyfredapi and must have an API key to the FRED API web service. You can apply for one for free on the FRED website.

You can set your API key in two ways:

  • set your API key to the environment variable FRED_API_KEY
  • pass it to the api_key parameter of the request function

You can set the API key as an environment variable by adding the following line to your ~/.zshrc, ~/.bashrc file:

export FRED_API_KEY="your_api_key"

Using pyfredapi

Each of the FRED API endpoint namespaces is covered by a module in pyfredapi. For a deeper dive into each of the modules see the tutorials and API reference in the documentation.

  • category - covers the FRED Categories endpoints
  • maps - covers the FRED Maps endpoints
  • release - covers the FRED Releases endpoints
  • series - covers the FRED Series endpoints
  • sources - covers the FRED Sources endpoints
  • tags - covers the FRED Tags endpoints
  • series_collection - makes handling multiple series easier

Quick start example:

import pyfredapi as pf

# api key set as environment variable
pf.get_series(series_id="GDP")

# api key passed to the function
pf.get_series(series_id="GDP", api_key="my_api_key")

Contributing

Thank you for your interest in contributing to pyfredapi. Check out the contributing guide to get started.

Release files for pyfredapi 0.10.2

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

Source distribution (sdist)

Source distribution for pyfredapi 0.10.2
File Size Uploaded
pyfredapi-0.10.2.tar.gz 3.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfredapi 0.10.2
File Interpreter ABI Platform
pyfredapi-0.10.2-py3-none-any.whl Python 3 none any Details

Total release size: 3.3 MB

Release files / pyfredapi-0.10.2.tar.gz

Download URL pyfredapi-0.10.2.tar.gz
Size 3.3 MB
Tags Source
SHA-256 checksum
How to use checksums
c244fe3aa55954669e372a98194a0fa168935fd7482c909d29a537c7a4b94783
BLAKE2b-256 checksum
How to use checksums
359879794ef41579df22c2b1f44e05043c8c3c5fd1f0c254a17241b40fc76f7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2025.

Transparency log

Release files / pyfredapi-0.10.2-py3-none-any.whl

Download URL pyfredapi-0.10.2-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f99ad8dee3824d8f727c9c85f8965a94033b37b39a7eb188240b31c10930a61
BLAKE2b-256 checksum
How to use checksums
0d132cfc9dbf5447ead073d1669e9345db90a7106bc940628c8c9a3cfa979fbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.10.2 This release

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

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