Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/phuphighter/fred

Ruby wrapper for the St. Louis Federal Reserve Economic Data (FRED) API
https://github.com/phuphighter/fred

Last synced: about 1 month ago
JSON representation

Ruby wrapper for the St. Louis Federal Reserve Economic Data (FRED) API

Awesome Lists containing this project

README

        

# Fred

This is a Ruby wrapper for the St. Louis Federal Reserve Economic Data [Fred API](http://api.stlouisfed.org/).

## Installation

As a gem:

gem install fred -v 0.3.0

## Get a FRED API key

Sign up for a Fred API key: [http://api.stlouisfed.org/api_key.html](http://api.stlouisfed.org/api_key.html)

## Usage

### Instantiate a client

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

### 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')
=> <#Hashie::Mash categories=<#Hashie::Mash category=<#Hashie::Mash id="125" name="Trade Balance" parent_id="13">>>

>> fred.series(nil, :series_id => 'GNPA')
=> #>>

>> fred.series('observations', :series_id => 'GNPA')
=> #,
.....
#] 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">>
## 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