Project

fred

0.01
No release in over 3 years
Low commit activity in last 3 years
Ruby wrapper for the St. Louis Federal Reserve FRED API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 2.0.5, ~> 2.0
>= 0.5.0, ~> 0.5
 Project Readme

Fred

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

Installation

As a gem:

gem install fred

Get a FRED API key

Sign up for a FRED API key: https://api.stlouisfed.org/api_key.html

Usage

Instantiate a client

fred = Fred::Client.new(api_key: 'your_api_key')

or set FRED_API_KEY in your environment

export FRED_API_KEY=your_api_key
fred = Fred::Client.new

or configure once

Fred.configure do |config|
  config.api_key = 'your_api_key'
end
fred = Fred::Client.new

Examples

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

fred.series(nil, series_id: 'GNPA')
=> #<Fred::Mash seriess=#<Fred::Mash series=#<Fred::Mash id="GNPA" title="Gross National Product" frequency="Annual" ...>>>

fred.series('observations', series_id: 'GNPA')
=> #<Fred::Mash observations=#<Fred::Mash count="96" observation=[#<Fred::Mash date="1929-01-01" value="105.3">, ...]>>

Copyright

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

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