FRED: how it works
FRED is the St. Louis Fed's economic database, served over a keyed JSON API at api.stlouisfed.org. Taji takes two things from it: the dates the headline US releases came out, and each headline series' observations as they stood on chosen past days (ALFRED vintages). The crate taji-fred (plugins/fred/) is a class-less data source: one HTTP client, one Source, no bars, no stream, no orders. The kernel's economic join asks it, beside Yahoo's calendar, and computes every figure itself.
The vendor
Host. One production host, https://api.stlouisfed.org, version 1 under /fred/. There is no sandbox or paper environment: every call reads the real database.
Auth. Every request carries api_key, "a 32 character lower-cased alpha-numeric string", as a query parameter; "All web service requests require an API key to identify requests" (API keys, fetched 2026-12-02). You request a key while signed in to a fredaccount.stlouisfed.org account. The key is free, carries no plan or entitlement, and the docs state no expiry. There is no token exchange and nothing to refresh.
API families Taji calls (all version 1, file_type=json; the default is XML):
| Endpoint | What it answers | Doc (fetched 2026-12-02) |
|---|---|---|
fred/releases/dates | Every release's dates in a real-time span. limit 1 to 1000, paged by offset against count; realtime_start defaults to the first day of the current year; include_release_dates_with_no_data=true adds dates with no data yet, such as future calendar dates. | releases/dates |
fred/series/observations | A series' observations. output_type=2 answers "observations by vintage date, all observations" for the vintage_dates you list. units defaults to lin (levels). | series/observations |
fred/series | One series' metadata. Taji sends it as the key check and as the 300 s warm call. | series |
Real time and vintages. "The real-time period marks when facts were true or when information was known until it changed" (real-time periods, fetched 2026-12-02). A vintage date names one day of that history: asking a series at vintage 2026-10-13 answers what FRED held that day, before a later release revised or added to it. This is ALFRED, and it is what makes a value point-in-time.
Errors and limits. The statuses are 400, 404, 423, 429 and 500, and an error body is {"error_code", "error_message"}. "Up to 120 requests per minute are allowed before being served a 429 error code. Not complying with the throttling can result in a temporary block" (errors, fetched 2026-12-02). The observations page bounds vintage_dates per call: "any output_type or other series: ... 2000 json" (fewer for USRECD and daily series in CSV and XLSX). No page states a concurrency limit.
Terms. The legal page (fetched 2026-12-02) forbids using the API "in connection with storing, caching, or archiving any portion of the FRED® Services or FRED® Content" (API prohibitions, item (l)) and in AI or machine-learning training (item (k)). The API terms (fetched 2026-12-02) require the notice "This product uses the FRED® API but is not endorsed or certified by the Federal Reserve Bank of St. Louis.", require the owner's permission for third-party series beyond personal use, and let the Fed limit bandwidth or end the license at any time. The measured and quoted terms live in the README's Terms.
What Taji does not use, and why:
unitsother thanlin(chg,pch,pc1and the rest): the kernel computes each transform off levels (0001), and a non-linunit renames the answer's columns (README API).output_type1, 3 and 4,frequencyandaggregation_method: the join needs only whole vintages of the native series.fred/release/dates,fred/series/vintagedates,fred/series/release: not yet built; the kernel picks vintages from release dates.- Categories, sources, tags,
fred/series/search,fred/series/updates,fred/release/tables: not yet built. - The Maps API (GeoFRED): not yet built.
- Version 2 (fetched 2026-12-02), whose one endpoint
fred/v2/release/observationsreturns every series of a release in bulk and takes the key asAuthorization: Bearer(v2 keys, fetched 2026-12-02): not yet built. - XML, CSV and XLSX answers: JSON is the one format the client parses.
- FRED's own release calendar as the calendar: Yahoo's calendar is the calendar, and FRED dates a headline release only where Yahoo lists none of it (README API, Yahoo's economic facts).
Code map
| File | What it owns | Read first |
|---|---|---|
plugins/fred/taji-plugin.toml | The manifest: id, the one [[sources]], the fred link form with its steps, risk and the key field. | [[link]] |
plugins/fred/src/lib.rs | Plugin; the HTTP Client (release dates, vintages, key check, warm); FredError; the per-key budget table BUDGETS and rate_limits; scrub, which masks an echoed key. | Client::get |
plugins/fred/src/source.rs | Fred, the Source the hub seats; FACTS; CAP, the bars-table row that serves no bars; VALUES, FRED's release ids and series for each headline event; read, which answers the join's words. | Source::read |
plugins/fred/src/offer.rs | OFFER: what data/coverage lists as FRED's offer (class-less economic, history only). | CLASSLESS |
plugins/fred/tests/egress.rs | The bytes FRED is sent, a redirect left unfollowed, and a refused send to an ungranted host. | rest |
plugins/fred/tests/egress/rest.txt | The golden of every request rest sends. | — |
plugins/fred/tests/live.rs | The live suite against your key. | vintages |
plugins/fred/ui/mark.svg | The mark Connections draws. | — |
How it plugs into Taji
Composition. taji-open adds taji_fred::Plugin (engine/crates/taji-open/src/lib.rs), whose build registers source::Fred as the hub provider fred. Its only Taji dependency is taji-plugin, with its vendor feature (0003).
Traits. Fred implements the SDK's Source (engine/crates/taji-plugin/src/vendor/): facts, seat, probe, history, hosts, check, read and rate_limits. It implements no HistoricalData (history refuses fred serves no bars), no LiveStream, no VenueReads, ExecutionOps or ReconcileOps.
FACTS (source.rs):
seat: Seat::Key { anew: false }: seated on its own data key, sealed underfred. The seated login keeps its values after the vault locks, so reads go on.unclassed: [(Economic, History)]: one class-less product, history only.permits: SOCKETS: 16 calls at once through the hub's gate, the bound for a vendor that documents no concurrency limit (engine/crates/taji-plugin/src/vendor/gate.rs).stores_none: true: no answer is pulled into the hub's store.bars_cap: Some(&CAP): a bars-table row with no classes, costFree,rate_per_min120, so the coverage tables list FRED.releases: Some(VALUES): FRED's role in theeconomicjoin isRole::Values.VALUESmaps each of the kernel's 18 headline releases to FRED's release id (cpi10,nfp50,fomc101,durable_goodsandfactory_ordersboth 95) and each headline event to a series and aTransform(cpi.momisCPIAUCSLpch,cpi.yoyisCPIAUCNSpc1,nfp.payrollsisPAYEMSchg). Itstodaydates FRED's newest vintage on the America/Chicago calendar.offer: Some(&OFFER). There is noVenueFacts: FRED is no venue.
Link form. The manifest's one form, fred (kind = "fields"), takes one secret field, key; its steps are the manifest's (taji-plugin.toml). The form posts to POST /verb/link/data/link with provider: fred.
Words. The join asks through Source::read in the words of engine/crates/taji-plugin/src/vendor/releases.rs: release_dates=<first>,<last>, or series_id, vintage_dates and observation_start. read answers {"rows": [...]}, built by that module's dated and observed, which the hub reads back with dates_of and vintages_of. Any other ask is NoSource.
| Taji surface | Vendor call | Made in |
|---|---|---|
GET /get/economic, a headline row's actual, prior, prior_revised_from, period, values fred | series/observations?output_type=2&vintage_dates=… | Client::vintages (lib.rs), asked by valued (engine/crates/taji-trading/src/hub/sources/economic.rs) |
GET /get/economic, a date-only headline row where Yahoo lists none | releases/dates?…&limit=1000&offset=N | Client::release_dates (lib.rs) |
GET /get/economic?provider=fred | both of the above, Yahoo not asked | economic.rs |
POST /verb/link/data/link, the key check before sealing | series?series_id=GNPCA | Source::check (source.rs), within CHECK_TIMEOUT (5 s) |
| The connection kept open | series?series_id=GNPCA every 300 s | Client::warm, started by Fred::build through Cx::keep_warm |
GET /read/link/rate_limits, scope requests, draws economic, quota 120 | none | rate_limits (lib.rs) |
GET /read/data/coverage, its economic entry; coverage page | none | OFFER, FACTS |
GET /read/link/forms, the fred form | none | taji-plugin.toml |
The route rows that own each answer's full shape are in the //! header of engine/crates/taji/src/wire/mod.rs.
One read, wire to vendor and back. GET /get/economic?from=2026-10-12&to=2026-10-19&releases=cpi:
parse_economic(engine/crates/taji/src/wire/data.rs) builds theGet; the hub'seconomic.rsasks Yahoo's calendar for the span.valuedasks FREDreleases::dates_ask(first, last)for headline releases Yahoo did not list, then, per series, onevintages_askcarrying every vintage its rows need (the day before and the day of each release; the day of and the day after for the FOMC decision), from 500 days before the earliest release.Fred::readtakes the seated client, or answersNoStoredCredentialswhile none is seated, and runs the call throughCx::call, the provider's gate.Client::getadmits one charge against the key's budget, refusing unsent asRateLimitedwhen it is short or held. It then builds the GET withapi_keyset to the login's marker, never the key, and sends it throughLogin::send(substrate/taji-brokerage/src/egress.rs), which swaps the marker for the key only toward the granted hostapi.stlouisfed.org.- The answer maps by status: 429 holds the budget 60 s and is
RateLimited; 5xx and transport errors areUnreachable; another non-2xx isRefusedwith FRED'serror_message, scrubbed of any 32-character key; 2xx parses, andobservationturns each<SERIES>_<YYYYMMDD>column into a vintage,"."intoNone. readreturns rows;economic.rscomputesactualandpriorby the event'sTransformand fills the row withvaluesfredand Yahoo'sestimatekept.
FRED takes no orders and sends no messages, so there is no order path.
Why it is built this way
- Point-in-time by vintage, not by
realtimerange. Oneoutput_type=2call answers a series at every vintage a span's rows need, so a figure is what was knowable on its release day and a revision shows asprior_revised_from. A vintage that does not yet hold an observation has no column, which the client keeps as absent, never as zero (README API). - Yahoo dates, FRED values. FRED's calendar is its own: no row carries a time, rid 101 is dated every day, and rid 27 and rid 95 carry dates the agencies do not (README API). So Yahoo's calendar dates a release where it lists one, FRED's dates fill only what Yahoo leaves out, and the FOMC decision is never dated by FRED. An id two headline releases share (95) dates neither (
economic.rs). - Levels in, figures computed by the kernel. The client never sends
units; the kernel appliesTransform(0001). This also avoids the column renaming non-linunits cause. - Nothing stored. The terms forbid storing or caching FRED content, so
stores_nonekeeps answers out of the store and each read asks FRED again. - The key never leaves the egress table. The client holds a
Login, puts its marker in the query, and letsLogin::sendsubstitute it toward the granted host alone.send's errors carry no URL, the response URL is never read,DebugforClientprints only the base, andscrubmasks a key FRED echoes in an error (0005). - One budget per key, never waiting, never retrying. FRED counts per key, so every client on one login shares one sliding 120-a-minute budget in
BUDGETS. A read refused at once beats a read that queues past its deadline; a 429 holds the budget for FRED's minute so no further request risks the "temporary block". - 500 vintages per call. The observations page caps JSON at 2,000 (series/observations, fetched 2026-12-02), but FRED's edge refuses a URL past about 8 KB: 600 vintages answered 200 and 700 a 400 (README API). More are split into calls and merged.
- Warm every 300 s. The host drops an idle connection between 420 and 600 s (README API); a warm costs one request of the 120.
- A fresh client at each seat.
seatbuilds the client anew over the linked key's login, so a relinked key is the one read. - Through the hub as
economic, never a FRED route. No client sees a FRED shape; a second values source fills the sameRole::Values(0004).
Constraints and limits
- Rate.
queue::admitcharges each GET against the key'sBudget(120 a minute, sliding). A short or held budget isFredError::RateLimitedwith its retry-after, unsent;tradingmaps it toTradingError::RateLimited, which the gate turns into a not-before for later calls. In a joined read FRED's part carries the refusal while Yahoo's rows still answer. The measured numbers are in the README's API. - Concurrency. The gate holds 16 calls; FRED states no ceiling, an open item in the README's Open.
- Dates.
realtime_startafter FRED's today is a 400 and a future vintage is a 500 (README API).Values::todaykeeps every vintage on or before FRED's today in Chicago. - Span.
get/economicanswers at most 31 New York days per read (MAX_DAYSineconomic.rs). - Timeout. Each GET is bounded at 10 s; a key check at 5 s.
- Symbology. Series ids and release ids are FRED's own and live only in
VALUES; no client names them except as a row'sseriesandrelease_id. - Entitlements. None: a key grants no class, so
probereturns an emptyPlanandchecka verdict with no plan. - Third-party series. Some series need the owner's permission beyond personal use (README Terms).
Examples
What Taji sends. The egress golden for rest: two pages of release dates (count 1001), one series at two vintages, then the key check. The key is the test's synthetic fred-TEST. From plugins/fred/tests/egress/rest.txt, headers trimmed:
http GET /releases/dates?api_key=fred-TEST&file_type=json&realtime_start=2026-10-12&realtime_end=2026-10-19&include_release_dates_with_no_data=true&order_by=release_date&sort_order=asc&limit=1000&offset=0
http GET /releases/dates?api_key=fred-TEST&file_type=json&realtime_start=2026-10-12&realtime_end=2026-10-19&include_release_dates_with_no_data=true&order_by=release_date&sort_order=asc&limit=1000&offset=1000
http GET /series/observations?api_key=fred-TEST&file_type=json&series_id=CPIAUCSL&output_type=2&vintage_dates=2026-10-13%2C2026-10-14&observation_start=2026-06-01
http GET /series?api_key=fred-TEST&file_type=json&series_id=GNPCA
accept: */*
accept-encoding: gzip
A vintage answer. The body of vintage_columns_parse_dots_and_absent_columns in plugins/fred/src/lib.rs, shaped as FRED's output_type=2 answer, its figures made up. September is absent at the 10-13 vintage and present at 10-14; October is ".", missing:
{"observations": [
{"date": "2026-08-01", "CPIAUCSL_20261013": "300.100", "CPIAUCSL_20261014": "300.100"},
{"date": "2026-09-01", "CPIAUCSL_20261014": "300.200"},
{"date": "2026-10-01", "CPIAUCSL_20261013": ".", "CPIAUCSL_20261014": "."}
]}
Release dates and a refused key. The hub's fake FRED, fred_for in engine/crates/taji-trading/src/hub/tests.rs, answers its key's releases/dates and every other key with FRED's 400:
{"count":1,"release_dates":[{"release_id":10,"release_name":"Consumer Price Index","date":"2026-10-14"}]}
{"error_code":400,"error_message":"Bad Request. The value for variable api_key is not registered."}
The client maps that 400 to Refused, and the link answers 409 rejected with FRED's words as reason.
The kernel's answer. GET /read/data/coverage, its economic entry, from engine/crates/taji/tests/fixtures/wire/data-coverage.json (releases trimmed):
{"as_of": "2026-10-27", "linked": false,
"offered_data": {"history": ["economic"], "live": [], "realtime": [],
"note": "the headline releases' dates and each series' observations at each ALFRED vintage, on Yahoo's calendar rows; never stored (FRED's terms)"},
"provider": "fred", "reads": {"history": ["economic"], "live": [], "realtime": []},
"releases": ["nfp", "cpi", "ppi", …, "industrial_production", "fomc"],
"source": "https://fred.stlouisfed.org/docs/api/fred/"}
A get/economic row on FRED's values. No capture yet. economic_walk.py <port> linked writes one to <state dir>/economic-walk-linked-<UTC instant>.txt on a headless kernel with your key linked. The test fred_linked_a_headline_row_takes_freds_values_and_yahoos_estimate (economic.rs) asserts the shape offline: for the CPI of 2026-10-14, cpi.mom has values fred, unit percent, period 2026-09-01 and Yahoo's estimate; cpi.yoy is added with series CPIAUCNS and transform pc1.
Testing
| What | Command | Needs |
|---|---|---|
| Client, mapping and source, offline | cargo test -p taji-fred | nothing; runs the src/ tests and tests/egress.rs |
| Re-record the egress golden after a deliberate request change | EGRESS_RECORD=1 cargo test -p taji-fred --test egress rest | nothing |
| The join with FRED's role | cargo test -p taji-trading --lib hub::sources::economic | nothing; a wiremock FRED |
| Seating, linking and unlinking a FRED key, and the join's FRED cases | cargo test -p taji-trading --lib fred | nothing |
| Live suite | cargo test -p taji-fred --test live -- --ignored --test-threads=1 | FRED_API_KEY for release_dates and vintages (SKIP without it); check reaches FRED with a made-up key and needs none |
| Linked over the wire on the shipped binary | engine/crates/taji-open/scripts/vendor_live.sh fred | FRED_API_KEY; links it on a scratch kernel and reads /get/economic asserting values fred |
| The economic walk | engine/crates/taji-open/scripts/economic_walk.py <port> unlinked|linked|at | a headless kernel you booted; linked and at need the key linked, and the script reads FRED_API_KEY itself to cross-check values against FRED |
FRED has no paper or sandbox: every live call reads production and spends your key's budget. Nothing here places an order.
References
- FRED API overview: https://fred.stlouisfed.org/docs/api/fred/ (fetched 2026-12-02)
fred/releases/dates: https://fred.stlouisfed.org/docs/api/fred/releases_dates.html (fetched 2026-12-02)fred/series/observations: https://fred.stlouisfed.org/docs/api/fred/series_observations.html (fetched 2026-12-02)fred/series: https://fred.stlouisfed.org/docs/api/fred/series.html (fetched 2026-12-02)fred/series/vintagedates: https://fred.stlouisfed.org/docs/api/fred/series_vintagedates.html (fetched 2026-12-02)- Real-time periods: https://fred.stlouisfed.org/docs/api/fred/realtime_period.html (fetched 2026-12-02)
- Errors and rate limit: https://fred.stlouisfed.org/docs/api/fred/errors.html (fetched 2026-12-02)
- API keys: https://fred.stlouisfed.org/docs/api/api_key.html (fetched 2026-12-02)
- Version 2 and its keys: https://fred.stlouisfed.org/docs/api/fred/v2/index.html, https://fred.stlouisfed.org/docs/api/fred/v2/api_key.html (fetched 2026-12-02)
- API terms of use: https://fred.stlouisfed.org/docs/api/terms_of_use.html (fetched 2026-12-02)
- FRED legal: https://fred.stlouisfed.org/legal/ (fetched 2026-12-02)