How to Pull FRED Economic Data in Claude Code

Claude Code is great at analysis, but it can’t access live economic data out of the box. If you’re building anything that touches interest rates, unemployment, or inflation, you’ve been copying numbers from the FRED website and pasting them in. Adding the FRED Series Data tool through AgentPatch lets Claude Code pull that data directly.

Why This Matters

A surprising amount of development work involves economic data. Fintech dashboards, mortgage calculators, pricing models, risk analysis tools — they all need real numbers to develop against. Using hardcoded test values works for a while, but eventually you need actual time series data to validate your logic.

With FRED Series Data available as a tool, Claude Code can fetch any of the 800,000+ data series from the Federal Reserve Economic Database. It gets back structured metadata (title, units, frequency, seasonal adjustment) plus an array of date/value observation pairs. No API key management, no data munging — just ask for a series and get clean data back.

Setup

The AgentPatch CLI is designed for AI agents to use via shell access. Install it, and your agent can discover and invoke any tool on the marketplace.

Install (zero dependencies, Python 3.10+):

pip install agentpatch

Set your API key:

export AGENTPATCH_API_KEY=your_api_key

Example commands your agent will use:

ap search "web search"
ap run google-search --input '{"query": "test"}'

Get your API key from the AgentPatch dashboard.

Install the AgentPatch skill — it teaches Claude Code when to use AgentPatch and how to use the CLI:

/plugin marketplace add fullthom/agentpatch-claude-skill
/plugin install agentpatch@agentpatch

MCP Server (Alternative)

If you prefer raw MCP tool access instead of the skill:

claude mcp add -s user --transport http agentpatch https://agentpatch.ai/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Replace YOUR_API_KEY with your actual key from the AgentPatch dashboard.

Example

You’re building a financial dashboard and need to populate a chart with real unemployment data. You tell Claude Code:

“Pull the last 2 years of monthly unemployment rate data from FRED and use it to seed our chart component’s test fixtures.”

Claude Code fetches the data directly:

Fetching FRED series UNRATE from 2024-02-01 to 2026-02-01...

Series: Unemployment Rate
Units: Percent
Frequency: Monthly
Seasonal Adjustment: Seasonally Adjusted

Got 24 observations. Here's a sample:

2024-02-01: 3.9
2024-08-01: 4.2
2025-02-01: 4.0
2025-08-01: 4.1
2026-02-01: 4.0

Writing these to fixtures/unemployment.json and updating the chart test to load
from the fixture file. The data is already in date/value pairs so it maps
directly to the chart's expected format.

Claude Code fetched real FRED data, used it to understand the shape and range of actual values, and wired it into your test fixtures — all without you leaving the terminal.

Wrapping Up

With AgentPatch connected, Claude Code can pull any FRED time series during a session. Combine it with fred-search to discover series IDs you don’t already know. The same config also gives access to Google Search, email, image generation, and everything else on the marketplace. Explore at agentpatch.ai.