fred-sentinel
v0.0.1
Published
Specific opinionated Wrapper of the FRED API to be used by the Sentinel
Downloads
125
Readme
fred-sentinel
A minimal FRED API client with built-in request throttling.
Created for the sentinel-backend with a focused feature set.
Installation
npm install fred-sentinelUsage
import { FRED } from 'fred-sentinel'
const fred = new FRED('your-api-key')API
getCurrentMRR()
Returns the current Maximum Reserve Rate.
const { mrr, mrrDate } = await fred.getCurrentMRR()getTodaysDataReleases()
Returns data releases scheduled for today.
const releases = await fred.getTodaysDataReleases()
// Returns: [{ name, id, startDate, endDate }, ...]getDataReleasesForDate(date)
Returns data releases for a specific date.
const releases = await fred.getDataReleasesForDate('2024-01-15')
// Also accepts Date objectsgetReleaseDatesForId(id)
Returns all release dates for a release ID.
const dates = await fred.getReleaseDatesForId(123)
// Returns: ['2024-01-01', '2024-01-15', ...]getFutureReleaseDatesForId(id)
Returns future release dates for a release ID (from today onwards).
const dates = await fred.getFutureReleaseDatesForId(123)Features
- Throttled requests - Respects FRED's 2 requests/second limit with burst support
- Request deduplication - Identical concurrent requests are coalesced
- Minimal dependencies - Lightweight and focused
API Key
Get a free API key at https://fred.stlouisfed.org/docs/api/api_key.html
