Ruby wrapper for the St. Louis Federal Reserve Economic Data (FRED) API
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
generators/fred initial commit Mar 7, 2010
lib update to https Jul 18, 2015
tasks initial commit Mar 7, 2010
test fixed fakeweb url Aug 24, 2010
MIT-LICENSE initial commit Mar 7, 2010 update 0.3.0 Jul 22, 2015
Rakefile fix undefined method `prerelease? issue Jul 22, 2015
VERSION update 0.3.0 Jul 22, 2015
fred.gemspec update 0.3.0 Jul 22, 2015
init.rb initial commit Mar 7, 2010
install.rb initial commit Mar 7, 2010
uninstall.rb initial commit Mar 7, 2010


This is a Ruby wrapper for the St. Louis Federal Reserve Economic Data Fred API.


As a gem:

gem install fred -v 0.3.0    

Get a FRED API key

Sign up for a Fred API key:


Instantiate a client

>> fred = => 'your_api_key')

or configure once

>> Fred.configure do |config|
>>   config.api_key = 'your_api_key'
>> end
>> fred =


>> fred.category(nil, :category_id => '125')
=> <#Hashie::Mash categories=<#Hashie::Mash category=<#Hashie::Mash id="125" name="Trade Balance" parent_id="13">>>

>> fred.series(nil, :series_id => 'GNPA')
=> #<Hashie::Mash seriess=#<Hashie::Mash realtime_end="2013-08-26" realtime_start="2013-08-26" series=#<Hashie::Mash frequency="Annual" frequency_short="A" id="GNPA" last_updated="2013-07-31 09:26:17-05" notes="BEA Account Code: A001RC1" observation_end="2012-01-01" observation_start="1929-01-01" popularity="46" realtime_end="2013-08-26" realtime_start="2013-08-26" seasonal_adjustment="Not Seasonally Adjusted" seasonal_adjustment_short="NSA" title="Gross National Product" units="Billions of Dollars" units_short="Bil. of $">>>

>> fred.series('observations', :series_id => 'GNPA')
=> #<Hashie::Mash observations=#<Hashie::Mash count="84" file_type="xml" limit="100000" observation=[#<Hashie::Mash date="1929-01-01" realtime_end="2013-08-26" realtime_start="2013-08-26" value="105.3">,
#<Hashie::Mash date="2012-01-01" realtime_end="2013-08-26" realtime_start="2013-08-26" value="16497.4">] observation_end="9999-12-31" observation_start="1776-07-04" offset="0" order_by="observation_date" output_type="1" realtime_end="2013-08-26" realtime_start="2013-08-26" sort_order="asc" units="lin">>


Contact me if you have any suggestions and feel free to fork it!

Copyright (c) 2009 Johnny Khai Nguyen, released under the MIT license