Skill Tracer
Skills › Scientific Agent Skills › database-lookup › fred.md

fred.md

297 lines · skills/database-lookup/references/fred.md at 5f2bc03

Open on GitHub
1# FRED (Federal Reserve Economic Data) API Reference
2

FRED (Federal Reserve Economic Data) API Reference

Raw lines 1 to 2
3## Overview
4The FRED API, provided by the Federal Reserve Bank of St. Louis, offers access to over 800,000 economic time series from 100+ sources. Covers GDP, employment, inflation, interest rates, money supply, trade, housing, and much more.
5

Overview

The FRED API, provided by the Federal Reserve Bank of St. Louis, offers access to over 800,000 economic time series from 100+ sources. Covers GDP, employment, inflation, interest rates, money supply, trade, housing, and much more.

Raw lines 3 to 5
6## Base URL
7```
8https://api.stlouisfed.org/fred
9```

Base URL

https://api.stlouisfed.org/fred
Raw lines 6 to 10
11## Authentication
12- **API Key: REQUIRED.** Register at https://fred.stlouisfed.org/docs/api/api_key.html
13- Pass as query parameter: `&api_key=YOUR_KEY`

Authentication

  • API Key: REQUIRED. Register at https://fred.stlouisfed.org/docs/api/api_key.html
  • Pass as query parameter: &api_key=YOUR_KEY
Raw lines 11 to 14
15## Rate Limits
16- **120 requests per minute** per API key.
17- No daily limit documented, but excessive use may trigger throttling.

Rate Limits

  • 120 requests per minute per API key.
  • No daily limit documented, but excessive use may trigger throttling.
Raw lines 15 to 18
19## Common Parameters (apply to most endpoints)
20| Parameter | Type | Required | Default | Description |
21|----------------|--------|----------|---------|-------------|
22| `api_key` | string | Yes | - | Your FRED API key. |
23| `file_type` | string | No | `xml` | Response format: `xml` or `json`. |
24| `realtime_start` | string | No | today | Start of real-time period `YYYY-MM-DD`. |
25| `realtime_end` | string | No | today | End of real-time period `YYYY-MM-DD`. |
27---

Common Parameters (apply to most endpoints)

ParameterTypeRequiredDefaultDescription
api_keystringYes-Your FRED API key.
file_typestringNoxmlResponse format: xml or json.
realtime_startstringNotodayStart of real-time period YYYY-MM-DD.
realtime_endstringNotodayEnd of real-time period YYYY-MM-DD.

Raw lines 19 to 28
29## Key Endpoints

Key Endpoints

Raw lines 29 to 30
31### 1. Series Observations (Time Series Data)
33#### `GET /fred/series/observations`
34Returns the data values for an economic time series.
36**Parameters:**
37| Parameter | Type | Required | Default | Description |
38|--------------------|--------|----------|---------------|-------------|
39| `series_id` | string | Yes | - | FRED series ID (e.g., `GDP`, `UNRATE`, `CPIAUCSL`). |
40| `observation_start`| string | No | `1776-07-04` | Start date `YYYY-MM-DD`. |
41| `observation_end` | string | No | `9999-12-31` | End date `YYYY-MM-DD`. |
42| `units` | string | No | `lin` | Data transformation: `lin` (levels), `chg` (change), `ch1` (change from year ago), `pch` (% change), `pc1` (% change from year ago), `pca` (compounded annual % change), `cch` (continuously compounded rate of change), `cca` (continuously compounded annual rate), `log` (natural log). |
43| `frequency` | string | No | (native) | Aggregation frequency: `d`, `w`, `bw`, `m`, `q`, `sa`, `a` (daily through annual). |
44| `aggregation_method` | string | No | `avg` | `avg`, `sum`, `eop` (end of period). |
45| `sort_order` | string | No | `asc` | `asc` or `desc`. |
46| `limit` | int | No | 100000 | Max observations returned (max 100000). |
47| `offset` | int | No | 0 | Pagination offset. |
49**Example:**
50```
51https://api.stlouisfed.org/fred/series/observations?series_id=GDP&api_key=YOUR_KEY&file_type=json&observation_start=2020-01-01&observation_end=2024-12-31&units=pch&frequency=q
52```
54**Response:**
55```json
57 "realtime_start": "2024-11-01",
58 "realtime_end": "2024-11-01",
59 "observation_start": "2020-01-01",
60 "observation_end": "2024-12-31",
61 "units": "pch",
62 "output_type": 1,
63 "file_type": "json",
64 "order_by": "observation_date",
65 "sort_order": "asc",
66 "count": 20,
67 "offset": 0,
68 "limit": 100000,
69 "observations": [
70 {
71 "realtime_start": "2024-11-01",
72 "realtime_end": "2024-11-01",
73 "date": "2020-01-01",
74 "value": "-1.3"
75 },
76 {
77 "realtime_start": "2024-11-01",
78 "realtime_end": "2024-11-01",
79 "date": "2020-04-01",
80 "value": "-8.4"
81 }
82 ]
84```
86Note: `value` is always a string. Missing values appear as `"."`.
88---

1. Series Observations (Time Series Data)

GET /fred/series/observations

Returns the data values for an economic time series.

Parameters:

ParameterTypeRequiredDefaultDescription
series_idstringYes-FRED series ID (e.g., GDP, UNRATE, CPIAUCSL).
observation_startstringNo1776-07-04Start date YYYY-MM-DD.
observation_endstringNo9999-12-31End date YYYY-MM-DD.
unitsstringNolinData transformation: lin (levels), chg (change), ch1 (change from year ago), pch (% change), pc1 (% change from year ago), pca (compounded annual % change), cch (continuously compounded rate of change), cca (continuously compounded annual rate), log (natural log).
frequencystringNo(native)Aggregation frequency: d, w, bw, m, q, sa, a (daily through annual).
aggregation_methodstringNoavgavg, sum, eop (end of period).
sort_orderstringNoascasc or desc.
limitintNo100000Max observations returned (max 100000).
offsetintNo0Pagination offset.

Example:

https://api.stlouisfed.org/fred/series/observations?series_id=GDP&api_key=YOUR_KEY&file_type=json&observation_start=2020-01-01&observation_end=2024-12-31&units=pch&frequency=q

Response:

{
  "realtime_start": "2024-11-01",
  "realtime_end": "2024-11-01",
  "observation_start": "2020-01-01",
  "observation_end": "2024-12-31",
  "units": "pch",
  "output_type": 1,
  "file_type": "json",
  "order_by": "observation_date",
  "sort_order": "asc",
  "count": 20,
  "offset": 0,
  "limit": 100000,
  "observations": [
    {
      "realtime_start": "2024-11-01",
      "realtime_end": "2024-11-01",
      "date": "2020-01-01",
      "value": "-1.3"
    },
    {
      "realtime_start": "2024-11-01",
      "realtime_end": "2024-11-01",
      "date": "2020-04-01",
      "value": "-8.4"
    }
  ]
}

Note: value is always a string. Missing values appear as ".".


Raw lines 31 to 89
90### 2. Series Info (Metadata)
92#### `GET /fred/series`
93Returns metadata for a series.
95**Parameters:**
96| Parameter | Type | Required | Description |
97|------------|--------|----------|-------------|
98| `series_id`| string | Yes | FRED series ID. |
100**Example:**
101```
102https://api.stlouisfed.org/fred/series?series_id=UNRATE&api_key=YOUR_KEY&file_type=json
103```
105**Response:**
106```json
108 "realtime_start": "2024-11-01",
109 "realtime_end": "2024-11-01",
110 "seriess": [
111 {
112 "id": "UNRATE",
113 "title": "Unemployment Rate",
114 "observation_start": "1948-01-01",
115 "observation_end": "2024-10-01",
116 "frequency": "Monthly",
117 "frequency_short": "M",
118 "units": "Percent",
119 "units_short": "%",
120 "seasonal_adjustment": "Seasonally Adjusted",
121 "seasonal_adjustment_short": "SA",
122 "last_updated": "2024-11-01 07:41:02-05",
123 "popularity": 95,
124 "notes": "The unemployment rate represents..."
125 }
126 ]
128```
130---

2. Series Info (Metadata)

GET /fred/series

Returns metadata for a series.

Parameters:

ParameterTypeRequiredDescription
series_idstringYesFRED series ID.

Example:

https://api.stlouisfed.org/fred/series?series_id=UNRATE&api_key=YOUR_KEY&file_type=json

Response:

{
  "realtime_start": "2024-11-01",
  "realtime_end": "2024-11-01",
  "seriess": [
    {
      "id": "UNRATE",
      "title": "Unemployment Rate",
      "observation_start": "1948-01-01",
      "observation_end": "2024-10-01",
      "frequency": "Monthly",
      "frequency_short": "M",
      "units": "Percent",
      "units_short": "%",
      "seasonal_adjustment": "Seasonally Adjusted",
      "seasonal_adjustment_short": "SA",
      "last_updated": "2024-11-01 07:41:02-05",
      "popularity": 95,
      "notes": "The unemployment rate represents..."
    }
  ]
}

Raw lines 90 to 131
132### 3. Series Search
134#### `GET /fred/series/search`
135Search for series by keywords.
137**Parameters:**
138| Parameter | Type | Required | Default | Description |
139|----------------|--------|----------|----------------|-------------|
140| `search_text` | string | Yes | - | Keywords to search. |
141| `search_type` | string | No | `full_text` | `full_text` or `series_id`. |
142| `order_by` | string | No | `search_rank` | `search_rank`, `series_id`, `title`, `units`, `frequency`, `seasonal_adjustment`, `realtime_start`, `realtime_end`, `last_updated`, `observation_start`, `observation_end`, `popularity`, `group_popularity`. |
143| `sort_order` | string | No | `asc` | `asc` or `desc`. |
144| `limit` | int | No | 1000 | Max results (max 1000). |
145| `offset` | int | No | 0 | Pagination offset. |
146| `filter_variable` | string | No | - | `frequency`, `units`, `seasonal_adjustment`. |
147| `filter_value` | string | No | - | Value to filter on (e.g., `Monthly`). |
148| `tag_names` | string | No | - | Semicolon-delimited tags to filter (e.g., `gdp;quarterly`). |
150**Example:**
151```
152https://api.stlouisfed.org/fred/series/search?search_text=consumer+price+index&api_key=YOUR_KEY&file_type=json&limit=5
153```
155**Response:**
156```json
158 "realtime_start": "2024-11-01",
159 "realtime_end": "2024-11-01",
160 "order_by": "search_rank",
161 "sort_order": "asc",
162 "count": 1256,
163 "offset": 0,
164 "limit": 5,
165 "seriess": [
166 {
167 "id": "CPIAUCSL",
168 "title": "Consumer Price Index for All Urban Consumers: All Items in U.S. City Average",
169 "observation_start": "1947-01-01",
170 "observation_end": "2024-09-01",
171 "frequency": "Monthly",
172 "units": "Index 1982-1984=100",
173 "seasonal_adjustment": "Seasonally Adjusted",
174 "popularity": 95
175 }
176 ]
178```
180---

3. Series Search

GET /fred/series/search

Search for series by keywords.

Parameters:

ParameterTypeRequiredDefaultDescription
search_textstringYes-Keywords to search.
search_typestringNofull_textfull_text or series_id.
order_bystringNosearch_ranksearch_rank, series_id, title, units, frequency, seasonal_adjustment, realtime_start, realtime_end, last_updated, observation_start, observation_end, popularity, group_popularity.
sort_orderstringNoascasc or desc.
limitintNo1000Max results (max 1000).
offsetintNo0Pagination offset.
filter_variablestringNo-frequency, units, seasonal_adjustment.
filter_valuestringNo-Value to filter on (e.g., Monthly).
tag_namesstringNo-Semicolon-delimited tags to filter (e.g., gdp;quarterly).

Example:

https://api.stlouisfed.org/fred/series/search?search_text=consumer+price+index&api_key=YOUR_KEY&file_type=json&limit=5

Response:

{
  "realtime_start": "2024-11-01",
  "realtime_end": "2024-11-01",
  "order_by": "search_rank",
  "sort_order": "asc",
  "count": 1256,
  "offset": 0,
  "limit": 5,
  "seriess": [
    {
      "id": "CPIAUCSL",
      "title": "Consumer Price Index for All Urban Consumers: All Items in U.S. City Average",
      "observation_start": "1947-01-01",
      "observation_end": "2024-09-01",
      "frequency": "Monthly",
      "units": "Index 1982-1984=100",
      "seasonal_adjustment": "Seasonally Adjusted",
      "popularity": 95
    }
  ]
}

Raw lines 132 to 181
182### 4. Category Lookup
184#### `GET /fred/category`
185Get info for a specific category.
187**Parameters:**
188| Parameter | Type | Required | Description |
189|-------------|------|----------|-------------|
190| `category_id`| int | Yes | Category ID (0 = root). |
192**Example:**
193```
194https://api.stlouisfed.org/fred/category?category_id=0&api_key=YOUR_KEY&file_type=json
195```
197#### `GET /fred/category/children`
198Get child categories.
200**Example:**
201```
202https://api.stlouisfed.org/fred/category/children?category_id=0&api_key=YOUR_KEY&file_type=json
203```
205#### `GET /fred/category/series`
206Get all series in a category.
208**Parameters:**
209| Parameter | Type | Required | Description |
210|-------------|------|----------|-------------|
211| `category_id`| int | Yes | Category ID. |
212| `limit` | int | No | Max results (max 1000). |
213| `offset` | int | No | Pagination offset. |
215**Example:**
216```
217https://api.stlouisfed.org/fred/category/series?category_id=125&api_key=YOUR_KEY&file_type=json
218```
220---

4. Category Lookup

GET /fred/category

Get info for a specific category.

Parameters:

ParameterTypeRequiredDescription
category_idintYesCategory ID (0 = root).

Example:

https://api.stlouisfed.org/fred/category?category_id=0&api_key=YOUR_KEY&file_type=json

GET /fred/category/children

Get child categories.

Example:

https://api.stlouisfed.org/fred/category/children?category_id=0&api_key=YOUR_KEY&file_type=json

GET /fred/category/series

Get all series in a category.

Parameters:

ParameterTypeRequiredDescription
category_idintYesCategory ID.
limitintNoMax results (max 1000).
offsetintNoPagination offset.

Example:

https://api.stlouisfed.org/fred/category/series?category_id=125&api_key=YOUR_KEY&file_type=json

Raw lines 182 to 221
222### 5. Releases
224#### `GET /fred/releases`
225Get all economic data releases.
227**Example:**
228```
229https://api.stlouisfed.org/fred/releases?api_key=YOUR_KEY&file_type=json
230```
232#### `GET /fred/release/series`
233Get all series in a specific release.
235**Parameters:**
236| Parameter | Type | Required | Description |
237|------------|------|----------|-------------|
238| `release_id`| int | Yes | Release ID. |
240**Example:**
241```
242https://api.stlouisfed.org/fred/release/series?release_id=53&api_key=YOUR_KEY&file_type=json
243```
245---

5. Releases

GET /fred/releases

Get all economic data releases.

Example:

https://api.stlouisfed.org/fred/releases?api_key=YOUR_KEY&file_type=json

GET /fred/release/series

Get all series in a specific release.

Parameters:

ParameterTypeRequiredDescription
release_idintYesRelease ID.

Example:

https://api.stlouisfed.org/fred/release/series?release_id=53&api_key=YOUR_KEY&file_type=json

Raw lines 222 to 246
247### 6. Tags
249#### `GET /fred/tags`
250Get all tags and their frequency of use.
252#### `GET /fred/series/search/tags`
253Get tags matching a series search.
255**Example:**
256```
257https://api.stlouisfed.org/fred/series/search/tags?series_search_text=mortgage+rate&api_key=YOUR_KEY&file_type=json
258```
260---

6. Tags

GET /fred/tags

Get all tags and their frequency of use.

GET /fred/series/search/tags

Get tags matching a series search.

Example:

https://api.stlouisfed.org/fred/series/search/tags?series_search_text=mortgage+rate&api_key=YOUR_KEY&file_type=json

Raw lines 247 to 261
262## Commonly Used Series IDs
264| Series ID | Description |
265|--------------|-------------|
266| `GDP` | Gross Domestic Product (quarterly, billions $) |
267| `GDPC1` | Real GDP (chained 2017 dollars) |
268| `A191RL1Q225SBEA` | Real GDP growth rate (annualized quarterly) |
269| `UNRATE` | Unemployment Rate (monthly, %) |
270| `PAYEMS` | Total Nonfarm Payrolls (monthly, thousands) |
271| `CPIAUCSL` | CPI All Urban Consumers (monthly, index) |
272| `CPILFESL` | Core CPI (excl. food & energy) |
273| `PCEPI` | PCE Price Index |
274| `PCEPILFE` | Core PCE Price Index |
275| `FEDFUNDS` | Federal Funds Effective Rate (monthly, %) |
276| `DFF` | Federal Funds Effective Rate (daily) |
277| `DGS10` | 10-Year Treasury Constant Maturity Rate (daily) |
278| `DGS2` | 2-Year Treasury Rate (daily) |
279| `T10Y2Y` | 10Y-2Y Treasury Spread |
280| `MORTGAGE30US` | 30-Year Fixed Mortgage Rate (weekly) |
281| `M2SL` | M2 Money Stock (monthly) |
282| `HOUST` | Housing Starts (monthly, thousands) |
283| `RSAFS` | Retail Sales (monthly, millions $) |
284| `INDPRO` | Industrial Production Index |
285| `UMCSENT` | U. of Michigan Consumer Sentiment |
286| `SP500` | S&P 500 Index (daily) |
287| `VIXCLS` | CBOE Volatility Index (daily) |
288| `DEXUSEU` | USD/EUR Exchange Rate (daily) |
289| `DCOILWTICO`| WTI Crude Oil Price (daily) |
290| `BOPGSTB` | Trade Balance (monthly, millions $) |
291| `GFDEBTN` | Federal Debt Total Public Debt |

Commonly Used Series IDs

Series IDDescription
GDPGross Domestic Product (quarterly, billions $)
GDPC1Real GDP (chained 2017 dollars)
A191RL1Q225SBEAReal GDP growth rate (annualized quarterly)
UNRATEUnemployment Rate (monthly, %)
PAYEMSTotal Nonfarm Payrolls (monthly, thousands)
CPIAUCSLCPI All Urban Consumers (monthly, index)
CPILFESLCore CPI (excl. food & energy)
PCEPIPCE Price Index
PCEPILFECore PCE Price Index
FEDFUNDSFederal Funds Effective Rate (monthly, %)
DFFFederal Funds Effective Rate (daily)
DGS1010-Year Treasury Constant Maturity Rate (daily)
DGS22-Year Treasury Rate (daily)
T10Y2Y10Y-2Y Treasury Spread
MORTGAGE30US30-Year Fixed Mortgage Rate (weekly)
M2SLM2 Money Stock (monthly)
HOUSTHousing Starts (monthly, thousands)
RSAFSRetail Sales (monthly, millions $)
INDPROIndustrial Production Index
UMCSENTU. of Michigan Consumer Sentiment
SP500S&P 500 Index (daily)
VIXCLSCBOE Volatility Index (daily)
DEXUSEUUSD/EUR Exchange Rate (daily)
DCOILWTICOWTI Crude Oil Price (daily)
BOPGSTBTrade Balance (monthly, millions $)
GFDEBTNFederal Debt Total Public Debt
Raw lines 262 to 292
293## Notes
294- Real-time periods: FRED supports vintage data. The `realtime_start`/`realtime_end` parameters let you retrieve data as it was known at a specific point in time (useful for analyzing data revisions).
295- The `units` parameter for transformations is very powerful -- it avoids having to compute percent changes client-side.
296- Values are returned as strings; `"."` means missing/unavailable.
297- For FRED bulk data, they offer a download API at `https://api.stlouisfed.org/geofred/` for geographic/regional data.

Notes

  • Real-time periods: FRED supports vintage data. The realtime_start/realtime_end parameters let you retrieve data as it was known at a specific point in time (useful for analyzing data revisions).
  • The units parameter for transformations is very powerful -- it avoids having to compute percent changes client-side.
  • Values are returned as strings; "." means missing/unavailable.
  • For FRED bulk data, they offer a download API at https://api.stlouisfed.org/geofred/ for geographic/regional data.
Raw lines 293 to 297