Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
83 lines (47 sloc) 1.43 KB

fred

Python wrapper of the St. Louis Federal Reserve Bank's FRED API web service for retrieving economic data.

FRED API Documentation: http://api.stlouisfed.org/docs/fred/

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

API Key

You can save your API key, and have it automatically accessible, on the command line:

$ export FRED_API_KEY=my_api_key

Usage

This wrapper hopes to make working with the Fred API as easy as possible.

>>> import fred

# Save your FRED API key.
>>> fred.key('my_fred_api_key')


# Interact with economic data categories.
>>> fred.category()

>>> fred.categories()

>>> fred.children()

>>> fred.related()

>>> fred.category(series=True)

>>> fred.category_series()


# Interact with economic data releases.
>>> fred.releases()

>>> fred.release(123)

>>> fred.dates()


# Interact with economic data series.
>>> fred.series()

>>> fred.series(release=True)

>>> fred.observations()

>>> fred.search('search term')

>>> fred.updates()

>>> fred.vintage()


# Query economic data sources.
>>> fred.sources()

>>> fred.source(123)

NOTE: Normally, data is returned in dictionary format instead of XML. If you're looking for XML output, however, just pass in the xml=True keyword argument.

>>> import fred

>>> fred.releases(xml=True)
Jump to Line
Something went wrong with that request. Please try again.