QVeris
Economic Data API Guide

Use the Free FRED Data API
with Python and JSON

Use the free FRED data API to search economic series, request JSON or CSV observations, and preserve units, frequency, vintages, and source metadata.

Published: · By the QVeris Team

Analyst reviewing economic time-series charts on a tablet

TL;DR

What users need

A free API key, the correct endpoint, a FRED series ID, and a small verified request.

Common operations

Search series, read metadata, retrieve observations, inspect releases, and work with vintage dates.

Available formats

FRED endpoints return XML by default and can return JSON; some observations endpoints also support CSV or XLSX.

Best next step

Create a key, query one known series, validate units and dates, then add pagination and caching.

What people want from a free FRED data API

The dominant intent is practical and informational: confirm that the FRED API is free, learn whether an API key is required, find the endpoint for series observations, and see working JSON or Python examples. Secondary needs include searching series, understanding quotas, retrieving releases, and using real-time periods or vintage dates for reproducible research.

Data and features repeated across ranking pages

Repeated entities and fields include the Federal Reserve Bank of St. Louis, FRED, ALFRED, series IDs, observations, releases, categories, tags, units, frequency, seasonal adjustment, API keys, file types, limits, pagination, realtime_start, realtime_end, and vintage dates.

Free FRED data API endpoints to use

SourceTypical coverageInterfaceCheck before use
/fred/series/searchFind series by words, tags, filters, and ordering.REST XML or JSON.Query wording, filters, limit, offset, and series ID.
/fred/seriesRead a series title, units, frequency, adjustment, notes, and dates.REST XML or JSON; API key required.Series ID, source notes, observation dates, and metadata.
/fred/series/observationsRetrieve values with date, unit, frequency, aggregation, and realtime controls.XML, JSON, CSV, or XLSX depending on file_type.Missing values, pagination, transformations, and realtime periods.
Release and vintage endpointsInspect release calendars, release series, and dates when values changed.REST resources under /fred/releases and /fred/series/vintagedates.Release timing, revisions, vintage selection, and reproducibility.

FRED API access is free, but requests require an API key and remain subject to current terms and limits. Keep the key in server-side configuration or a secret manager rather than embedding it in public client code.

How to use the free FRED data API

1. Create a key and choose a series ID

Create a FRED account and request an API key, then identify a series such as GDP, CPIAUCSL, UNRATE, or FEDFUNDS. Do not infer meaning from the short ID alone; inspect the series title, units, frequency, seasonal adjustment, notes, source, and observation dates.

2. Request metadata before observations

Call /fred/series for the chosen ID before downloading values. This verifies that the identifier exists and gives the metadata needed to label a chart or database column accurately.

3. Make a small JSON request

curl "https://api.stlouisfed.org/fred/series/observations?series_id=GDP&api_key=YOUR_KEY&file_type=json&observation_start=2020-01-01" retrieves GDP observations from the selected start date. Replace YOUR_KEY at runtime, never in public source control.

4. Add caching, retries, and provenance

Cache to match the release schedule, respect retry guidance, record retrieval time and series metadata, preserve the source URL, and monitor schema changes.

Validate a FRED API response before publishing it

A successful HTTP status only proves that the FRED server answered. It does not prove that the returned series is the one your application intended to use. Inspect the original source, series identifier, frequency, unit, geography, seasonal-adjustment status, observation date, and release context in every response. Treat missing values as missing rather than zero, preserve status flags, and compare several observations with the visible FRED series page before approving an integration.

Keep raw data, provenance, and revision history

Store the raw response together with the request URL, parameters, retrieval timestamp, HTTP status, and relevant headers. A normalized record should retain the original provider code and series ID so a reviewer can reproduce the call. FRED time series may be corrected, rebased, seasonally adjusted again, or replaced with final observations. Decide whether the product always shows the latest vintage or preserves the value available on each retrieval date. Log schema changes and unexpected empty responses separately from network failures, and use bounded retries only for temporary errors.

For high-impact dashboards, alerts, or agent answers, add a release-date check before delivery. Confirm that the latest period is actually published, that a revised observation did not trigger a duplicate alert, and that a fallback source uses the same statistical concept. Display the observation date and retrieval time separately so users can distinguish when a value applies from when the application fetched it. Record the check result for later operational review and incident analysis.

Official FRED API vs aggregated economic data APIs

Use the official FRED API when you need FRED series metadata, release relationships, real-time periods, or vintage dates exactly as published. An aggregator may simplify a multi-provider application through one normalized schema, but it can rename fields, transform values, or update later than FRED. Preserve the original FRED series ID and source notes even when a normalized service sits in front of the official endpoint.

When an aggregator is the better engineering choice

An aggregator is useful when the application needs one query model across several providers or countries. A normalized catalog can reduce discovery time, standardize common fields, and simplify prototypes, dashboards, comparative research, or agent tools. That convenience does not transfer authority to the aggregator. Always retain the original provider code, dataset code, series identifier, unit, frequency, retrieval timestamp, and source URL. Review whether the aggregator transforms values, renames dimensions, changes missing-value markers, delays updates, or applies a separate license. For high-impact outputs, compare representative observations with the original portal and define a fallback path to the producer’s service.

Validate metadata, revisions, and data quality before use

Do not treat a series label as a complete definition

Two series can share a familiar label while measuring different concepts. An “interest rate” may be a policy target, an effective overnight rate, a lending facility rate, a deposit facility rate, or a monthly average. Inflation may be headline or core, monthly or annual, seasonally adjusted or unadjusted, preliminary or final. Before storing observations, capture the title, description, unit, multiplier, frequency, seasonal-adjustment status, geography, counterpart, valuation basis, and collection method. If the API provides dimension labels or codelists, store those mappings rather than relying only on compact codes.

Design explicitly for revisions and missing observations

Economic time series are revised. A provider may correct an error, incorporate a benchmark survey, rebase an index, change seasonal factors, or replace an estimate with a final value. Decide whether your product needs the latest vintage or the value known at a historical point in time. Preserve retrieval timestamps and, when available, release or vintage identifiers. Do not silently convert missing values to zero. Keep provider status flags, distinguish “not available” from “not applicable,” and test how the parser handles blank strings, symbols, nulls, and suppressed values. Validation rules should detect unexpected frequency changes, duplicate periods, unit changes, large discontinuities, and disappearing series.

Build a reliable production integration

Separate discovery, retrieval, normalization, and delivery

A maintainable pipeline gives each stage one responsibility. Discovery resolves a human request to a provider, dataset, and series. Retrieval calls the documented endpoint and stores the raw response with HTTP status, headers, request parameters, and retrieval time. Normalization converts dates, units, codes, and missing-value conventions into an internal schema without destroying the source representation. Delivery exposes the verified records to a dashboard, research notebook, database, API, or agent capability. Keeping the raw payload makes later debugging and reprocessing possible when a provider changes its schema or a transformation rule is corrected.

Match polling, caching, and retries to the release schedule

FRED series update on different release schedules. Use series frequency and release metadata to choose a refresh interval, cache stable history, and avoid reloading every observation when only recent periods can change. Apply bounded retries to temporary failures, but do not retry an invalid key or series ID indefinitely. Keep API keys outside client code and alert on stale data, repeated failures, or unexpected empty responses.

Common applications for the FRED data API

Research, dashboards, alerts, and AI agents

Researchers may combine policy rates, inflation, exchange rates, and monetary aggregates to study transmission mechanisms or compare economic cycles. Product teams may use the same series in internal dashboards, country profiles, treasury tools, or release alerts. Each use case needs a different freshness and revision policy. A historical paper may require a reproducible snapshot, while an operational dashboard usually needs the latest published value plus a visible “last updated” time. An alerting system needs idempotent release detection so a revision does not look like a new period.

For an AI agent, expose narrow, documented operations such as “search FRED series,” “retrieve observations for a series and date range,” or “list vintage dates.” Define required parameters, output fields, units, error states, and provenance. Limit the amount of data returned by default and require explicit date ranges for large downloads. The agent should cite FRED, the original producer, and the series ID, state the observation date, and distinguish retrieved facts from interpretation. QVeris can help discover, inspect, call, and audit these capabilities while the statistical producer remains authoritative for values and methodology.

For Python applications, use an environment variable for the API key, set a request timeout, call raise_for_status(), and parse missing observation markers explicitly. Store the exact request parameters with each imported batch so a later run can reliably reproduce the same series, date window, transformation, and real-time period.

How QVeris helps with the FRED data API

QVeris can help an agent discover, inspect, call, and audit real-world capabilities. For FRED data, each API should remain an inspectable capability with documented inputs, outputs, and provenance. QVeris does not own or change the underlying official data.

  • Use the QVeris Tool Finder to explore capabilities relevant to economic or financial data.
  • Inspect an operation’s parameters and response shape before an agent calls it.
  • Keep the provider URL, timestamp, series ID, and license context in downstream records.

FAQ

Is the FRED API free to use?

Yes. FRED provides API access without a paid subscription, but requests require a registered API key and must follow current terms and limits.

How do I get a free FRED API key?

Create a FRED account, request a key from the API Keys area, and store it in server-side configuration or a secret manager.

How do I request FRED data in JSON?

Add file_type=json, a valid series_id, and your API key to the documented series observations endpoint.

Can the FRED API return CSV data?

Yes. The series observations endpoint supports CSV and XLSX for compatible requests; check the endpoint’s current file-type rules.

Can QVeris replace the official provider?

No. QVeris helps agents discover and call capabilities; the provider remains authoritative for data, methods, licensing, and releases.

External references

Use the Free FRED Data API with Python and JSON | QVeris Guides