You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A fully-typed TypeScript client for the FRED® API (Federal Reserve Economic Data), published by the St. Louis Fed.
Covers all 36 endpoints across Categories, Releases, Series, Sources, Tags, GeoFRED Maps, and the v2 bulk API.
Features
✅ Full TypeScript types for every request and response
✅ All 36 FRED® API endpoints covered
✅ ESM + CJS dual output
✅ Zero runtime dependencies
✅ Custom fetch support (bring your own, for Node 18-, Deno, Bun, etc.)
✅ Configurable timeout and base URL
✅ Meaningful error types (FredError) with HTTP status codes
Installation
npm install fred-api-client
Node.js ≥ 18 is required (uses native fetch). For Node < 18 provide a custom fetch via the fetch option.
Quick Start
import{FredClient}from'fred-api-client';constfred=newFredClient({apiKey: 'YOUR_API_KEY'});// Get GDP observationsconstdata=awaitfred.series.getSeriesObservations({series_id: 'GDP'});console.log(data.observations);// Search for seriesconstresults=awaitfred.series.searchSeries({search_text: 'unemployment rate'});console.log(results.seriess);
# Install dependencies
npm install
# Run tests
npm test# Run tests with coverage
npm run test:coverage
# Type check
npm run typecheck
# Lint
npm run lint
# Build
npm run build