← all posts
tutorialMay 23, 2026· 3 min readclaude-drafted

Build an Economic Research Agent with FRED, BLS, and World Bank Data Using Katzilla

Learn how to build a powerful economic research agent that pulls live data from FRED, BLS, and World Bank through a single unified API. Katzilla's SDK makes it trivial to aggregate 300+ public data sources into one coherent AI workflow.

# Build an Economic Research Agent with FRED, BLS, and World Bank Data Using Katzilla

Economic research has always been a multi-source problem. You need Fed data over here, labor statistics over there, and global development indicators somewhere else entirely. Stitching those together manually means managing three different authentication schemes, three different response formats, and three different rate limit policies.

Katzilla eliminates all of that. As of today, May 23, 2026, Katzilla aggregates 300+ free public data sources — including FRED, BLS, and World Bank — behind a single REST API with one SDK and one API key.

In this tutorial, we'll build a lightweight economic research agent that:

  • Pulls current U.S. GDP growth data from FRED
  • Fetches the latest unemployment figures from BLS
  • Queries World Bank poverty and inflation indicators for global context
  • Synthesizes a plain-language economic snapshot

Prerequisites

Install the Katzilla Node.js SDK:

npm install @katzilla/sdk

Grab your free API key at katzilla.dev and set it as an environment variable:

export KATZILLA_API_KEY=your_key_here

Setting Up the Agent

Create a new file called economicAgent.js. The Katzilla SDK uses a consistent .query() interface across all data sources, so switching from FRED to BLS to World Bank requires nothing more than changing the source name and parameters.

import Katzilla from '@katzilla/sdk';

const katz = new Katzilla({ apiKey: process.env.KATZILLA_API_KEY });

async function fetchEconomicSnapshot() {
  // 1. FRED: Real GDP Growth Rate (GDPC1)
  const gdpData = await katz.query({
    source: 'fred',
    series: 'GDPC1',
    limit: 4,
    frequency: 'quarterly'
  });

  // 2. BLS: National Unemployment Rate (LNS14000000)
  const unemploymentData = await katz.query({
    source: 'bls',
    seriesId: 'LNS14000000',
    startYear: '2026',
    endYear: '2026'
  });

  // 3. World Bank: Global inflation and poverty headcount
  const inflationData = await katz.query({
    source: 'worldbank',
    indicator: 'FP.CPI.TOTL.ZG',
    country: 'WLD',
    mrv: 1
  });

  const povertyData = await katz.query({
    source: 'worldbank',
    indicator: 'SI.POV.DDAY',
    country: 'WLD',
    mrv: 1
  });

  return { gdpData, unemploymentData, inflationData, povertyData };
}

async function runAgent() {
  console.log('Economic Research Agent — Katzilla | 2026-05-23\n');

  const snapshot = await fetchEconomicSnapshot();

  const latestGDP = snapshot.gdpData.observations.at(-1);
  const latestUnemployment = snapshot.unemploymentData.Results.series[0].data[0];
  const latestInflation = snapshot.inflationData.value[Object.keys(snapshot.inflationData.value)[0]];
  const latestPoverty = snapshot.povertyData.value[Object.keys(snapshot.povertyData.value)[0]];

  console.log(`📈 U.S. Real GDP (latest quarter): ${latestGDP.value} billion USD`);
  console.log(`👷 U.S. Unemployment Rate: ${latestUnemployment.value}%`);
  console.log(`🌍 Global CPI Inflation (World Bank): ${latestInflation}%`);
  console.log(`🏚️  Global Poverty Headcount Ratio: ${latestPoverty}%`);

  // Hand this snapshot to your LLM for synthesis
  return snapshot;
}

runAgent().catch(console.error);

Running the Agent

node economicAgent.js

You'll see a clean economic snapshot printed in seconds — no token juggling, no format translation.

Extending the Agent

Because Katzilla normalizes all 300+ sources, extending this agent is straightforward. Want to cross-reference today's economic data with Treasury debt levels? Add one more query:

const debtData = await katz.query({
  source: 'treasury',
  endpoint: 'debt_to_penny',
  fields: 'tot_pub_debt_out_amt,record_date',
  sort: '-record_date',
  limit: 1
});

Need to flag whether a major natural disaster is distorting regional economic signals? Pull FEMA disaster declarations in the same script. Katzilla's unified interface means your agent can reason across economic, environmental, and financial data without touching a second SDK.

Why This Matters for AI Agents

AI agents are only as good as the data they can reach. Today's economic research workflows demand real-time, multi-source intelligence — and Katzilla is purpose-built for exactly that use case. One key, one SDK, 300+ sources.

Head to katzilla.dev to grab your free API key and start building.

#economic research#AI agents#FRED#BLS#Katzilla
// try katzilla

Government data from 300+ sources, one REST API, free tier to start.