This product uses the FRED® API but is not endorsed or certified by the Federal Reserve Bank of St. Louis.
https://fred.stlouisfed.org/docs/api/fred/fred.html
https://developers.google.com/apps-script/guides/sheets/functions
https://fred.stlouisfed.org/docs/api/fred/#API
Change the variable api_key
to your API-Key (32 character lower-cased alpha-numeric string)
var api_key = 'abcdefghijklmnopqrstuvwxyz123456';
3.1. Get the newest value (Gross Domestic Product, Series-ID = GDP):
=fredDATA("GDP",0)
3.2. Get all historical values (Unemployment Rate, Series-ID = UNRATE):
=fredDATA("UNRATE",1)
4. Use Case ("Buffett-Indicator" - Stock Market Capitalization-to-GDP Ratio)
=query(fredDATA("WILL5000PR",0),"select Col2 offset 1",0)*1.05/QUERY(fredDATA("GDP",0),"select Col2 offset 1",0)