Free Economic Chart Widget for Your Website

Add a live chart of a US economic indicator to any website or blog: inflation, the Fed funds rate, Treasury yields, the yield curve, unemployment, job growth, GDP, gas prices and 27 indicators in all. Each chart shows the latest value, changes, the full history with recessions shaded and range buttons, and updates by itself every day. Pick a chart, copy two lines of code and paste them into your page – no sign-up and no API key.

Get the code

Free for any website, personal or commercial. Choose the options, copy the code and paste it into your page; the chart updates by itself every day.

Starting range
Size
Theme
Recession bands

Live preview

Please keep the two links in the code visible and unchanged. Data: public-domain US government statistics via FRED, refreshed daily. See the widget guide for all options.

How to add an economic chart to your website

  1. Choose a chart above and the range, size and theme. The preview shows exactly what your visitors will see.
  2. Click Copy code.
  3. Paste the code into your page’s HTML where the chart should appear – inside an article, in a sidebar or on a dashboard – and publish.

The code has two parts: a <div> that marks where the chart goes, and a <script> that draws it:

<div class="ql-macro" data-series="unemployment-rate" data-range="10y" data-theme="light">
  <a href="https://www.quotelinks.com/economy/unemployment-rate.html">US unemployment rate chart</a> by
  <a href="https://www.quotelinks.com/">Quotelinks</a>
</div>
<script src="https://www.quotelinks.com/widgets/macro.js" async></script>

The two links are shown under the chart. If JavaScript is turned off, visitors still see them as plain links.

Step by step for popular platforms

  • WordPressIn the block editor add a Custom HTML block and paste the code. For a sidebar, use Appearance › Widgets and add a Custom HTML widget.
  • BloggerFor a post, switch to HTML view and paste. For the sidebar, go to Layout › Add a Gadget › HTML/JavaScript.
  • SquarespaceAdd a Code block to the page and paste the code. Leave “Display Source” off.
  • WixUse Add › Embed Code › Embed HTML, choose “Code” and paste. Give the frame about 640 × 440 px (compact: 320 × 380).
  • GhostIn the editor add an HTML card and paste the code.
  • Plain HTMLPaste the code anywhere inside <body>.

Options

AttributeValuesWhat it does
data-seriesa chart id from the list belowThe indicator to show.
data-range1y, 5y, 10y (default), 20y, maxThe range shown first. Visitors can switch with the buttons.
data-sizefull (default), compactFull fits the width of your column, up to 720 px. Compact is up to 320 px wide for sidebars.
data-themelight (default), dark, autoAuto follows each visitor’s light or dark system setting.
data-recessionson (default), offGrey bands for US recessions (NBER dates).

All charts

data-seriesChartSource
fed-funds-rateFederal Funds RateFederal Reserve
10-year-treasury-yield10-Year Treasury YieldFederal Reserve
2-year-treasury-yield2-Year Treasury YieldFederal Reserve
30-year-treasury-yield30-Year Treasury YieldFederal Reserve
3-month-treasury-bill3-Month Treasury Bill RateFederal Reserve
yield-curveYield Curve (10Y − 2Y)Federal Reserve
prime-ratePrime RateFederal Reserve
real-interest-rateReal Interest Rate (10-Year TIPS)Federal Reserve
inflation-expectationsInflation Expectations (10-Year)Federal Reserve
inflation-rateUS Inflation RateBLS
core-inflation-rateCore Inflation RateBLS
pce-inflationPCE Inflation RateBEA
core-pce-inflationCore PCE Inflation RateBEA
unemployment-rateUS Unemployment RateBLS
job-growthUS Job GrowthBLS
wage-growthUS Wage GrowthBLS
gdp-growthUS GDP GrowthBEA
misery-indexMisery IndexBLS
personal-saving-ratePersonal Saving RateBEA
retail-sales-growthRetail Sales GrowthCensus Bureau
industrial-productionIndustrial Production GrowthFederal Reserve
housing-startsHousing StartsCensus Bureau
gas-pricesUS Gas PricesEIA
oil-pricesCrude Oil Prices (WTI)EIA
home-price-growthUS Home Price GrowthFHFA
m2-money-supplyM2 Money SupplyFederal Reserve
national-debtUS National DebtU.S. Treasury

Several charts on one page

Repeat the <div> for each chart and add the <script> tag only once:

<div class="ql-macro" data-series="inflation-rate" data-size="compact">
  <a href="https://www.quotelinks.com/economy/inflation-rate.html">US inflation rate chart</a> by
  <a href="https://www.quotelinks.com/">Quotelinks</a>
</div>
<div class="ql-macro" data-series="fed-funds-rate" data-size="compact">
  <a href="https://www.quotelinks.com/economy/fed-funds-rate.html">Fed funds rate chart</a> by
  <a href="https://www.quotelinks.com/">Quotelinks</a>
</div>
<script src="https://www.quotelinks.com/widgets/macro.js" async></script>

More free widgets

The Stock Card shows a quote for any US stock or ETF, the Ticker Tape a scrolling strip of prices, and Market Movers the day’s top gainers and losers. See all widgets and the investing calculators.

Terms of use

The Economic Chart widget is free for any website, personal or commercial. In return, please keep the two links in the code visible and unchanged. The data are public-domain US government statistics; Quotelinks shows them for information only, not as investment advice. See the disclaimer.

Frequently asked questions

Is the Economic Chart widget free?

Yes. It is free for personal and commercial websites, with no sign-up and no API key. The only condition is that the two links in the embed code stay in place and visible.

How often is the data updated?

Quotelinks checks FRED for new releases every day. Most indicators are monthly and change when the agency publishes a new number, for example the unemployment rate on the first Friday of the month. Charts of daily data such as Treasury yields update every day with the month-to-date average.

Where does the data come from?

From US government agencies (BLS, BEA, the Federal Reserve, the Census Bureau, EIA, FHFA and the Treasury) through FRED at the Federal Reserve Bank of St. Louis. These are public-domain statistics.

Will it slow down my page?

No. The script is about 7 KB compressed, loads with async so it never blocks your page, and makes one small request per chart. Charts are drawn as SVG, without a charting library.

Will my site's CSS break the chart?

No. The chart is drawn inside a Shadow DOM, so your styles don't change it and its styles don't leak into your page.

Can visitors change the time range?

Yes. The buttons switch between 1 year, 5 years, 10 years, 20 years and the full history without reloading. data-range only sets the range shown first.

Can I show several charts on one page?

Yes. Repeat the <div> for each chart and include the <script> tag only once.

What if a chart id is mistyped?

The widget shows “Chart unavailable” and keeps the links, so nothing breaks on your page.