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
Install the AgentPatch CLI (zero dependencies, Python 3.10+):
pip install agentpatch
Set your API key:
export AGENTPATCH_API_KEY=your_api_key
Then use it:
ap search "web search"
ap run agentpatch google-search --input '{"query": "test"}'
Get your API key from the AgentPatch dashboard.
Run this command to add AgentPatch as an MCP server:
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. Claude Code discovers all AgentPatch tools automatically.
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.