# pyfredapi - Python library for the Federal Reserve Economic Data (FRED) API
<div align="center">
| | |
| :--- | :--- |
| CI/CD | [](https://github.com/gw-moore/pyfredapi/actions/workflows/test.yml)|
| Docs | [](https://pyfredapi.readthedocs.io/en/latest/?badge=latest) |
| Package | [](https://pypi.python.org/pypi/pyfredapi/) [](https://pypi.python.org/pypi/pyfredapi) |
| Meta | [](https://github.com/pypa/hatch) [](https://github.com/charliermarsh/ruff) [](https://github.com/psf/black) [](https://github.com/python/mypy) [](https://spdx.org/licenses/) |
</div>
-----
`pyfredapi` is a full featured Python library that makes it is easy to retrieve data from the [Federal Reserve Economic Data](https://fred.stlouisfed.org/docs/api/fred/) (FRED) API web service. `pyfredapi` covers all the FRED api endpoints, and can retrieve data from [FRED](https://fred.stlouisfed.org/) and [ALFRED](https://alfred.stlouisfed.org). Data can be returned as a [pandas](https://pandas.pydata.org/) 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](https://pyfredapi.readthedocs.io/en/latest/) is made with [MkDocs](https://www.mkdocs.org/) and hosted on [Read the Docs](https://readthedocs.org/).
## Installation
Install the latest version with pip:
```bash
pip install pyfredapi
```
Install pyfredapi with all optional dependencies.
```bash
pip install 'pyfredapi[all]'
```
You can also install a subset of all optional dependencies.
```bash
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](https://fred.stlouisfed.org/docs/api/api_key.html) 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:
```bash
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](https://pyfredapi.readthedocs.io/en/latest/).
- `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:
```python
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](https://pyfredapi.readthedocs.io/en/latest/references/CONTRIBUTING.html) to get started.
Raw data
{
"_id": null,
"home_page": null,
"name": "pyfredapi",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "economic data, economic data api, economic data api client, economic indicators, economic statistics, economic time series, economics, federal reserve, fred",
"author": null,
"author_email": "Greg Moore <gwmoore.career@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/9b/75/f9f9f194be06b08168c366f94eef76713ec9e23e4f7004b6c864117f571d/pyfredapi-0.10.0.tar.gz",
"platform": null,
"description": "# pyfredapi - Python library for the Federal Reserve Economic Data (FRED) API\n\n<div align=\"center\">\n\n\n| | |\n| :--- | :--- |\n| CI/CD | [](https://github.com/gw-moore/pyfredapi/actions/workflows/test.yml)|\n| Docs | [](https://pyfredapi.readthedocs.io/en/latest/?badge=latest) |\n| Package | [](https://pypi.python.org/pypi/pyfredapi/) [](https://pypi.python.org/pypi/pyfredapi) |\n| Meta | [](https://github.com/pypa/hatch) [](https://github.com/charliermarsh/ruff) [](https://github.com/psf/black) [](https://github.com/python/mypy) [](https://spdx.org/licenses/) |\n\n</div>\n\n-----\n\n`pyfredapi` is a full featured Python library that makes it is easy to retrieve data from the [Federal Reserve Economic Data](https://fred.stlouisfed.org/docs/api/fred/) (FRED) API web service. `pyfredapi` covers all the FRED api endpoints, and can retrieve data from [FRED](https://fred.stlouisfed.org/) and [ALFRED](https://alfred.stlouisfed.org). Data can be returned as a [pandas](https://pandas.pydata.org/) dataframe or json. Requests to the FRED API can be customized according to the parameters made available by the web service endpoints.\n\n## Documentation\n\nThe [documentation](https://pyfredapi.readthedocs.io/en/latest/) is made with [MkDocs](https://www.mkdocs.org/) and hosted on [Read the Docs](https://readthedocs.org/).\n\n## Installation\n\nInstall the latest version with pip:\n\n```bash\npip install pyfredapi\n```\n\nInstall pyfredapi with all optional dependencies.\n\n```bash\npip install 'pyfredapi[all]'\n```\n\nYou can also install a subset of all optional dependencies.\n\n```bash\npip install 'pyfredapi[polars]'\n```\n\n## Quick Start\n\n### FRED API Key\n\nBefore using `pyfredapi` and must have an API key to the FRED API web service. You can apply for [one for free](https://fred.stlouisfed.org/docs/api/api_key.html) on the FRED website.\n\nYou can set your API key in two ways:\n\n* set your API key to the environment variable `FRED_API_KEY`\n* pass it to the `api_key` parameter of the request function\n\nYou can set the API key as an environment variable by adding the following line to your `~/.zshrc`, `~/.bashrc` file:\n\n```bash\nexport FRED_API_KEY=\"your_api_key\"\n```\n\n### Using pyfredapi\n\nEach 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](https://pyfredapi.readthedocs.io/en/latest/).\n\n- `category` - covers the FRED Categories endpoints\n- `maps` - covers the FRED Maps endpoints\n- `release` - covers the FRED Releases endpoints\n- `series` - covers the FRED Series endpoints\n- `sources` - covers the FRED Sources endpoints\n- `tags` - covers the FRED Tags endpoints\n- `series_collection` - makes handling multiple series easier\n\nQuick start example:\n\n```python\nimport pyfredapi as pf\n\n# api key set as environment variable\npf.get_series(series_id=\"GDP\")\n\n# api key passed to the function\npf.get_series(series_id=\"GDP\", api_key=\"my_api_key\")\n```\n\n## Contributing\n\nThank you for your interest in contributing to `pyfredapi`. Check out the [contributing guide](https://pyfredapi.readthedocs.io/en/latest/references/CONTRIBUTING.html) to get started.\n",
"bugtrack_url": null,
"license": null,
"summary": "A full featured API client for the FRED API web service.",
"version": "0.10.0",
"project_urls": {
"Homepage": "https://pyfredapi.readthedocs.io/en/latest/",
"Source": "https://github.com/gw-moore/pyfredapi"
},
"split_keywords": [
"economic data",
" economic data api",
" economic data api client",
" economic indicators",
" economic statistics",
" economic time series",
" economics",
" federal reserve",
" fred"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "6e20cf58ccc3818d54276e69f93dd298d128c9a3e6ceacc7fd6cede499a771a7",
"md5": "281648ed8bda898cdc36363a17a314ef",
"sha256": "8354425184e64050a612f31b181f97c4dbb001318c38feba570a5f714c22683a"
},
"downloads": -1,
"filename": "pyfredapi-0.10.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "281648ed8bda898cdc36363a17a314ef",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 24358,
"upload_time": "2025-07-26T18:46:51",
"upload_time_iso_8601": "2025-07-26T18:46:51.235711Z",
"url": "https://files.pythonhosted.org/packages/6e/20/cf58ccc3818d54276e69f93dd298d128c9a3e6ceacc7fd6cede499a771a7/pyfredapi-0.10.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9b75f9f9f194be06b08168c366f94eef76713ec9e23e4f7004b6c864117f571d",
"md5": "ad8798e03c90de51e456144cefab0709",
"sha256": "c83c91a207ec96605695cb2c5d71c7a113b3143adedb128cc39eb7a7a66ffd22"
},
"downloads": -1,
"filename": "pyfredapi-0.10.0.tar.gz",
"has_sig": false,
"md5_digest": "ad8798e03c90de51e456144cefab0709",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3308704,
"upload_time": "2025-07-26T18:46:53",
"upload_time_iso_8601": "2025-07-26T18:46:53.050451Z",
"url": "https://files.pythonhosted.org/packages/9b/75/f9f9f194be06b08168c366f94eef76713ec9e23e4f7004b6c864117f571d/pyfredapi-0.10.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-26 18:46:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gw-moore",
"github_project": "pyfredapi",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "annotated-types",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2025.7.14"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.4.2"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.10"
]
]
},
{
"name": "markdown-it-py",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "mdurl",
"specs": [
[
"==",
"0.1.2"
]
]
},
{
"name": "numpy",
"specs": [
[
"==",
"2.3.2"
]
]
},
{
"name": "pandas",
"specs": [
[
"==",
"2.3.1"
]
]
},
{
"name": "pydantic",
"specs": [
[
"==",
"2.11.7"
]
]
},
{
"name": "pydantic-core",
"specs": [
[
"==",
"2.33.2"
]
]
},
{
"name": "pygments",
"specs": [
[
"==",
"2.19.2"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.9.0.post0"
]
]
},
{
"name": "pytz",
"specs": [
[
"==",
"2025.2"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.4"
]
]
},
{
"name": "rich",
"specs": [
[
"==",
"13.9.4"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.17.0"
]
]
},
{
"name": "typing-extensions",
"specs": [
[
"==",
"4.14.1"
]
]
},
{
"name": "typing-inspection",
"specs": [
[
"==",
"0.4.1"
]
]
},
{
"name": "tzdata",
"specs": [
[
"==",
"2025.2"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.5.0"
]
]
}
],
"tox": true,
"lcname": "pyfredapi"
}