Saturday, August 13, 2011

Direct Links to FRED Data Graphs

To get the graph similar to the one Paul Kurgman posted on his NY Times opinion page about the output gap on August 11, use the following URL:

http://research.stlouisfed.org/fred2/graph/fredgraph.png?&id=GDP,NGDPPOT&scale=Left,Left&range=Custom,Custom&cosd=2005-01-01,2005-01-01&coed=2011-04-01,2012-12-31&line_color=%230000ff,%23ff0000&link_values=false,false&line_style=Solid,Solid&mark_type=NONE,NONE&mw=4,4&lw=1,1&ost=-99999,-99999&oet=99999,99999&mma=0,0&fml=a,a&fq=Annual,Annual&fam=avg,eop&fgst=lin,lin&transformation=lin,lin

The St. Louis Federal Reserve FRED website can generate graphs from the data, and the website accepts what is called POST requests. As you can see from the URL, the website just pass along all the possible options to a program that generate the graph and return that to you.

The benefit of figuring this out is then you can automate your computer to email you updates of the output gap. For me, I use an old laptop running Linux, and write a script to retrieve the picture using wget and then email it to me using Mutt. For people with Windows machines, you can do it in a batch file and schedule it using the Windows Task Scheduler. You can use the Windows version of wget to download the graph. However, I do not know of a good program to use to email yourself the graph using a batch file (perhaps Windows version of Mutt or Pine can do this).

Here, I set the option to do annual. You can do quarterly by changing “&fq=Annual,Annual&” to “&fq=Quarterly,Quarterly&

Reference: The Waste [NYTimes.com]