fred

n8n community node for FRED® (Federal Reserve Economic Data) API v2

Package Information

Released: this month
Downloads: 0 weekly / 0 monthly
Latest Version: 0.0.4
Author: Jon Aldekoa

Documentation

n8n-nodes-fred

This is an n8n community node. It lets you retrieve economic data from FRED® (Federal Reserve Economic Data, Federal Reserve Bank of St. Louis) through the FRED API v2 in your n8n workflows.

n8n is a fair-code licensed workflow automation platform.

Installation

Follow the installation guide in the n8n community nodes documentation and install n8n-nodes-fred.

Operations

Resource Operation Endpoint
Release Get Observations GET fred/v2/release/observations

Release → Get Observations

Gets the observations for all series on a release of economic data.

Parameter Description
Release ID ID of the release (e.g. 53 = Gross Domestic Product, 52 = Z.1 Financial Accounts). It appears in the release URL, e.g. https://fred.stlouisfed.org/release?rid=53.
Return All Follows next_cursor until has_more is false, retrieving the whole release (500,000 observations per request).
Limit When Return All is off: maximum number of observations (not series) to return (1–500,000).
Output One Item per Series (metadata + observations array), One Item per Observation (flattened with series metadata) or Raw Response (one item per API page, includes has_more and next_cursor).

Options:

  • Convert Values to Numbers (default on): converts values to numbers; FRED's missing value marker "." becomes null.
  • Include Series Notes (default on): turn off to drop the long notes field.
  • Next Cursor: continue from a cursor returned by a previous request. Combine with Raw Response output to paginate manually (e.g. in a loop).

When Return All is on, a series split across two pages is merged back into a single item. Requests are spaced to respect FRED's limit of 2 requests per second, and HTTP 429 responses are retried with exponential backoff.

Note: large releases are big. The GDP release (53) returns 12,700 series and ~1.4M observations (60 MB of JSON). Prefer One Item per Series over One Item per Observation for whole releases.

Credentials

  1. Sign in at fredaccount.stlouisfed.org and request an API key.
  2. In n8n, create a FRED API credential and paste the key.

The key is sent as an HTTP header: Authorization: Bearer <api key>.

Usage

Example: get the latest data for the GDP release, one item per series, without notes.

  • Resource: Release, Operation: Get Observations
  • Release ID: 53, Return All: on
  • Output: One Item per Series, Options → Include Series Notes: off

The node is marked usableAsTool, so it can also be used by n8n AI Agents.

Development

npm install
npm run dev     # starts n8n locally with this node loaded (http://localhost:5678)
npm run build
npm run lint

Adding new FRED v2 endpoints

The node is organized by resource and operation so new endpoints can be added without touching existing ones:

nodes/Fred/
├── Fred.node.ts                  # node definition + generic execute() router
├── resources/
│   ├── index.ts                  # registry: resource -> operation -> handler
│   └── release/
│       ├── index.ts              # Operation options for the "Release" resource
│       └── getObservations.ts    # UI properties + handler for fred/v2/release/observations
└── shared/
    ├── transport.ts              # authenticated requests, 429 retries
    └── utils.ts
  1. Create resources/<resource>/<operation>.ts exporting its INodeProperties[] (with displayOptions for its resource/operation) and a handler (this: IExecuteFunctions, itemIndex) => Promise<IDataObject[]> that uses fredApiRequest.
  2. Add the operation to resources/<resource>/index.ts.
  3. For a new resource, register it in resources/index.ts and add it to the Resource options in Fred.node.ts.

Resources

This product uses the FRED® API but is not endorsed or certified by the Federal Reserve Bank of St. Louis.

Discussion