Skills

API Data Fetcher

Fetch economic data from FRED, World Bank, and other APIs

Install

npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill api-data-fetcher -g -a claude-code -y
Category
Engineering
Updated
5d ago
License
See repository
Context cost
Mediumabout 2,328 tokens
Runs scripts
No, instructions only

What it does

Fetch economic data from FRED, World Bank, and other APIs

API Data Fetcher

Purpose

This skill helps economists fetch data from major economic data APIs including FRED (Federal Reserve Economic Data), World Bank, IMF, BLS, and OECD. It generates clean, documented Python code with proper error handling.

When to Use

  • Downloading macroeconomic indicators
  • Building custom datasets from multiple sources
  • Automating data updates for ongoing projects
  • Fetching cross-country panel data

Instructions

Step 1: Identify Data Requirements

Ask the user:

  1. What data do you need? (GDP, unemployment, inflation, etc.)
  2. What time period and frequency?
  3. What countries/regions?
  4. Preferred output format? (CSV, DataFrame, etc.)

Step 2: Select Appropriate API

Data TypeBest SourcePackage
US macroFREDfredapi
Global developmentWorld Bankwbdata
Labor statisticsBLSbls
Cross-countryOECDpandasdmx
FinancialYahoo Financeyfinance

Step 3: Generate Clean Code

Include:

  • API key handling (environment variables)
  • Error handling for API failures
  • Data cleaning and formatting
  • Documentation of series definitions

Example Output

"""
Economic Data Fetcher
=====================
Downloads macroeconomic data from FRED and World Bank APIs.
Requires: fredapi, wbdata, pandas

Setup: Set FRED_API_KEY environment variable
Get a free key from: https://fred.stlouisfed.org/docs/api/api_key.html
"""

import os
import pandas as pd
from datetime import datetime, timedelta
from typing import List, Optional, Dict

# ============================================
# FRED Data Fetcher
# ============================================
Read the whole SKILL.md on GitHub

More in Engineering