Intermediate 10 min read Module 8

FRED Data for Shipping Analysis

A practical guide to the Federal Reserve Economic Data system. Which series matter for shipping-price analysis, how to access them via web and API, and how to compute the changes that drive headlines.

What FRED Is and Why It Exists

FRED -- the Federal Reserve Economic Data system -- is a free, public database maintained by the Federal Reserve Bank of St. Louis. It contains over 800,000 time series covering macroeconomics, finance, trade, labor, prices, and dozens of other categories, drawn from more than 100 government agencies, central banks, and international organizations. The Bureau of Labor Statistics, Bureau of Economic Analysis, Census Bureau, US Treasury, European Central Bank, World Bank, and International Monetary Fund all feed data into FRED.

The St. Louis Fed launched FRED in 1991 as a dial-up bulletin board system. It moved to the web in 1996 and has been free to use without registration ever since. You do not need an account to browse, chart, or download any data series. An API key (also free) is required only for programmatic access.

For shipping-price analysis, FRED matters because it is the single best place to pull the economic data you need to connect maritime freight rates to consumer prices. Oil prices, CPI components, producer prices, import price indices, trade balance data, inflation expectations, consumer sentiment -- all of it is available in one place, in one format, with consistent date alignment and unit labeling. If you are building a spreadsheet, a Python script, or a research paper that tracks how shipping disruptions transmit into the real economy, FRED is where you start.

Accessing FRED: Web Interface and API

The Web Interface

Navigate to fred.stlouisfed.org and type a series ID or keyword into the search bar. Every data series has a dedicated page showing a chart, the raw data in table form, metadata (source, release schedule, units, seasonal adjustment), and tools for transforming the data directly in the browser.

The web interface supports three transformations that matter for shipping analysis. First, you can change the units to "Percent Change from Year Ago" to see year-over-year inflation rates without downloading anything. Second, you can overlay multiple series on one chart -- for example, plotting DCOILBRENTEU (Brent crude) against CPIENGSL (CPI energy component) to visually inspect the lag between oil price movements and consumer energy prices. Third, you can set custom date ranges to isolate specific disruption events: the 2021 Suez blockage, the 2022 energy shock, the 2023-24 Red Sea crisis.

FRED also offers a "My Account" dashboard where you can save custom charts, build data lists, and set up email notifications when specific series are updated. Registration is free. None of this is required for basic use, but it saves time if you are monitoring the same dozen series week after week.

The FRED API

For programmatic access, the FRED API provides RESTful endpoints that return JSON or XML. You need an API key, which you can obtain for free at fred.stlouisfed.org/docs/api/api_key.html. Registration takes about 30 seconds and requires only an email address.

The core endpoint is GET /fred/series/observations, which returns the data points for a given series ID. You can specify date ranges, sort order, and output units (including percent change) directly in the API call. For example, requesting CPIAUCSL with units=pc1 returns year-over-year percent change rather than the raw index value -- the API does the math for you.

Example API Call

GET https://api.stlouisfed.org/fred/series/observations?series_id=DCOILBRENTEU&observation_start=2023-01-01&observation_end=2024-12-31&units=lin&file_type=json&api_key=YOUR_KEY

Returns daily Brent crude prices for the full Red Sea crisis period in JSON format. Replace YOUR_KEY with your free API key.

Python users can skip the raw API entirely and use the fredapi package (installable via pip) or the pandas-datareader library, both of which wrap the API and return pandas DataFrames directly. R users have the fredr package. Excel users can pull FRED data through the built-in web query function or third-party add-ins.

The Series That Matter for Shipping-Price Analysis

FRED has 800,000 series. Most are irrelevant to shipping economics. The following fifteen are the ones you will actually use. Each series ID is a permanent identifier -- bookmark it, hardcode it in your scripts, cite it in your research. These IDs do not change.

Series ID Name Frequency What It Measures
CPIAUCSL Consumer Price Index for All Urban Consumers: All Items Monthly Headline inflation. The single most-watched price statistic in the United States. Base period 1982-84 = 100.
CPIFABSL CPI: Food at Home Monthly Grocery prices specifically. Directly sensitive to agricultural commodity shipping costs and import disruptions.
CPIENGSL CPI: Energy Monthly Gasoline, electricity, natural gas, fuel oil. The most volatile CPI component and the fastest to respond to shipping disruptions in the Strait of Hormuz.
DCOILWTICO Crude Oil Prices: West Texas Intermediate Daily The US benchmark crude oil price in dollars per barrel. Landlocked benchmark priced at Cushing, Oklahoma.
DCOILBRENTEU Crude Oil Prices: Brent - Europe Daily The international benchmark crude oil price. Brent reflects seaborne crude more directly than WTI because it is priced at a North Sea loading terminal.
GASREGW US Regular All Formulations Gas Price Weekly Retail gasoline price per gallon at the pump. The price consumers actually see and the one that shapes inflation expectations.
PPIACO Producer Price Index: All Commodities Monthly Wholesale commodity prices before retail markup. PPI movements lead CPI changes by 30 to 60 days on average.
IR Import Price Index: All Commodities Monthly Price changes for goods entering the US from abroad. The most direct measure of how international shipping costs flow into domestic prices.
BOPGSTB Trade Balance: Goods and Services Monthly Net exports minus imports in dollars. Rising imports during a freight rate spike indicate higher landed costs for the same volume of goods.
PCUOMFG PPI: Total Manufacturing Industries Monthly Factory-gate prices for manufactured goods. Sensitive to input costs including raw material shipping.
WPU0561 PPI: Ocean Freight Transportation Monthly (Q lag) Direct measure of ocean freight costs as a producer price. The closest thing FRED has to a container rate index.
PCETRIM12M159SFRBDAL Trimmed Mean PCE Inflation Rate Monthly Dallas Fed's trimmed mean measure of core inflation. Strips out extreme movers, giving a cleaner signal of underlying price pressure.
T5YIE 5-Year Breakeven Inflation Rate Daily Market-implied inflation expectation over the next five years. Derived from Treasury yields. Shows whether bond traders think shipping-driven inflation is transitory or persistent.
UMCSENT University of Michigan Consumer Sentiment Monthly Consumer confidence index. Gasoline prices are the single strongest predictor of month-to-month changes in this survey.
BUSLOANS Commercial and Industrial Loans Weekly Bank lending to businesses. Trade finance is a subset. When C&I lending contracts sharply, it can signal the same kind of trade finance freeze that collapsed the BDI in 2008.

A few notes on this list. CPIAUCSL is the seasonally adjusted CPI. The non-adjusted version is CPIAUCNS. For most shipping-price analysis, use the seasonally adjusted series because you want to isolate disruption effects from normal seasonal patterns (heating oil demand in winter, gasoline demand in summer). The one exception is when you specifically want to study seasonal shipping patterns -- then the unadjusted series preserves the seasonality you care about.

DCOILWTICO and DCOILBRENTEU deserve separate attention. WTI is the US domestic benchmark, priced at Cushing, Oklahoma -- a pipeline hub with no ocean access. Brent is priced at a North Sea loading terminal and better reflects global seaborne crude markets. When the Strait of Hormuz is under threat, Brent reacts first and WTI follows with a lag. The spread between them (Brent minus WTI) is itself a useful indicator of maritime risk: a widening spread often signals that seaborne crude is becoming more expensive relative to pipeline-delivered crude.

Computing Month-over-Month and Year-over-Year Changes

Raw index values are almost never what you want to report or chart. The CPI was 314.069 in March 2024. That number means nothing to most readers. What matters is the rate of change: how fast prices are rising, and whether that rate is accelerating or decelerating. FRED supports two standard transformations.

Month-over-Month (MoM) Change

MoM % = ((Current Value - Previous Month Value) / Previous Month Value) x 100

In the FRED web interface, set Units to "Percent Change." In the API, use units=pch. Month-over-month change is useful for spotting the immediate impact of a shipping disruption. A 0.5% monthly jump in the CPI energy component, for instance, is a meaningful signal even if the year-over-year rate looks moderate.

Year-over-Year (YoY) Change

YoY % = ((Current Value - Same Month Last Year) / Same Month Last Year) x 100

In the FRED web interface, set Units to "Percent Change from Year Ago." In the API, use units=pc1. Year-over-year change eliminates seasonal effects and is the standard measure used in BLS releases, Federal Reserve statements, and most media reporting. When a news headline says "inflation was 3.5%," they mean year-over-year CPI change.

Both transformations are available directly in the FRED interface without downloading or computing anything yourself. The API unit codes are: lin (levels, no transformation), chg (change from previous period), pch (percent change), pc1 (percent change from year ago), pca (compounded annual rate of change), and log (natural log).

Building Comparison Charts

The most useful FRED charts for shipping-price analysis overlay two or more series on the same time axis to reveal lead-lag relationships. The web interface makes this straightforward: open any series, click "Edit Graph," then use the "Add Line" button to include additional series. You can set each series to its own axis (left or right) if the scales differ, and apply independent unit transformations to each line.

Three comparison charts are particularly informative for shipping analysis.

Chart 1: Brent Crude vs. CPI Energy (YoY %)

Plot DCOILBRENTEU (percent change from year ago) against CPIENGSL (percent change from year ago). Brent leads CPI energy by roughly 4 to 8 weeks. The visual gap between the two lines during a disruption event tells you how much crude oil price movement has yet to transmit into consumer energy prices. If Brent has spiked but CPI energy has not yet responded, price increases are in the pipeline.

Chart 2: PPI All Commodities vs. CPI All Items (YoY %)

Plot PPIACO against CPIAUCSL, both as year-over-year percent change. PPI leads CPI by 30 to 60 days on average. When PPI accelerates and CPI has not yet followed, you can estimate the magnitude and timing of consumer price increases that are already locked in at the wholesale level. This chart is the backbone of pass-through analysis.

Chart 3: Import Prices vs. Trade Balance

Plot IR (import price index, YoY %) against BOPGSTB (trade balance, levels). When import prices rise and the trade deficit widens simultaneously, it usually means the US is paying more for roughly the same volume of goods -- a classic shipping cost pass-through scenario. When import prices rise but the deficit narrows, it may indicate demand destruction rather than cost pass-through.

Each of these charts can be saved to your FRED account, embedded on a website, or exported as an image or CSV. FRED generates stable URLs for custom charts, making them suitable for research papers and articles that need reproducible, linkable data visualizations.

Using FRED for Research and Citation

FRED is a secondary source. The data originates from primary sources -- the Bureau of Labor Statistics for CPI and PPI, the Energy Information Administration for oil prices, the Census Bureau for trade balance data. FRED aggregates and standardizes these sources into a common format.

For academic papers, the correct citation format references both the primary source and FRED as the access point. The St. Louis Fed provides suggested citations on every series page. A typical citation reads: "U.S. Bureau of Labor Statistics, Consumer Price Index for All Urban Consumers: All Items in U.S. City Average [CPIAUCSL], retrieved from FRED, Federal Reserve Bank of St. Louis." Include the retrieval date, because FRED data is subject to revision.

For journalism and market commentary, FRED provides the credibility of government-source data without requiring you to navigate each agency's individual data portal. It is considered a reliable, non-partisan source by editors, fact-checkers, and peer reviewers. The St. Louis Fed does not editorialize the data; it hosts and serves it.

FRED also offers GeoFRED (geographic data mapped at the county and metro level), FRASER (historical documents and discontinued data series), and ALFRED (archival data showing what each series value was as of a specific vintage date -- useful for studying data revisions). For shipping-price work, ALFRED is occasionally useful when you want to know what the CPI reading was on the day of a disruption event, before subsequent revisions changed the number.

Limitations: Lag Times, Revisions, and Gaps

FRED data is only as current as the source agencies that publish it. This creates publication lags that matter when you are trying to track the real-time effects of a shipping disruption.

Publication Lag by Series

  • Daily series (DCOILWTICO, DCOILBRENTEU, T5YIE): Published with a 1-day lag. Close to real-time, but still one business day behind spot markets.
  • Weekly series (GASREGW, BUSLOANS): Published with a 1- to 5-day lag after the reporting week ends. Gasoline prices are released every Monday for the prior week.
  • Monthly series (CPIAUCSL, PPIACO, IR, BOPGSTB): Published 2 to 5 weeks after the reference month ends. CPI for March is typically released in the second week of April. Trade balance data runs about 5 weeks behind.

Revisions are the second limitation. The BLS revises CPI data once annually (in February, revising the prior five years of seasonally adjusted data). Trade balance data from the Census Bureau is revised monthly for two months after initial publication. PPI undergoes annual revisions. Import price data is revised in the month after initial release. The first published number for any monthly series is a preliminary estimate, not a final figure. If you are building a model that reads from FRED in real-time, you need to account for the possibility that the number you pulled today will be different next month.

The third limitation is coverage gaps. FRED does not carry container freight rate indices (no Freightos Baltic Index, no Shanghai Containerized Freight Index, no Drewry World Container Index). It does not carry the Baltic Dry Index. It does not carry AIS vessel tracking data or port throughput statistics. For the shipping-specific half of any shipping-price analysis, you need data sources outside FRED -- Yahoo Finance for BDI, Freightos for container rates, MarineTraffic or VesselFinder for AIS data. FRED covers the price side of the equation. The shipping side requires separate sources that you then join to FRED data by date.

Finally, FRED's geographic scope is US-centric. CPI, PPI, and import prices are US measures. If you are studying how shipping disruptions affect European or Asian consumer prices, you will need Eurostat for HICP (European inflation), Japan's Statistics Bureau for Japanese CPI, or the relevant national statistics office. FRED does carry some international series (Brent crude, for instance, and selected OECD data), but the depth of coverage drops sharply outside the United States.

Key Takeaways

  1. FRED is a free, public database of 800,000+ economic time series maintained by the Federal Reserve Bank of St. Louis. No registration is needed for web access; a free API key is needed for programmatic access.
  2. For shipping-price analysis, the fifteen series in the reference table above cover headline inflation, energy prices, crude oil benchmarks, wholesale prices, import prices, and trade balance data -- the full transmission chain from freight rates to consumer costs.
  3. FRED computes month-over-month and year-over-year changes for you, both in the web interface and via API unit parameters (pch and pc1).
  4. Comparison charts overlaying crude oil, PPI, CPI, and import price series reveal lead-lag relationships that quantify how fast shipping cost shocks pass through to consumer prices.
  5. Monthly series lag 2 to 5 weeks behind real-time. All series are subject to revision. The first-published number is always preliminary.
  6. FRED does not carry container freight indices, the Baltic Dry Index, or vessel tracking data. It covers the price side of shipping-price analysis. The shipping side requires separate sources.
  7. FRED is a secondary aggregator. For academic citation, reference both the primary source agency and FRED as the access point.

Resources