Retrieves 800,000+ FRED economic time series (GDP, unemployment, inflation, interest rates, housing, state data) without an API key. Supports server-side transformations, frequency aggregation, ALFRED real-time vintages, and site search. Optional API key adds JSON search, categories, releases, tags, and GeoFRED maps.
Access comprehensive economic data through FRED (Federal Reserve Economic Data), a database maintained by the Federal Reserve Bank of St. Louis containing over 800,000 economic time series from over 100 sources.
Key capabilities (keyless):
CAUR, TXUR) for regional comparisons and mapsWith the optional FRED_API_KEY: filtered JSON search, categories, release calendars, tags,
sources, vintage-date lists, GeoFRED regional data and shapes, and bulk release download (API v2).
pc1, pch, log) or frequency aggregation before analysis| Scenario | Use Instead |
|---|---|
| Stock/ETF prices, OHLCV bars, or technical indicators (RSI, MACD) | alterlab-alpha-vantage |
| Debt to the Penny, Daily/Monthly Treasury Statements, or auction results from the Treasury | alterlab-usfiscaldata |
| Company-level financial statements from SEC filings | alterlab-edgartools |
| Place-resolved public statistics (demographics, health, non-FRED global indicators) | alterlab-datacommons |
| Econometric modelling (ARIMA, VAR, regressions) of series you already downloaded | alterlab-statsmodels |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-alpha-vantage) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
Start keyless; reach for the JSON API only when the user needs something the right column lists and has (or wants) a free key.
| Need | Keyless route (default) | With optional FRED_API_KEY |
|---|---|---|
| Values | fred.stlouisfed.org/graph/fredgraph.csv?id=UNRATE&cosd=2024-01-01&coed=2024-12-01 | series/observations |
| Transformation | add &transformation=pc1 (lin, chg, ch1, pch, pc1, pca, cch, cca, log) | units=pc1 |
| Lower frequency | add &fq=Monthly&fam=avg (fam: avg, sum, eop) | frequency=m&aggregation_method=avg |
| As published on a date | alfred.stlouisfed.org/graph/alfredgraph.csv?id=GDP&vintage_date=2020-01-30 | realtime_start/realtime_end, get_vintage_dates |
| Find a series ID | fred.stlouisfed.org/searchresults/?st=consumer+price+index&t=monthly | series/search + filters |
| Title, units, frequency | fred.stlouisfed.org/series/CPIAUCSL | series |
| State map | per-state series {ST}UR (50 states + DCUR), plotted with plotly locationmode="USA-states" or Census cartographic boundaries | GeoFRED series/data + shapes/file |
| Categories, releases, tags, sources | WebFetch the matching fred.stlouisfed.org pages | JSON endpoints below |
python scripts/fred_keyless.py obs GDPC1 --transformation pc1 --start 2023-01-01
python scripts/fred_keyless.py obs DGS10 --frequency m --aggregation avg --start 2024-01-01 --csv dgs10_monthly.csv
python scripts/fred_keyless.py obs GDP --vintage-date 2020-01-30 --start 2019-07-01 # 2019Q4 advance: 21734.266
python scripts/fred_keyless.py search "consumer price index" --tag monthly
python scripts/fred_keyless.py info CPIAUCSL
python scripts/fred_keyless.py states UR --date 2026-08-01
fred_keyless.py needs only the standard library (observations(), observations_many(),
search(), series_info() in Python). pd.read_csv also reads the CSV URLs directly. Missing
values come back as "." or blank. Fetching several IDs in one fredgraph URL returns a zip when
their frequencies differ, so request one ID per URL.
Optional key. For JSON-only endpoints, a free key comes from https://fredaccount.stlouisfed.org;
set export FRED_API_KEY=... and use scripts/fred_query.py. It raises a clear error naming the
variable and the keyless alternative when the key is missing.
Say how it was retrieved. End every answer with a short "How this was retrieved" line: the keyless URL or fred_keyless.py command with its series IDs and dates, the source agency (e.g. BLS via FRED), and the retrieval date. When a keyless route stands in for a keyed endpoint (per-state {ST}UR CSVs instead of GeoFRED series/data + shapes/file), name that endpoint once as the optional-key alternative and what it would add. In a paper, cite the series ID, source agency and retrieval date of every series used.
from scripts.fred_query import FREDQuery
fred = FREDQuery() # reads FRED_API_KEY; without it, use scripts/fred_keyless.py
# get_series returns METADATA (title, units, frequency) under "seriess".
# For the actual data values, use get_observations (returns "observations").
meta = fred.get_series("GDP")
print(meta["seriess"][0]["title"]) # "Gross Domestic Product"
# Get the latest GDP value
gdp = fred.get_observations("GDP", limit=1, sort_order="desc")
print(f"Latest GDP: {gdp['observations'][0]}")
# Get unemployment rate observations
unemployment = fred.get_observations("UNRATE", limit=12)
for obs in unemployment["observations"]:
print(f"{obs['date']}: {obs['value']}%")
# Search for inflation series
inflation_series = fred.search_series("consumer price index")
for s in inflation_series["seriess"][:5]:
print(f"{s['id']}: {s['title']}")
import requests
import os
API_KEY = os.environ.get("FRED_API_KEY")
BASE_URL = "https://api.stlouisfed.org/fred"
# Get series observations
response = requests.get(
f"{BASE_URL}/series/observations",
params={
"api_key": API_KEY,
"series_id": "GDP",
"file_type": "json"
}
)
data = response.json()
| Series ID | Description | Frequency |
|---|---|---|
| GDP | Gross Domestic Product | Quarterly |
| GDPC1 | Real Gross Domestic Product | Quarterly |
| UNRATE | Unemployment Rate | Monthly |
| CPIAUCSL | Consumer Price Index (All Urban) | Monthly |
| FEDFUNDS | Federal Funds Effective Rate | Monthly |
| DGS10 | 10-Year Treasury Constant Maturity | Daily |
| HOUST | Housing Starts | Monthly |
| PAYEMS | Total Nonfarm Payrolls | Monthly |
| INDPRO | Industrial Production Index | Monthly |
| M2SL | M2 Money Stock | Monthly |
| UMCSENT | Consumer Sentiment | Monthly |
| SP500 | S&P 500 | Daily |
Get economic data series metadata and observations.
Key endpoints:
fred/series - Get series metadatafred/series/observations - Get data values (most commonly used)fred/series/search - Search for series by keywordsfred/series/updates - Get recently updated series# Get observations with transformations
obs = fred.get_observations(
series_id="GDP",
units="pch", # percent change
frequency="q", # quarterly
observation_start="2020-01-01"
)
# Search with filters
results = fred.search_series(
"unemployment",
filter_variable="frequency",
filter_value="Monthly"
)
Reference: See references/series.md for all 10 series endpoints
Navigate the hierarchical organization of economic data.
Key endpoints:
fred/category - Get a categoryfred/category/children - Get subcategoriesfred/category/series - Get series in a category# Get root categories (category_id=0)
root = fred.get_category()
# Get Money Banking & Finance category and its series
category = fred.get_category(32991)
series = fred.get_category_series(32991)
Reference: See references/categories.md for all 6 category endpoints
Access data release schedules and publication information.
Key endpoints:
fred/releases - Get all releasesfred/releases/dates - Get upcoming release datesfred/release/series - Get series in a release# Get upcoming release dates
upcoming = fred.get_release_dates()
# Get GDP release info
gdp_release = fred.get_release(53)
Reference: See references/releases.md for all 9 release endpoints
Discover and filter series using FRED tags.
# Find series with multiple tags
series = fred.get_series_by_tags(["gdp", "quarterly", "usa"])
# Get related tags
related = fred.get_related_tags("inflation")
Reference: See references/tags.md for all 3 tag endpoints
Get information about data sources (BLS, BEA, Census, etc.).
# Get all sources
sources = fred.get_sources()
# Get Federal Reserve releases
fed_releases = fred.get_source_releases(source_id=1)
Reference: See references/sources.md for all 3 source endpoints
Access geographic/regional economic data for mapping.
# Get state unemployment data
regional = fred.get_regional_data(
series_group="1220", # Unemployment rate
region_type="state",
date="2023-01-01",
units="Percent",
season="NSA"
)
# Get GeoJSON shapes
shapes = fred.get_shapes("state")
Reference: See references/geofred.md for all 4 GeoFRED endpoints
FRED API v2 has one endpoint, fred/v2/release/observations, which returns every series in a release (all history) in one paginated call. Unlike v1 it takes the key in a header:
import os
import requests
url = "https://api.stlouisfed.org/fred/v2/release/observations"
headers = {"Authorization": f"Bearer {os.environ['FRED_API_KEY']}"}
params = {"release_id": 53, "limit": 500000} # 53 = GDP release; limit max 500,000 observations
series = []
while True:
page = requests.get(url, headers=headers, params=params, timeout=120).json()
series.extend(page["series"]) # each series carries its observations
if not page.get("has_more"):
break
params["next_cursor"] = page["next_cursor"] # omit on the first request
Apply transformations when fetching observations:
| Value | Description |
|---|---|
lin | Levels (no transformation) |
chg | Change from previous period |
ch1 | Change from year ago |
pch | Percent change from previous period |
pc1 | Percent change from year ago |
pca | Compounded annual rate of change |
cch | Continuously compounded rate of change |
cca | Continuously compounded annual rate of change |
log | Natural log |
# Get GDP percent change from year ago
gdp_growth = fred.get_observations("GDP", units="pc1") # JSON API
gdp_growth = observations("GDP", transformation="pc1") # keyless (fred_keyless)
Aggregate data to different frequencies:
| Code | Frequency |
|---|---|
d | Daily |
w | Weekly |
m | Monthly |
q | Quarterly |
a | Annual |
Aggregation methods: avg (average), sum, eop (end of period)
# Convert daily to monthly average
monthly = fred.get_observations(
"DGS10",
frequency="m",
aggregation_method="avg"
)
monthly = observations("DGS10", frequency="m", aggregation="avg") # keyless: fq=Monthly&fam=avg
Access historical vintages of data via ALFRED:
# Get GDP as it was reported on a specific date
vintage_gdp = fred.get_observations(
"GDP",
realtime_start="2020-01-01",
realtime_end="2020-01-01"
)
# Get all vintage dates for a series
vintages = fred.get_vintage_dates("GDP")
# Keyless: the series as published on 2020-01-30 (ALFRED CSV, column GDP_20200130)
first_print = observations("GDP", vintage_date="2020-01-30", start="2019-10-01")
def get_economic_snapshot(fred):
"""Get current values of key indicators."""
indicators = ["GDP", "UNRATE", "CPIAUCSL", "FEDFUNDS", "DGS10"]
snapshot = {}
for series_id in indicators:
obs = fred.get_observations(series_id, limit=1, sort_order="desc")
if obs.get("observations"):
latest = obs["observations"][0]
snapshot[series_id] = {
"value": latest["value"],
"date": latest["date"]
}
return snapshot
def compare_series(fred, series_ids, start_date):
"""Compare multiple series over time."""
import pandas as pd
data = {}
for sid in series_ids:
obs = fred.get_observations(
sid,
observation_start=start_date,
units="pc1" # Normalize as percent change
)
data[sid] = {
o["date"]: float(o["value"])
for o in obs["observations"]
if o["value"] != "."
}
return pd.DataFrame(data)
def get_upcoming_releases(fred, days=7):
"""Get data releases in next N days."""
from datetime import datetime, timedelta
end_date = datetime.now() + timedelta(days=days)
releases = fred.get_release_dates(
realtime_start=datetime.now().strftime("%Y-%m-%d"),
realtime_end=end_date.strftime("%Y-%m-%d"),
include_release_dates_with_no_data="true"
)
return releases
def map_state_unemployment(fred, date):
"""Get unemployment by state for mapping."""
data = fred.get_regional_data(
series_group="1220",
region_type="state",
date=date,
units="Percent",
frequency="a",
season="NSA"
)
# Get GeoJSON for mapping
shapes = fred.get_shapes("state")
return data, shapes
result = fred.get_observations("INVALID_SERIES")
if "error" in result:
print(f"Error {result['error']['code']}: {result['error']['message']}")
elif not result.get("observations"):
print("No data available")
else:
# Process data
for obs in result["observations"]:
if obs["value"] != ".": # Handle missing values
print(f"{obs['date']}: {obs['value']}")
{"error": {"code": ..., "message": ...}} (FRED's own error_code/error_message).For detailed endpoint documentation:
references/series.mdreferences/categories.mdreferences/releases.mdreferences/tags.mdreferences/sources.mdreferences/geofred.mdreferences/api_basics.mdscripts/fred_keyless.py (default, no key)Standard-library client for the keyless routes in "Access: keyless first": obs (values,
transformations, aggregation, --vintage-date, --csv), search, info, states. Run with
plain python; exits non-zero with the HTTP status on an unknown series ID.
scripts/fred_query.py (optional key)JSON-API query module with FREDQuery class providing:
The community fredapi package (uv run --python ">=3.11" --with fredapi ...; Fred(api_key=...).get_series("GDP") returns a pandas Series; needs the key) is a lighter alternative for plain series pulls; it has had no release since 0.5.2 (2024-05).
scripts/fred_examples.pyExamples; without FRED_API_KEY it runs the keyless ones and skips the JSON-API ones:
Run examples:
uv run --python ">=3.11" --with requests python scripts/fred_examples.py
Part of the AlterLab Academic Skills suite.
evals/evals.json (opens in a new tab)references/api_basics.md (opens in a new tab)references/categories.md (opens in a new tab)references/geofred.md (opens in a new tab)references/releases.md (opens in a new tab)references/series.md (opens in a new tab)references/sources.md (opens in a new tab)references/tags.md (opens in a new tab)scripts/fred_examples.py (opens in a new tab)scripts/fred_keyless.py (opens in a new tab)scripts/fred_query.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Not loaded · from alterlab-writing-tools
Claude Code won't load this skill
It ships in alterlab-writing-tools at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
Generated from the plugin's indexed repository (alterlab-ieu/alterlab-academic-skills) — no native marketplace selected
npx claudepluginhub p/alterlab-ieu-alterlab-writing-tools2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
241 skills in this plugin
/alterlab-abm-mesaBuilds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(rng=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request mentions an agent-based model, Mesa, simulating interacting agents, or emergent macro behavior from micro rules. For discrete-event (queueing/process) simulation prefer alterlab-simpy; for reinforcement learning prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite./alterlab-academic-careerPrepares academic career documents and professional-development materials for faculty and researchers. Use when drafting academic CVs, research statements, teaching philosophies, diversity statements, faculty-position cover letters, tenure dossiers, promotion narratives, academic portfolios, or mentorship statements, and when planning conference-networking strategy, building academic web presence, setting up ORCID profiles, or understanding impact metrics. Part of the AlterLab Academic Skills suite.Other plugins' skills for the same job